When a videoitem has several subitems, the current code plays only the
first one (because the menu is "visible" when playing this one, and
since "EOF + visible menu => end of playing", the next subitem is never
played). Here is a fix for that. I also modified the passing of
mplayer_options to subitems, so that the options of the subitem (set
from the XML file) are not clobbered.

Matthieu
-- 
 (~._.~)        Matthieu Weber - Université de Jyväskylä         (~._.~)
  ( ? )                email : [EMAIL PROTECTED]                  ( ? ) 
 ()- -()               public key id : 452AE0AD                  ()- -()
 (_)-(_)  "Humor ist, wenn man trotzdem lacht (Germain Muller)"  (_)-(_)
--- mplayer.py.orig     Fri Mar 21 09:18:50 2003
+++ mplayer.py  Fri Mar 21 09:25:01 2003
@@ -266,7 +266,9 @@
             if not config.NEW_SKIN:
                 skin.PopupBox('%s\nnot found!' % os.path.basename(filename))
                 time.sleep(2.0) 
-                menuw.refresh()
+                # This event allows the videoitem which contains subitems to
+                # try to play the next subitem
+                rc.post_event(rc.PLAY_END)
         
             # XXX We should really use return more.
             return 0
--- videoitem.py.orig   Fri Mar 21 09:19:47 2003
+++ videoitem.py        Fri Mar 21 09:37:01 2003
@@ -235,6 +235,15 @@
         return self.name
 
     
+    def getattr(self, attr):
+        """
+        return the specific attribute as string or an empty string
+        """
+        a = Item.getattr(self, attr)
+        if not a and self.info and self.info.has_key(attr):
+            a = str(self.info[attr])
+        return a
+
     # ------------------------------------------------------------------------
     # actions:
 
@@ -285,7 +294,20 @@
 
         if self.subitems:
             self.current_subitem = self.subitems[0]
-            self.current_subitem.mplayer_options = self.mplayer_options # Pass along 
the options
+            # Pass along the options, without loosing the subitem's own
+            # options
+            if self.current_subitem.mplayer_options:
+                if self.mplayer_options:
+                    self.current_subitem.mplayer_options += ' ' + self.mplayer_options
+            else:
+                self.current_subitem.mplayer_options = self.mplayer_options
+            # When playing a subitem, the menu must be hidden. If it is not,
+            # the playing will stop after the first subitem, since the
+            # PLAY_END/USER_END event is not forwarded to the parent
+            # videoitem.
+            # And besides, we don't need the menu between two subitems.
+            menuw.hide()
+
             self.current_subitem.play(arg, menuw)
             return
 

Reply via email to