Author: dmeyer
Date: Sun Oct 16 16:00:49 2005
New Revision: 7724

Modified:
   trunk/freevo-tvdev/bin/freevo-tvdev

Log:
add not yet working scanning option

Modified: trunk/freevo-tvdev/bin/freevo-tvdev
==============================================================================
--- trunk/freevo-tvdev/bin/freevo-tvdev (original)
+++ trunk/freevo-tvdev/bin/freevo-tvdev Sun Oct 16 16:00:49 2005
@@ -45,6 +45,7 @@
     print '"%s list" to list all devices' % bin
     print '"%s configure device help" to get help on configuration' % bin
     print '"%s configure device key=value [key=value ...]" to configure card' 
% bin
+    print '"%s scan device" scan for channels (analog tv only)' % bin
     print
     print 'options:'
     print '-c config file [ default = %s ]' % cfgfile
@@ -118,5 +119,31 @@
         tvcards.TV_CARDS[device].set(key, value)
     tvcards.save()
 
+elif args[0] == 'scan':
+    from kaa.record.v4l_tuner import V4L as Tuner
+    from kaa.record.v4l_scan import scan
+    from kaa.record.v4l_frequencies import CHANLIST
+    from kaa.record._vbi import VBI
+    
+    if len(args) < 2:
+        usage()
+
+    tvcards.detect(cfgfile)
+
+    device = args[1]
+    if not device in tvcards.TV_CARDS:
+        print 'Invalid device %s' % device
+        sys.exit(1)
+    device = tvcards.TV_CARDS[device]
+    tuner = Tuner(device.vdev, device.norm, device.chanlist)
+    # FIXME: make this an option
+    tuner.setinput(0)
+
+    vbi = VBI(device.vdev.replace('/video', '/vbi'))
+    channels = kaa.record.v4l_scan.scan(tuner, vbi, CHANLIST[device.chanlist])
+    # Now we need to write the channels to a channels.conf we
+    # can read again later. This is still missing
+    print 'FIXME: we can save the config right now, sorry'
+    
 else:
     usage()


-------------------------------------------------------
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