Since a lot of people here in the U.S. have DirecTV, I decided to
create a plugin to handle sending IR signals to a DirecTV receiver.  So
far this plugin has worked quite well on my friend's Freevo box.  I've
attached the plugin and a patch for config.py to add the irsend_trans
setting, described below.

The setting "irsend_trans" has to be added to the TV_VIDEO_GROUP which
belongs to the DirecTV external tuner to make everything work correctly
with the IR transceivers that come with the Hauppauge MCE Kits.  These
IR units have 2 blaster ports.  One port _should_ be selected for use
with the DirecTV receiver.  The other port could be used with a VCR or
other IR controlled unit.  If the IR port on the transceiver isn't
selected, BOTH blasters fire (if connected), potentially causing
improper behaviour of the DirecTV unit.

I'm working on moving the core IR functions out into a separate plugin.


      
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
--- ./freevo-1.8.0rc1/src/config.py	2007-12-10 11:33:43.000000000 -0500
+++ ./freevo-1.8.0rc1_MODIFIED/src/config.py	2007-12-24 03:19:29.000000000 -0500
@@ -149,26 +149,27 @@
 
 class VideoGroup:
     """
-    vdev:         The video recording device, such as /dev/video0.
-    vvbi:         The video vbi device, such as /dev/vbi0.
-    adev:         The audio device, such as /dev/dsp.
-    input_type:   tuner, webcam
-    input_num:    The number of this input according to V4L
-    tuner_type:   internal (on a v4l device), or external (cable or sat box)
-    tuner_norm:   NTSC, PAL, SECAM
+    vdev:            The video recording device, such as /dev/video0.
+    vvbi:            The video vbi device, such as /dev/vbi0.
+    adev:            The audio device, such as /dev/dsp.
+    input_type:      tuner, webcam
+    input_num:       The number of this input according to V4L
+    tuner_type:      internal (on a v4l device), or external (cable or sat box)
+    tuner_norm:      NTSC, PAL, SECAM
     tuner_chanlist:  us-cable,
-    tuner_chan:   If using input_type=tuner and tuner_type=external set this to
-    what channel it needs to be to get the signal, usually 3 or 4.
-    record_group: VideoGroup that records for this tuner, default is to use the same device for record and play
-    desc:         A nice description for this VideoGroup.
-    group_type:   Special variable to identify devices like dvb or ivtv.  This
-        can be left as default, 'normal', or set to 'ivtv', 'dvb', 'webcam', 'tvalsa'.
-    cmd:          Command for execute external prog after the channel switched, such as 'sudo /usr/local/bin/setuptuner'
+    tuner_chan:      If using input_type=tuner and tuner_type=external set this to
+                     what channel it needs to be to get the signal, usually 3 or 4.
+    irsend_trans:    IR transmitter to use for multiple external tuners.
+    record_group:    VideoGroup that records for this tuner, default is to use the same device for record and play
+    desc:            A nice description for this VideoGroup.
+    group_type:      Special variable to identify devices like dvb or ivtv.  This
+                     can be left as default, 'normal', or set to 'ivtv', 'dvb', 'webcam', 'tvalsa'.
+    cmd:             Command for execute external prog after the channel switched, such as 'sudo /usr/local/bin/setuptuner'
     """
 
     def __init__(self, vdev=None, vvbi='/dev/vbi', adev=None, input_type=None,
                  input_num=0, tuner_norm=None, tuner_chanlist=None,
-                 tuner_type='internal', tuner_chan=None,
+                 tuner_type='internal', tuner_chan=None, irsend_trans=None,
                  record_group=None, desc='Freevo Default Video Group',
                  group_type='normal', cmd=None):
 
@@ -191,6 +192,7 @@
         self.tuner_norm = string.upper(tuner_norm)
         self.tuner_chanlist = tuner_chanlist
         self.tuner_chan = tuner_chan
+	self.irsend_trans = irsend_trans
         self.record_group = record_group
         self.desc = desc
         self.group_type = group_type
# -*- coding: iso-8859-1 -*-
# -----------------------------------------------------------------------
# irsend_directv.py - Send commands to a DirecTV receiver using a
#                     shell command like irsend from Lirc.
# -----------------------------------------------------------------------
# $Id: irsend_directv.py 2007-12-02 22:32:00ET mlbeal $
#
# Notes:  Plugin wrapper for irsend or any other remote control command.
#
# Todo:  Clean out the junk.
#        Finish testing for irsend_core
#
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
# Copyright (C) 2003 Krister Lagerstrom, et al.
# Please see the file freevo/Docs/CREDITS for a complete list of authors.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MER-
# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------


import os, sys, time, string
import plugin
#import irsend_core


class PluginInterface(plugin.Plugin):
    """
    Use this plugin if you need to use Lirc's irsend (or similar) command
    to tell an external tuner to change the channel.

    Since MCEUSB transceivers can have 2 transmitters, the chosen
    transmitter must be set in local_conf.py.

    Example usage (local_conf.py):

    plugin_external_tuner = plugin.activate('tv.irsend_directv',
                            args=('/usr/bin/irsend SEND_ONCE <remote_name>','/usr/bin/irsend SET_TRANSMITTER', ))

    Where <remote_name> is the name of the remote you are using to send codes
    with in lircd.conf.
    """

    def __init__(self, command, trans_cmd, enterkey=None):
        plugin.Plugin.__init__(self)

        self.command = command
	self.trans_cmd = trans_cmd
        self.enterkey = enterkey
	self.delay = '0.3'

        plugin.register(self, 'EXTERNAL_TUNER')


    def setChannel(self, chan, transmitter=None):
	transmitter = str(transmitter)
        chan = str(chan)
        digits = len(chan)
        chan_args = ''
	
        if transmitter:
	    self.selectTransmitter(transmitter)
            self.irSleep()

        for i in range(digits):
            self.transmitSignal(chan[i])
            self.irSleep()

        if self.enterkey:
            # Sometimes you need to send "ENTER" or "SELECT"
            # after keying in a code.
            self.transmitSignal(self.enterkey)


    def transmitButton(self, button):
        print 'sending button: %s\n' % button
        self.transmitSignal(button)


    def transmitSignal(self, code):
        sendcmd = '%s %s' % (self.command, code)
        os.system(sendcmd)

    def selectTransmitter(self, transmitter):
        sendcmd = '%s %s' % (self.trans_cmd, transmitter)
        os.system(sendcmd)

    def irSleep(self):
	os.system('sleep %s' % self.delay)
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to