IRControl How


IRControl
  • What
  • How
  • History
  • Download

  • After downloading, open the disk image and double click on the preference panel. You will be asked whether to install for all users or just the one currently logged in. Next you should see a message that the IR-FBA (the faceless background application) is not running, and offering to launch it for you (hint: click the launch button).

    You should see a window like this:

    Checking the box labelled "Launch IR FBA at Startup" will add the IF-FBA application to your startup items. If you want your machine to respond to remote signals (e.g. to control iTunes) then you should enable this. If you will only use your machine for sending signals (to control other devices) then this is not necessary, though it will improve response times.

    The blank pop-up menu is a list of all the remotes whose information is saved in the preferences. You use your remote(s) to fill in this data. Point your remote at the IR USB transceiver and press any button.

    A dialog will appear asking if you want to add a new remote:

    Clicking on "New Remote" will use the data (signal timings) from the just received button press to add a new remote to the preferences.
    You can change any of the information, though you should leave the numbers for the signal timing as they are.

    The data (binary code) for the particular button you pressed (Power, Play, etc.) is also added. It can be seen under the "Buttons" tab.

    You should change the name of the button from "unknown1" to something more meaningful (i.e. Play, Rewind, etc.) This is the name that you will use within Applescript to have the computer send the signal/command.

    You can also set up the actions you want triggered whe the signal is received by the computer.

    In this example, the Applescript command "playpause" will be sent to iTunes. These actions will not be triggered while the Preferences are open. Nor will they take place if the FBA is not launched, or the IR transceiver is not connected (obviously).

    Now you may want to record in the preferences the other buttons on the remote. The easiest way to do this is to check the boxes "Ignore Unknown Remotes" and "Add Received Buttons Automatically."

    As you press each button, it is added to the remote and you can enter the button's name. If you press a button which is already in the preferences, the information for that button will be displayed.



    Sending signals is done with Applescript, after information for remotes has been recorded in the preferences. Here are some examples:
    tell application "IR-FBA"
       -- get names of all the known remotes:
       set rems to remotes
       return rems
    end tell
    
    -->  {remote "Apex-RM-1160" of application "IR-FBA", 
    remote "JVC-RM-V718U" of application "IR-FBA"}
    
    
    tell application "IR-FBA"
       -- get the buttons of one remote
       set theButtons to buttons of remote "JVC-RM-V718U"
       return theButtons
    end tell
    
    -->  {button "Zoom W" of remote "JVC-RM-V718U" of application "IR-FBA", 
    button "Display" of remote "JVC-RM-V718U" of application "IR-FBA", 
    button "Fast Forward to End" of remote "JVC-RM-V718U" of application 
    "IR-FBA", button "Pause" of remote "JVC-RM-V718U" of application "IR-FBA",
     button "Effect" of remote "JVC-RM-V718U" of application "IR-FBA", button
      "Rewind" of remote "JVC-RM-V718U" of application "IR-FBA"}
    
    
    tell application "IR-FBA"
       -- send the Pause command to the JVC camcorder
       send button "Pause" of remote "JVC-RM-V718U"
    end tell
    
    -->  true 
    


    The faceless-background application stores up to the last 100 signals received by the IR transceiver. You can access these with Applescript also.
    tell application "IR-FBA"
       -- get all received signals still in memory
       set theSigs to IRSignals
       return theSigs
    end tell
    
    -->  {IRSignal "20070925-153709.4844" of application "IR-FBA", IRSignal
    "20070925-153710.1250" of application "IR-FBA", IRSignal 
    "20070925-153711.2969" of application "IR-FBA", IRSignal 
    "20070925-153711.8594" of application "IR-FBA"}
    
    The 'name' of the signal is the date and time it was received. The signal's data is accessed as below:
    tell application "IR-FBA"
       -- get all received signals still in memory
       set theSigs to IRSignals
       set oneSignal to item 1 of theSigs
       return properties of oneSignal
    end tell
    
    -->  {live header time:3754.0, name:"20070925-153709.4844", repeat gap
    time:2.1631E+4, class:IRSignal, one time:1493.0, zero time:448.0, dead 
    header time:8448.0, null time:564.0, repeat wakeup:false}
    
    
    tell application "IR-FBA"
       -- get all the codes of the first stored signal
       set theSigs to IRSignals
       set oneSignal to item 1 of theSigs
       return codes of oneSignal
    end tell
    
    -->  {code "#0" of IRSignal "20070925-153709.4844" of application "IR-FBA",
    code "#1" of IRSignal "20070925-153709.4844" of application "IR-FBA", code 
    "#2" of IRSignal "20070925-153709.4844" of application "IR-FBA", code "#3"
     of IRSignal "20070925-153709.4844" of application "IR-FBA"}
    
    
    tell application "IR-FBA"
       -- get the first binary code of the signal 
       set theSigs to IRSignals
       set oneSignal to item 1 of theSigs
       set theCodes to codes of oneSignal
       set oneCode to item 1 of theCodes
       return binCode of oneCode
    end tell
    
    -->  {"1100101110110000"}
    


    The following example will report what buttons were pressed, if they are known to the program, and then empty the signal storage buffer.
    tell application "IR-FBA"
       --report which buttons have been pressed, then erase the memory
       set theSigs to IRSignals
       set thesebuts to {}
       repeat with x in theSigs
          set sigCode to codes of x
          repeat with y in sigCode
             set bC to binCode of y
             set matches to ((every button whose binCode is bC) in remotes)
             repeat with z in matches
                if (class of z is button) then
                   set thesebuts to thesebuts & 
                     ("button " & name of z & " of remote " & 
                     (name of container of z))
                end if
             end repeat
          end repeat
       end repeat
       empty IRSignal buffer
       return thesebuts
    end tell
    
    --> {"button Pause of remote JVC-RM-V718U", "button Pause of remote 
    JVC-RM-V718U", "button Pause of remote JVC-RM-V718U", "button Pause
    of remote JVC-RM-V718U", "button Play of remote JVC-RM-V718U", "button
     Play of remote JVC-RM-V718U"}
    
    Note that each button press usually sends more than one signal, i.e. the signal repeats before you can physically release the button.



    If there is a remote whose codes are not sent in a pattern that IRControl can recognize, there is still a way to capture and use the signals.
    tell application "IR-FBA"	
    	set theSigs to IRSignals
    	set asig to item 1 of theSigs -- first IRSignal
    	get properties of asig
    end tell
    
    
    -->  {repeat space time:2304, pulses:{0, 20245, 1, 9002, 0, 4544, 1, 533, 0, 1664, 1, 512, 0, 597, 1, 490,
                                          0, 576, 1, 512, 0, 554, 1, 576, 0, 533, 1, 512, 0, 576, 1, 512, 
                                          0, 554, 1, 533, 0, 576, 1, 512, 0, 576, 1, 512, 0, 1685, 1, 490, 
                                          0, 1728, 1, 512, 0, 1706, 1, 533, 0, 1664, 1, 554, 0, 1685, 1, 490, 
                                          0, 1728, 1, 554, 0, 1664, 1, 576, 0, 1664, 1, 554, 0, 554, 1, 512, 
                                          0, 1706, 1, 490, 0, 576, 1, 512, 0, 576, 1, 512, 0, 576, 1, 490, 
                                          0, 618, 1, 490, 0, 1685, 1, 554, 0, 576, 1, 469, 0, 1749, 1, 512, 
                                          0, 576, 1, 512, 0, 1664, 1, 554, 0, 1706, 1, 512, 0, 1706, 1, 512, 
                                          0, 1706, 1, 512, 0, 618, 1, 490, 0, 40277, 1, 9002, 0, 2304, 1, 533},
             codes:{"10000000011111111010000101011110"}, header space time:4544, one pulse time:519, class:IRSignal, 
             header pulse time:9002.0, repeat pulse time:9002, three pulse time:missing value, one space time:1694, zero space time:575, 
             name:"20111002-132130", three space time:0, trailing space time:40277, zero pulse time:519, two pulse time:missing value, 
             repeat headers:false, carrier frequency:3.8E+4, trailing pulse time:490, two space time:0}
    
    You can examine the pulses data, trim off any repeats or initial/trailing silences, and then send the pulse array to the Iguana for transmission.
    tell application "IR-FBA"	
    	transmit pulses {1, 9002, 0, 4544, 1, 533, 0, 1664, 1, 512, 0, 597, 1, 490, 0, 576, 1, 512, 
    	                 0, 554, 1, 576, 0, 533, 1, 512, 0, 576, 1, 512, 0, 554, 1, 533, 
    	                 0, 576, 1, 512, 0, 576, 1, 512, 0, 1685, 1, 490, 0, 1728, 1, 512, 
    	                 0, 1706, 1, 533, 0, 1664, 1, 554, 0, 1685, 1, 490, 0, 1728, 1, 554, 
    	                 0, 1664, 1, 576, 0, 1664, 1, 554, 0, 554, 1, 512, 0, 1706, 1, 490, 
    	                 0, 576, 1, 512, 0, 576, 1, 512, 0, 576, 1, 490, 0, 618, 1, 490, 
    	                 0, 1685, 1, 554, 0, 576, 1, 469, 0, 1749, 1, 512, 0, 576, 1, 512, 
    	                 0, 1664, 1, 554, 0, 1706, 1, 512, 0, 1706, 1, 512, 0, 1706, 1, 512, 
    	                 0, 618, 1, 490,0, 40277}
    end
    
    --> {1, 9002, 0, 4544, 1, 533, 0, 1664, 1, 512, 0, 597, 1, 490, 0, 576, 1, 512, 
    0, 554, 1, 576, 0, 533, 1, 512, 0, 576, 1, 512, 0, 554, 1, 533, 0, 576, 1, 512, 
    0, 576, 1, 512, 0, 1685, 1, 490, 0, 1728, 1, 512, 0, 1706, 1, 533, 0, 1664, 1, 554, 
    0, 1685, 1, 490, 0, 1728, 1, 554, 0, 1664, 1, 576, 0, 1664, 1, 554, 0, 554, 1, 512, 
    0, 1706, 1, 490, 0, 576, 1, 512, 0, 576, 1, 512, 0, 576, 1, 490, 0, 618, 1, 490, 
    0, 1685, 1, 554, 0, 576, 1, 469, 0, 1749, 1, 512, 0, 576, 1, 512, 0, 1664, 1, 554, 
    0, 1706, 1, 512, 0, 1706, 1, 512, 0, 1706, 1, 512, 0, 618, 1, 490, 0, 40277}
    



    Other Software | email: AaronProman at Yahoo