Author: duncan
Date: Thu Feb 21 15:52:43 2008
New Revision: 10412

Log:
Consolidating differencies between rel-1 and rel-1-7

Added:
   branches/rel-1-7/freevo/src/www/htdocs/favicon.ico   (contents, props 
changed)
   branches/rel-1-7/freevo/src/www/htdocs/images/freevoheader2.png   (contents, 
props changed)
   branches/rel-1-7/freevo/src/www/htdocs/styles/slimbox_ex.css
Modified:
   branches/rel-1-7/freevo/src/config.py
   branches/rel-1-7/freevo/src/directory.py
   branches/rel-1-7/freevo/src/image/__init__.py
   branches/rel-1-7/freevo/src/image/viewer.py
   branches/rel-1-7/freevo/src/main.py
   branches/rel-1-7/freevo/src/menu.py
   branches/rel-1-7/freevo/src/plugin.py
   branches/rel-1-7/freevo/src/rc.py
   branches/rel-1/freevo/src/main.py
   branches/rel-1/freevo/src/osd.py

Modified: branches/rel-1-7/freevo/src/config.py
==============================================================================
--- branches/rel-1-7/freevo/src/config.py       (original)
+++ branches/rel-1-7/freevo/src/config.py       Thu Feb 21 15:52:43 2008
@@ -149,24 +149,38 @@
 
 class VideoGroup:
     """
-    vdev:           The video recording device, such as /dev/video0.
-    vvbi:           The video vbi device, such as /dev/vbi0.
-    adev:           The audio device, such as: None, /dev/dsp.
-    input_type:     tuner, webcam
-    input_num:      The number of this input according to V4L
-    tuner_type:     internal (on a v4l device), or external (cable or sat box)
-    tuner_norm:     NTSC, PAL, SECAM
-    tuner_chanlist: us-cable,
-    tuner_chan:     If using input_type=tuner and tuner_type=external set this 
to
-                    what channel it needs to be to get the signal, usually 3 
or 4.
-    irsend_trans:   IR transmitter to use for multiple external tuners.
-    record_group:   VideoGroup that records for this tuner, default is to use 
the
-                    same device for record and play
-    desc:           A nice description for this VideoGroup.
-    group_type:     Special variable to identify devices like dvb or ivtv.  
This
-                    can be one of: 'normal', 'ivtv', 'dvb', 'tvalsa' or 
'webcam'.
-    cmd:            Command for execute external prog after the channel 
switched,
-                    such as 'sudo /usr/local/bin/setuptuner'
+    @ivar vdev:
+        The video recording device, such as /dev/video0.
+    @ivar vvbi:
+        The video vbi device, such as /dev/vbi0.
+    @ivar adev:
+        The audio device, such as: None, /dev/dsp.
+    @ivar input_type:
+        tuner, webcam
+    @ivar input_num:
+        The number of this input according to V4L
+    @ivar tuner_type:
+        internal (on a v4l device), or external (cable or sat box)
+    @ivar tuner_norm:
+        NTSC, PAL, SECAM
+    @ivar tuner_chanlist:
+        us-cable,
+    @ivar tuner_chan:
+        If using input_type=tuner and tuner_type=external set this to
+        what channel it needs to be to get the signal, usually 3 or 4.
+    @ivar irsend_trans:
+        IR transmitter to use for multiple external tuners.
+    @ivar record_group:
+        VideoGroup that records for this tuner, default is to use the
+        same device for record and play
+    @ivar desc:
+        A nice description for this VideoGroup.
+    @ivar group_type:
+        Special variable to identify devices like dvb or ivtv.  This
+        can be one of: 'normal', 'ivtv', 'dvb', 'tvalsa' or 'webcam'.
+    @ivar cmd:
+        Command for execute external prog after the channel switched,
+        such as 'sudo /usr/local/bin/setuptuner'
     """
 
     def __init__(self, vdev=None, vvbi='/dev/vbi', adev=None, input_type=None,
@@ -210,6 +224,40 @@
         return s
 
 
+    def checkvdev(self, vdev):
+        """
+        Check if the video device is correctly configured
+        """
+        from tv.v4l2 import Videodev
+        try:
+            dev = Videodev(vdev)
+            try:
+                if input_type != 'webcam':
+                    try:
+                        if input_type:
+                            input_num = dev.getinputbyname(input_type)[0]
+                    except KeyError, e:
+                        print 'cannot find tuner %r for %r\npossible values 
are: %r' % \
+                            (input_type, vdev, dev.inputs.keys())
+                        sys.exit(1)
+                    try:
+                        if tuner_norm:
+                            tuner_std = dev.getstdbyname(tuner_norm)
+                    except KeyError, e:
+                        print 'cannot find norm %r for %r\npossible values 
are: %r' % \
+                            (tuner_norm, vdev, dev.standards.keys())
+                        sys.exit(1)
+                    print '%r:%r=%r' % (vdev, input_type, input_num)
+                    print '%r:%r=%r' % (vdev, tuner_norm, tuner_std)
+                else:
+                    print '%r:%r=%r' % (vdev, input_type, dev.inputs.keys())
+                    print '%r:%r=%r' % (vdev, tuner_norm, dev.standards.keys())
+            finally:
+                dev.close()
+        except OSError, e:
+            print 'Video device %r: %s' % (vdev, e)
+
+
 def print_config_changes(conf_version, file_version, changelist):
     """
     print changes made between version on the screen
@@ -480,9 +528,9 @@
 RUNAPP = os.environ['RUNAPP']
 _debug_('RUNAPP: %s' % (RUNAPP))
 
-_debug_('logdir: %s %s' % (OS_LOGDIR, FREEVO_LOGDIR), DINFO)
-_debug_('staticdir: %s %s' % (OS_STATICDIR, FREEVO_STATICDIR), DINFO)
-_debug_('cachedir: %s %s' % (OS_CACHEDIR, FREEVO_CACHEDIR), DINFO)
+_debug_('LOGDIR: %s %s' % (OS_LOGDIR, FREEVO_LOGDIR), DINFO)
+_debug_('STATICDIR: %s %s' % (OS_STATICDIR, FREEVO_STATICDIR), DINFO)
+_debug_('CACHEDIR: %s %s' % (OS_CACHEDIR, FREEVO_CACHEDIR), DINFO)
 
 #
 # Check that freevo_config.py is not found in the config file dirs

Modified: branches/rel-1-7/freevo/src/directory.py
==============================================================================
--- branches/rel-1-7/freevo/src/directory.py    (original)
+++ branches/rel-1-7/freevo/src/directory.py    Thu Feb 21 15:52:43 2008
@@ -231,19 +231,19 @@
 
 
     def read_folder_fxd(self, fxd, node):
-        '''
-        parse the xml file for directory settings
+        """
+        parse the xml file for directory settings::
 
-        <?xml version="1.0" ?>
-        <freevo>
-          <folder title="Incoming TV Shows" cover-img="foo.jpg">
-            <setvar name="directory_autoplay_single_item" val="0"/>
-            <info>
-              <content>Episodes for current tv shows not seen yet</content>
-            </info>
-          </folder>
-        </freevo>
-        '''
+            <?xml version="1.0" ?>
+            <freevo>
+                <folder title="Incoming TV Shows" cover-img="foo.jpg">
+                    <setvar name="directory_autoplay_single_item" val="0"/>
+                    <info>
+                        <content>Episodes for current tv shows not seen 
yet</content>
+                    </info>
+                </folder>
+            </freevo>
+        """
         if node.name == 'skin':
             self.skin_fxd = self.folder_fxd
             return
@@ -562,6 +562,7 @@
         """
         build the items for the directory
         """
+        self.menuw      = menuw
         self.playlist   = []
         self.play_items = []
         self.dir_items  = []
@@ -758,11 +759,12 @@
                         self.menu.selected = items[pos]
                     else:
                         self.menu.selected = None
-            if self.menu.selected and selected_pos != -1:
-                self.menuw.rebuild_page()
-            else:
-                self.menuw.init_page()
-            self.menuw.refresh()
+            if self.menuw:
+                if self.menu.selected and selected_pos != -1:
+                    self.menuw.rebuild_page()
+                else:
+                    self.menuw.init_page()
+                self.menuw.refresh()
 
 
         elif len(items) == 1 and items[0].actions() and \

Modified: branches/rel-1-7/freevo/src/image/__init__.py
==============================================================================
--- branches/rel-1-7/freevo/src/image/__init__.py       (original)
+++ branches/rel-1-7/freevo/src/image/__init__.py       Thu Feb 21 15:52:43 2008
@@ -101,25 +101,25 @@
 
     def fxdhandler(self, fxd, node):
         """
-        parse image specific stuff from fxd files
+        parse image specific stuff from fxd files::
 
-        <?xml version="1.0" ?>
-        <freevo>
-          <slideshow title="foo" random="1|0" repeat="1|0">
-            <cover-img>foo.jpg</cover-img>
-            <background-music random="1|0">
-              <directory recursive="1|0">path</directory>
-              <file>filename</file>
-            </background-music>
-            <files>
-              <directory recursive="1|0" duration="10">path</directory>
-              <file duration="0">filename</file>
-            </files>
-            <info>
-              <description>A nice description</description>
-            </info>
-          </slideshow>
-        </freevo>
+            <?xml version="1.0" ?>
+            <freevo>
+                <slideshow title="foo" random="1|0" repeat="1|0">
+                    <cover-img>foo.jpg</cover-img>
+                    <background-music random="1|0">
+                        <directory recursive="1|0">path</directory>
+                        <file>filename</file>
+                    </background-music>
+                    <files>
+                        <directory recursive="1|0" 
duration="10">path</directory>
+                        <file duration="0">filename</file>
+                    </files>
+                    <info>
+                        <description>A nice description</description>
+                    </info>
+                </slideshow>
+            </freevo>
         """
         items    = []
         dirname  = os.path.dirname(fxd.getattr(None, 'filename', ''))

Modified: branches/rel-1-7/freevo/src/image/viewer.py
==============================================================================
--- branches/rel-1-7/freevo/src/image/viewer.py (original)
+++ branches/rel-1-7/freevo/src/image/viewer.py Thu Feb 21 15:52:43 2008
@@ -42,6 +42,7 @@
 
 import time
 from animation import render, Transition
+import pygame
 
 # Module variable that contains an initialized ImageViewer() object
 _singleton = None
@@ -73,6 +74,7 @@
         self.slideshow   = True
         self.app_mode    = 'image'
         self.last_image  = (None, None)
+        self.render      = render.get_singleton()
         self.osd         = osd.get_singleton()
         self.osd_height  = self.osd.height
         self.osd_width   = self.osd.width * float(config.IMAGEVIEWER_ASPECT)
@@ -272,15 +274,16 @@
             self.drawosd(layer=screen)
 
             blend = Transition(self.osd.screen, screen, 
config.IMAGEVIEWER_BLEND_MODE)
+            clock = pygame.time.Clock()
             blend.start()
             while not blend.finished:
-                rc.poll()
+                self.render.update()
+                #blend.poll(pygame.time.get_ticks())
             blend.remove()
 
         else:
             self.osd.clearscreen(color=self.osd.COL_BLACK)
-            self.osd.drawsurface(image, x, y, scale, bbx, bby, bbw, bbh,
-                                 rotation=self.rotation)
+            self.osd.drawsurface(image, x, y, scale, bbx, bby, bbw, bbh, 
rotation=self.rotation)
 
             # update the OSD
             self.drawosd()

Modified: branches/rel-1-7/freevo/src/main.py
==============================================================================
--- branches/rel-1-7/freevo/src/main.py (original)
+++ branches/rel-1-7/freevo/src/main.py Thu Feb 21 15:52:43 2008
@@ -369,18 +369,18 @@
 
     # force fullscreen mode
     # deactivate screen blanking and set osd to fullscreen
-    if sys.argv[1] == '-force-fs':
+    if sys.argv[1] == '--force-fs':
         os.system('xset -dpms s off')
         config.START_FULLSCREEN_X = 1
 
     # activate a trace function
-    if sys.argv[1] == '-trace':
+    if sys.argv[1] == '--trace':
         tracefd = open(os.path.join(config.FREEVO_LOGDIR, 'trace.txt'), 'w')
         sys.settrace(tracefunc)
         config.DEBUG = 2
 
     # create api doc for Freevo and move it to Docs/api
-    if sys.argv[1] == '-doc':
+    if sys.argv[1] == '--doc':
         import pydoc
         import re
         for file in util.match_files_recursively('src/', ['py' ]):

Modified: branches/rel-1-7/freevo/src/menu.py
==============================================================================
--- branches/rel-1-7/freevo/src/menu.py (original)
+++ branches/rel-1-7/freevo/src/menu.py Thu Feb 21 15:52:43 2008
@@ -47,7 +47,7 @@
     """
     Default item for the menu. It includes one action
     """
-    def __init__( self, name, action=None, arg=None, type=None, image=None,
+    def __init__(self, name, action=None, arg=None, type=None, image=None,
                   icon=None, parent=None, skin_type=None):
         Item.__init__(self, parent, skin_type = skin_type)
         if name:
@@ -81,7 +81,7 @@
         """
         return the default action
         """
-        return [ ( self.select, self.name, 'MENU_SUBMENU' ) ]
+        return [ (self.select, self.name, 'MENU_SUBMENU') ]
 
 
     def select(self, arg=None, menuw=None):
@@ -270,17 +270,16 @@
 
     def goto_media_menu(self, media='audio'):
         """
-        Go to a main menu item
-        media = 'tv' or 'audio' or 'video' or 'image' or 'games'
+        Go to a main menu item media = 'tv' or 'audio' or 'video' or 'image' 
or 'games'
         used for events:
-            MENU_GOTO_TVMENU
-            MENU_GOTO_TVGUIDEMENU #doesn't yet work
-            MENU_GOTO_VIDEOMENU
-            MENU_GOTO_AUDIOMENU
-            MENU_GOTO_IMAGEMENU
-            MENU_GOTO_GAMESMENU
-            MENU_GOTO_RADIOMENU
-            MENU_GOTO_SHUTDOWN
+            - MENU_GOTO_TVMENU
+            - MENU_GOTO_TVGUIDEMENU #doesn't yet work
+            - MENU_GOTO_VIDEOMENU
+            - MENU_GOTO_AUDIOMENU
+            - MENU_GOTO_IMAGEMENU
+            - MENU_GOTO_GAMESMENU
+            - MENU_GOTO_RADIOMENU
+            - MENU_GOTO_SHUTDOWN
         """
         self.menustack = [self.menustack[0]]
         menu = self.menustack[0]
@@ -511,7 +510,7 @@
             return
 
         if not self.menu_items:
-            if event in ( MENU_SELECT, MENU_SUBMENU, MENU_PLAY_ITEM):
+            if event in (MENU_SELECT, MENU_SUBMENU, MENU_PLAY_ITEM):
                 self.back_one_menu()
                 return
             menu = self.menustack[-2]
@@ -728,7 +727,7 @@
                 print 'No action.. '
                 AlertBox(text=_('No action defined for this choice!')).show()
             else:
-                action( arg=arg, menuw=self )
+                action(arg=arg, menuw=self)
             return
 
 
@@ -771,11 +770,9 @@
                         arg    = action.arg
                     else:
                         action = action[0]
-                    action( arg=arg, menuw=self )
+                    action(arg=arg, menuw=self)
             return
 
-
-
         elif event == MENU_CALL_ITEM_ACTION:
             _debug_('calling action %s' % event.arg)
 

Modified: branches/rel-1-7/freevo/src/plugin.py
==============================================================================
--- branches/rel-1-7/freevo/src/plugin.py       (original)
+++ branches/rel-1-7/freevo/src/plugin.py       Thu Feb 21 15:52:43 2008
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 # -----------------------------------------------------------------------
-# plugin.py - Plugin interface
+# Plug-in interface
 # -----------------------------------------------------------------------
 # $Id$
 #
@@ -129,17 +129,20 @@
     background while Freevo is running
 
     A DaemonPlugin can have the following functions:
+
     def poll(self):
-        this function will be called every poll_intervall*0.1 seconds
-    def draw(self(type, object), osd):
-        this function will be called to update the screen
+    this function will be called every poll_intervall*0.1 seconds
+
+    def draw(self, type, object), x, osd):
+    this function will be called to update the screen
+
     def eventhandler(self, event, menuw=None):
-        events no one else wants will be passed to this functions, when
-        you also set the variable event_listener to True, the object will
-        get all events
+    events no one else wants will be passed to this functions, when you also 
set
+    the variable event_listener to True, the object will get all events
+
     def shutdown(self):
-        this function may be called to shutdown the plugin and will
-        be called on freevo shutdown
+    this function may be called to shutdown the plugin and will be called on 
freevo
+    shutdown
     """
     def __init__(self):
         Plugin.__init__(self)
@@ -417,7 +420,7 @@
 def register_callback(name, *args):
     """
     register a callback to the callback handler 'name'.
-    The format of args depends on the callback
+    @note: The format of args depends on the callback
     """
     global __callbacks__
     if not __callbacks__.has_key(name):

Modified: branches/rel-1-7/freevo/src/rc.py
==============================================================================
--- branches/rel-1-7/freevo/src/rc.py   (original)
+++ branches/rel-1-7/freevo/src/rc.py   Thu Feb 21 15:52:43 2008
@@ -300,12 +300,11 @@
         """
         init the network event handler
         """
+        _debug_('TcpNetwork.__init__()', 1)
         self.port = config.REMOTE_CONTROL_TCP_PORT
         self.host = config.REMOTE_CONTROL_TCP_HOST
-        self.sock = self.socket.socket(self.socket.AF_INET, \
-                self.socket.SOCK_STREAM)
-        self.sock.setsockopt(self.socket.SOL_SOCKET, \
-                self.socket.SO_REUSEADDR, 1)
+        self.sock = self.socket.socket(self.socket.AF_INET, 
self.socket.SOCK_STREAM)
+        self.sock.setsockopt(self.socket.SOL_SOCKET, self.socket.SO_REUSEADDR, 
1)
         self.sock.setblocking(0)
         self.sock.bind((self.host, self.port))
         self.sock.listen(1)
@@ -357,6 +356,7 @@
         """
         init the network event handler
         """
+        _debug_('Network.__init__()', 1)
         import socket
         self.port = config.REMOTE_CONTROL_PORT
         self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

Added: branches/rel-1-7/freevo/src/www/htdocs/favicon.ico
==============================================================================
Binary file. No diff available.

Added: branches/rel-1-7/freevo/src/www/htdocs/images/freevoheader2.png
==============================================================================
Binary file. No diff available.

Added: branches/rel-1-7/freevo/src/www/htdocs/styles/slimbox_ex.css
==============================================================================
--- (empty file)
+++ branches/rel-1-7/freevo/src/www/htdocs/styles/slimbox_ex.css        Thu Feb 
21 15:52:43 2008
@@ -0,0 +1,81 @@
[EMAIL PROTECTED] "utf-8";
+
+/* SLIMBOX (Customized version) */
+
+#lbOverlay {
+       position: absolute;
+       top:0; left: 0;
+       width: 100%;
+       background-color: #000;
+       cursor: pointer;
+}
+
+#lbCenter, #lbBottomContainer {
+       position: absolute;
+       left: 50%; padding:0;
+       overflow: hidden;
+       background-color: #fff;
+}
+
+.lbLoading {
+       background: #fff url(../images/sb_loading.gif) no-repeat center;
+}
+
+#lbCanvas {
+       border: 9px solid #fff;
+}
+
+#lbCanvas iframe, #lbCanvas img {
+       border:1px solid #999;
+       margin:0; padding:0;
+}
+
+#lbPrevLink, #lbNextLink {
+       display: block;
+       position: absolute;
+       top: 10px;
+       width: 70px;
+       background:url(../images/sb_anchor_spacer.gif);
+}
+
+
+#lbPrevLink {
+       left: 0;
+}
+
+#lbPrevLink:hover {
+       background: transparent url(../images/sb_prevlabel.gif) no-repeat;
+}
+
+#lbNextLink {
+       right: 0;
+}
+
+#lbNextLink:hover {
+       background: transparent url(../images/sb_nextlabel.gif) no-repeat;
+}
+
+#lbBottom {
+       font-size:12px;
+       font-family: Verdana, Helvetica, sans-serif;
+       color: #666;
+       line-height: 1.4em;
+       text-align: left;
+       margin:0 0 0 10px; padding:0;
+}
+
+#lbCloseLink {
+       display: block;
+       float: right;
+       width: 66px;
+       height: 22px;
+       background: transparent url(../images/sb_closelabel.gif) no-repeat 
center;
+       margin:0; padding:0;
+}
+
+#lbCaption, #lbNumber {
+}
+
+#lbCaption {
+       font-weight: bold;
+}

Modified: branches/rel-1/freevo/src/main.py
==============================================================================
--- branches/rel-1/freevo/src/main.py   (original)
+++ branches/rel-1/freevo/src/main.py   Thu Feb 21 15:52:43 2008
@@ -478,8 +478,8 @@
 except SystemExit:
     pass
 
-except:
-    _debug_('Crash!', DCRITICAL)
+except Exception, e:
+    _debug_('Crash!: %s' % (e), config.DCRITICAL)
     try:
         tb = sys.exc_info()[2]
         fname, lineno, funcname, text = traceback.extract_tb(tb)[-1]

Modified: branches/rel-1/freevo/src/osd.py
==============================================================================
--- branches/rel-1/freevo/src/osd.py    (original)
+++ branches/rel-1/freevo/src/osd.py    Thu Feb 21 15:52:43 2008
@@ -480,6 +480,8 @@
             if event.type == NOEVENT:
                 return
 
+            #print 'DJW:event=%s' % event
+
             if event.type == KEYDOWN:
                 _debug_('KEYDOWN: type=%s key=%s' % (event.type, event.key), 2)
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
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