Author: duncan
Date: Sat Dec 29 06:46:33 2007
New Revision: 10244

Log:
[ 1858775 ] irsend_directv plugin
New plug-in from Michael Beal added


Added:
   branches/rel-1-7/freevo/src/tv/plugins/irsend_directv.py   (contents, props 
changed)
   branches/rel-1/freevo/src/tv/plugins/irsend_directv.py   (contents, props 
changed)
Modified:
   branches/rel-1-7/freevo/ChangeLog
   branches/rel-1-7/freevo/freevo_config.py
   branches/rel-1/freevo/ChangeLog
   branches/rel-1/freevo/freevo_config.py

Modified: branches/rel-1-7/freevo/ChangeLog
==============================================================================
--- branches/rel-1-7/freevo/ChangeLog   (original)
+++ branches/rel-1-7/freevo/ChangeLog   Sat Dec 29 06:46:33 2007
@@ -16,6 +16,7 @@
 == Release 1.7.6 (2008-??-??) ==
 --------------------------------
 
+ * New DirecTV plug-in to send to DirecTV receivers (F#1858775)
  * Updated cdbackup plug-in with CD_RIP_FMT to set the encoding format 
(F#1857460)
  * Updated recordings manager plug-in to add thumbnail support (F#1857397)
  * Updated recordserver to default watched/keep status (F#1857395)

Modified: branches/rel-1-7/freevo/freevo_config.py
==============================================================================
--- branches/rel-1-7/freevo/freevo_config.py    (original)
+++ branches/rel-1-7/freevo/freevo_config.py    Sat Dec 29 06:46:33 2007
@@ -411,6 +411,11 @@
 #
 ROM_SPEED = 0
 
+#
+# Shutdown confirmation.
+# Set to 0 for no confirmation, set to 1 to show a confirm dialog
+# (OK preselected), set to 2 to show a confirm dialog (Cancel preselected)
+#
 SHUTDOWN_CONFIRM = 1                  # ask before shutdown
 
 SHUTDOWN_SYS_CMD = 'shutdown -h now'  # set this to 'sudo shutdown -h now' if

Added: branches/rel-1-7/freevo/src/tv/plugins/irsend_directv.py
==============================================================================
--- (empty file)
+++ branches/rel-1-7/freevo/src/tv/plugins/irsend_directv.py    Sat Dec 29 
06:46:33 2007
@@ -0,0 +1,103 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------
+# Send commands to a DirecTV receiver using a shell command like 
+# irsend from Lirc.
+# -----------------------------------------------------------------------
+# $Id$
+#
+# 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)

Modified: branches/rel-1/freevo/ChangeLog
==============================================================================
--- branches/rel-1/freevo/ChangeLog     (original)
+++ branches/rel-1/freevo/ChangeLog     Sat Dec 29 06:46:33 2007
@@ -19,6 +19,7 @@
 == Release 1.7.6 (2008-??-??) ==
 --------------------------------
 
+ * New DirecTV plug-in to send to DirecTV receivers (F#1858775)
  * Updated cdbackup plug-in with CD_RIP_FMT to set the encoding format 
(F#1857460)
  * Updated recordings manager plug-in to add thumbnail support (F#1857397)
  * Updated recordserver to default watched/keep status (F#1857395)

Modified: branches/rel-1/freevo/freevo_config.py
==============================================================================
--- branches/rel-1/freevo/freevo_config.py      (original)
+++ branches/rel-1/freevo/freevo_config.py      Sat Dec 29 06:46:33 2007
@@ -412,6 +412,11 @@
 #
 ROM_SPEED = 0
 
+#
+# Shutdown confirmation.
+# Set to 0 for no confirmation, set to 1 to show a confirm dialog
+# (OK preselected), set to 2 to show a confirm dialog (Cancel preselected)
+#
 SHUTDOWN_CONFIRM = 1                  # ask before shutdown
 
 SHUTDOWN_SYS_CMD = 'shutdown -h now'  # set this to 'sudo shutdown -h now' if

Added: branches/rel-1/freevo/src/tv/plugins/irsend_directv.py
==============================================================================
--- (empty file)
+++ branches/rel-1/freevo/src/tv/plugins/irsend_directv.py      Sat Dec 29 
06:46:33 2007
@@ -0,0 +1,103 @@
+# -*- coding: iso-8859-1 -*-
+# -----------------------------------------------------------------------
+# Send commands to a DirecTV receiver using a shell command like 
+# irsend from Lirc.
+# -----------------------------------------------------------------------
+# $Id$
+#
+# 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-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to