Zapper (1.0)

This plugin runs any specified command whenever Windows Media Center attempts to change channel.

The plugin is forked from Dan Glass's plugin for controlling DirectTV with MCE,
which is available at: http://blog.dan.netidentity.com/blog/_archives/2004/10/24/165904.html 

I personally use it for controlling my MCE-unsupported Satellite TV receiver with a USBUIRT
blaster device through Girder.
Hence the default config settings issue the girder "event" command with the channel.

Requirements: 
* Windows XP MCE 2004 or 2005 
* .NET Framework v1.1 

Install:

* Unzip the zip file into any directory.

  - There's no installer - this is your final installation directory.

  - If you move it later, make sure that zapper.config is in the same directory as the
    zapper.dll.

* Edit zapper.config:

  - The default settings are for use with Girder, assuming girder is installed in c:\utils\girder

  - Zapper will take the specified Executable and run it with the specified CommandLineArgs,
    but only after it has replaced the text specified in ChannelPlaceholder with the actual
    channel number that Media Center is changing to.
	
    For example, the default will run Girder's "event.exe" with the arguments 

      "#{channel} -silent"

    where ChannelPlaceholder is specified as "{channel}". So when my Media Center changes to
    channel 32, it effecively runs the command line:

       girder\event.exe #32 -silent

    (the # character is not necessary - it's just part of the event I look for in Girder)

    In Girder I have a "multigroup" set up to change to channel 32 which does something like:
       transmit 0
       delay 300 (milliseconds)
       transmit 3
       delay 300 (milliseconds)
       transmit 2
       (There are more efficient and generic ways to do this in Girder, but my STB is so
       finicky that it uses somewhere between two and four different codes for the same digit
       so I have to set it up just right for each channel.)

    This command group has a Girder event with the string set to "#32".

  - Make sure you don't have any un-escaped special XML characters in the config file.
    For example if you use <channel> as a placeholder, the utility will just bomb.

  - Make sure the log file has a full path, and that all backslashes in paths are escaped, 
    hence c:\\girder...

  - Later you can double-check that your command line is correct by looking in the log file.
    All channel change commands are logged.

* Run reg.bat 

* Reboot (or shut down the windows services, and kill all processes starting with eh*) 

* If it fails, check the log file for details.

* Note that Zapper (and the DirectTV plugin it's based on) get the channel change events
  directly from Media Center, independently of any settings you may have chosen for your
  STB. So, for example, even if you specified that your STB requires 3 digits for changing
  the channel, followed by the Enter button, Media Center will still only send out the 
  string "32" for changing to channel 32, not 032, not 032Enter. If you need to pad (as I
  do) the you do that in Girder or whatever command you are running with Zapper.

Uninstall:
* Run unreg.bat
* Reboot (or shut down the windows services, and kill all processes starting with eh*) 

Thanks again to Dan Glass for doing all the hard work in the DirectTV plugin that
made this all, not only possible, but easy.

Enjoy,
Rhubarb.

(rover.rhubarb@gmail.com)

