Author: duncan
Date: Fri Oct  6 16:02:27 2006
New Revision: 8324

Modified:
   branches/rel-1-5/freevo/freevo_config.py
   branches/rel-1-5/freevo/local_conf.py.example
   branches/rel-1-5/freevo/src/plugins/upsoon.py

Log:
[ 1567895 ] Interrupt live tv
Corrected detection of video device, added RADIO_DEVICE


Modified: branches/rel-1-5/freevo/freevo_config.py
==============================================================================
--- branches/rel-1-5/freevo/freevo_config.py    (original)
+++ branches/rel-1-5/freevo/freevo_config.py    Fri Oct  6 16:02:27 2006
@@ -1363,10 +1363,12 @@
     TV_DRIVER = 'bsdbt848'
     TV_DEVICE = '/dev/bktr0'
     TV_INPUT = 1
+    RADIO_DEVICE = '/dev/radio0'
 else:
     TV_DRIVER = 'v4l'
     TV_DEVICE = '/dev/video0'
     TV_INPUT = 0
+    RADIO_DEVICE = '/dev/radio0'
 
 # Additional options to pass to mplayer in TV mode.
 # For example, TV_OPTS = '-vop pp=ci' would turn on deinterlacing.
@@ -1532,7 +1534,6 @@
                recordable=True),
 ]
 
-
 #
 # TV Channels. This list contains a mapping from the displayed channel name
 # to the actual channel name as used by the TV watching application.

Modified: branches/rel-1-5/freevo/local_conf.py.example
==============================================================================
--- branches/rel-1-5/freevo/local_conf.py.example       (original)
+++ branches/rel-1-5/freevo/local_conf.py.example       Fri Oct  6 16:02:27 2006
@@ -894,6 +894,7 @@
 # TV_DRIVER = 'v4l'
 # TV_DEVICE = '/dev/video0'
 # TV_INPUT = 0
+# RADIO_DEVICE = '/dev/radio0'
 
 #
 # Additional options to pass to mplayer in TV mode.

Modified: branches/rel-1-5/freevo/src/plugins/upsoon.py
==============================================================================
--- branches/rel-1-5/freevo/src/plugins/upsoon.py       (original)
+++ branches/rel-1-5/freevo/src/plugins/upsoon.py       Fri Oct  6 16:02:27 2006
@@ -39,8 +39,9 @@
 import rc
 import thread
 import tv.v4l2
-from event import *
+from tv.channels import FreevoChannels
 from util.marmalade import jellyToXML, unjellyFromXML
+from event import *
 
 # set the base debug level
 dbglvl=1
@@ -89,6 +90,8 @@
         self.next_program = self.findNextProgram()
         _debug_('up=%s %s' % (self.serverup, self.next_program), dbglvl)
 
+        self.fc = FreevoChannels()
+
 
     def findNextProgram(self):
         """
@@ -188,28 +191,34 @@
             return None
 
         _debug_('recording in less that a minute (%s secs)' % (secs_to_next), 
dbglvl)
+
+        vdev=self.fc.getVideoGroup(rec_prog.channel_id).vdev
         try:
             # check the video
-            viddev = tv.v4l2.Videodev('/dev/video0')
+            viddev = tv.v4l2.Videodev(vdev)
             try:
                 print os.read(viddev.getdevice(), 1)
             except OSError:
                 rc.post_event(STOP)
-                print 'device %s in use' % ('/dev/video0')
+                print 'device \"%s\" in use' % (vdev)
+                AlertBox(text=_('Sorry, a program is about to start recording. 
'), height=200).show()
             viddev.close()
         except:
-            pass
+            print 'cannot check video device \"%s\"' % (vdev)
+
+        rdev=config.RADIO_DEVICE
         try:
             # check the radio
-            viddev = tv.v4l2.Videodev('/dev/video24')
+            viddev = tv.v4l2.Videodev(rdev)
             try:
                 print os.read(viddev.getdevice(), 1)
             except OSError:
                 rc.post_event(STOP)
-                print 'device %s in use' % ('/dev/video24')
+                print 'device \"%s\" in use' % (rdev)
+                AlertBox(text=_('Sorry, a program is about to start recording. 
'), height=200).show()
             viddev.close()
         except:
-            pass
+            print 'cannot check radio device \"%s\"' % (rdev)
 
 
     def eventhandler( self, event, menuw=None ):
@@ -230,14 +239,21 @@
         return 0
 
 
-# this won't work
 if __name__ == '__main__':
+    # this won't work, without some more imports
     if len(sys.argv) >= 2: 
         function = sys.argv[1]
     else:
         function = 'none'
 
-
     if function == "isplayerrunning":
         (result, response) = isPlayerRunning()
         print response
+
+    vg=FreevoChannels().getVideoGroup(rec_prog.channel_id)
+    print "vg=%s" % vg
+    print "dir(%s)" % dir(vg)
+    for it in dir(vg):
+        print "   %s:%s" % (it, eval('vg.'+it))
+    vdev=vg.vdev
+    print "vdev=%s" % vdev

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to