Author: dmeyer
Date: Sat Oct 15 19:06:53 2005
New Revision: 7706

Modified:
   trunk/freevo-tvdev/bin/freevo-tvdev
   trunk/freevo-tvdev/src/control.py
   trunk/freevo-tvdev/src/devices.py
   trunk/freevo-tvdev/src/tvcards.py

Log:
make it work

Modified: trunk/freevo-tvdev/bin/freevo-tvdev
==============================================================================
--- trunk/freevo-tvdev/bin/freevo-tvdev (original)
+++ trunk/freevo-tvdev/bin/freevo-tvdev Sat Oct 15 19:06:53 2005
@@ -17,7 +17,8 @@
 
 # freevo imports
 from freevo.tvdev import tvcards
-from freevo.tvdev.control import Recorder
+from freevo.tvdev import devices
+from freevo.tvdev.control import Controller
 
 # get logging object
 log = logging.getLogger()
@@ -65,8 +66,10 @@
         cfgfile = a
 
 if len(args) == 0:
-    # create recorder
-    r = Recorder()
+    devices.detect(cfgfile)
+
+    # create controller
+    c = Controller()
     
     # start main loop
     kaa.main()
@@ -77,6 +80,7 @@
 
 if args[0] == 'list':
     tvcards.detect(cfgfile)
+
     for key, card in tvcards.TV_CARDS.items():
         print '*** %s ***' % key
         print card.info()
@@ -85,7 +89,9 @@
 elif args[0] == 'configure':
     if len(args) < 2:
         usage()
+
     tvcards.detect(cfgfile)
+
     device = args[1]
     if not device in tvcards.TV_CARDS:
         print 'Invalid device %s' % device

Modified: trunk/freevo-tvdev/src/control.py
==============================================================================
--- trunk/freevo-tvdev/src/control.py   (original)
+++ trunk/freevo-tvdev/src/control.py   Sat Oct 15 19:06:53 2005
@@ -88,7 +88,7 @@
 log = logging.getLogger()
 
 
-class Recorder(RPCServer):
+class Controller(RPCServer):
     """
     Recorder handling the different devices.
     """

Modified: trunk/freevo-tvdev/src/devices.py
==============================================================================
--- trunk/freevo-tvdev/src/devices.py   (original)
+++ trunk/freevo-tvdev/src/devices.py   Sat Oct 15 19:06:53 2005
@@ -1,6 +1,11 @@
+import logging
+
 import kaa.record
 import tvcards
 
+# get logging object
+log = logging.getLogger()
+
 class Device(object):
     """
     Base class for all devices. All devices need to inherit from this class
@@ -8,6 +13,7 @@
     for the actual recording.
     """
     def __init__(self, id, card):
+        log.info('add device %s' % id)
         self.name = id
         self.priority = card.priority
         self.bouquets = []
@@ -70,11 +76,24 @@
         chain.append(output)
         return kaa.record.IVTVDevice.start_recording(self, channel, chain)
 
-
 DEVICES = []
-for id, card in tvcards.TV_CARDS.items():
-    if id.startswith('dvb'):
-        DEVICES.append(DvbDevice(id, card))
 
-    elif id.startswith('ivtv'):
-        DEVICES.append(IVTVDevice(id, card))
+def detect(cfgfile):
+
+    if DEVICES:
+        return
+
+    tvcards.detect(cfgfile)
+    
+    for id, card in tvcards.TV_CARDS.items():
+        if not card.active:
+            if not card.configured:
+                log.info('skipping %s, not configured' % id)
+            else:
+                log.info('skipping %s' % id)
+            continue
+        if id.startswith('dvb'):
+            DEVICES.append(DvbDevice(id, card))
+
+        elif id.startswith('ivtv'):
+            DEVICES.append(IVTVDevice(id, card))

Modified: trunk/freevo-tvdev/src/tvcards.py
==============================================================================
--- trunk/freevo-tvdev/src/tvcards.py   (original)
+++ trunk/freevo-tvdev/src/tvcards.py   Sat Oct 15 19:06:53 2005
@@ -221,7 +221,7 @@
 
 def detect(cfgfile):
     global config
-    
+
     log.info('Detecting TV cards.')
     if not os.path.isfile(cfgfile):
         open(cfgfile, 'w').close()


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to