Author: duncan
Date: Wed Apr 25 19:26:08 2007
New Revision: 9506

Modified:
   branches/rel-1/freevo/src/audio/plugins/radio.py
   branches/rel-1/freevo/src/audio/plugins/radioplayer.py

Log:
[ 1707295 ] radioplayer interupt ivtv record
Fix applied


Modified: branches/rel-1/freevo/src/audio/plugins/radio.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/radio.py    (original)
+++ branches/rel-1/freevo/src/audio/plugins/radio.py    Wed Apr 25 19:26:08 2007
@@ -4,7 +4,7 @@
 # -----------------------------------------------------------------------
 # $Id$
 #
-# Notes: 
+# Notes:
 # need to have radio installed before using this plugin
 # to activate put the following in your local_conf.py
 # plugin.activate('audio.radioplayer')
@@ -14,11 +14,11 @@
 #                    ('Kiss 108', '108'),
 #                    ('Mix 98.5', '98.5'),
 #                    ('Magic 106', '106.7') ]
-# Todo: 
+# Todo:
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
-# Copyright (C) 2003 Krister Lagerstrom, et al. 
+# 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
@@ -40,12 +40,14 @@
 
 #python modules
 import os, popen2, fcntl, select, time
+import glob
 
 #freevo modules
 import config, menu, rc, plugin, util
 from audio.player import PlayerGUI
 from item import Item
 from menu import MenuItem
+from gui import AlertBox, ConfirmBox
 
 
 class RadioItem(Item):
@@ -62,6 +64,13 @@
         return items
 
 
+    def checktv(self):
+        self.tvlockfile = config.FREEVO_CACHEDIR + '/record.*'
+        if len(glob.glob(self.tvlockfile)) > 0:
+            return True
+        return False
+
+
     def play(self, arg=None, menuw=None):
         print self.station+" "+str(self.station_index)+" "+self.name
         # self.parent.current_item = self
@@ -70,6 +79,11 @@
         if not self.menuw:
             self.menuw = menuw
 
+        if self.checktv():
+            #AlertBox(text=_('Cannot play - recording in progress')).show()
+            AlertBox(text=_('Cannot play - recording in progress'), 
handler=self.confirm).show()
+            return 'Cannot play with RadioPlayer - recording in progress'
+
         self.player = PlayerGUI(self, menuw)
         error = self.player.play()
 
@@ -77,6 +91,14 @@
             AlertBox(text=error).show()
             rc.post_event(rc.PLAY_END)
 
+
+    def confirm (self, arg=None, menuw=None):
+        _debug_('confirm (self, arg=%r, menuw=%r)' % (arg, menuw))
+        if menuw:
+            menuw.menu_back()
+            #menuw.refresh()
+
+
     def stop(self, arg=None, menuw=None):
         """
         Stop the current playing
@@ -102,7 +124,7 @@
         """
         return [ ( self.create_stations_menu , 'stations' ) ]
 
- 
+
     def create_stations_menu(self, arg=None, menuw=None):
         station_items = []
         for rstation in config.RADIO_STATIONS:

Modified: branches/rel-1/freevo/src/audio/plugins/radioplayer.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/radioplayer.py      (original)
+++ branches/rel-1/freevo/src/audio/plugins/radioplayer.py      Wed Apr 25 
19:26:08 2007
@@ -5,11 +5,11 @@
 # $Id$
 #
 # Notes:
-# Todo:        
+# Todo:
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
-# Copyright (C) 2002 Krister Lagerstrom, et al. 
+# Copyright (C) 2002 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
@@ -38,7 +38,6 @@
 import config     # Configuration handler. reads config file.
 import util       # Various utilities
 import plugin
-
 from event import *
 
 
@@ -47,7 +46,7 @@
     This is the player plugin for the radio. Basically it tunes all the
     radio stations set in the radio plugin and does the interaction
     between the radio command line program and freevo. please see the
-    audio.radio plugin for setup information  
+    audio.radio plugin for setup information
 
     """
     def __init__(self):
@@ -107,14 +106,14 @@
             os.system('%s -f %s &' % (config.RADIO_CMD, self.item.station))
         else:
             # BTTV cards
- 
+
             os.system('%s' % (config.RADIO_CMD_START % self.item.station))
         thread.start_new_thread(self.__update_thread, ())
 
         rc.app(self)
         rc.post_event(PLAY_START)
         return None
-    
+
 
     def stop(self):
         """

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to