Update of /cvsroot/freevo/freevo/src/audio/plugins
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1926

Modified Files:
        detach.py 
Log Message:
fix audio stop hide() bug

Index: detach.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/audio/plugins/detach.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** detach.py   15 Sep 2004 19:36:15 -0000      1.21
--- detach.py   15 Sep 2004 20:46:08 -0000      1.22
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.22  2004/09/15 20:46:08  dischi
+ # fix audio stop hide() bug
+ #
  # Revision 1.21  2004/09/15 19:36:15  dischi
  # new detach plugin from Viggo
***************
*** 66,69 ****
--- 69,74 ----
  from event              import *
  
+ DETACH_AUDIO_STOP = Event('DETACH_AUDIO_STOP')
+ 
  class PluginInterface(IdleBarPlugin):
      """
***************
*** 79,86 ****
  
          # XXX add support for theme changes?
!         #eventhandler.register(self, THEME_CHANGE)
!         eventhandler.register(self, PLAY_END)
          eventhandler.register(self, PLAY_START)
! 
          self.visible    = False
          self.detached   = False
--- 84,94 ----
  
          # XXX add support for theme changes?
!         # eventhandler.register(self, THEME_CHANGE)
!         # XXX that doesn't work, PLAY_END doesn't send the stopped item
!         # XXX as argument
!         # eventhandler.register(self, PLAY_END)
          eventhandler.register(self, PLAY_START)
!         eventhandler.register(self, DETACH_AUDIO_STOP)
!         
          self.visible    = False
          self.detached   = False
***************
*** 236,255 ****
  
          if event == STOP and self.detached:
!             self.hide()
              return audioplayer().eventhandler(STOP)
  
!         if not event.arg:
!             return False
! 
!         if event == PLAY_END and event.arg == self.item:
              self.hide()
          elif event == PLAY_START and isinstance(event.arg, AudioItem) and 
self.detached:
              self.hide()
              self.show()
! 
          return False
  
  
- 
      def format_info(self):
          """
--- 244,271 ----
  
          if event == STOP and self.detached:
!             # this event STOP has nothing to do with the normal stop because
!             # this eventhandler is only called for the registered events
!             # PLAY_START and PLAY_END
              return audioplayer().eventhandler(STOP)
  
!         if event == DETACH_AUDIO_STOP:
!             # The audio stopped, we got an event from the animation. So we
!             # need to hide now, update the idlebar and than update the screen
!             # to show an idlebar without us.
              self.hide()
+             plugin.getbyname('idlebar').update()
+             gui.get_display().update()
+             return True
+         
          elif event == PLAY_START and isinstance(event.arg, AudioItem) and 
self.detached:
+             # An audio item has started playing and we are in detached mode. This is 
our
+             # item and we should show ourself
              self.hide()
              self.show()
!             return True
!         
          return False
  
  
      def format_info(self):
          """
***************
*** 314,317 ****
--- 330,336 ----
          update the animation
          """
+         if not audioplayer().running:
+             eventhandler.post(DETACH_AUDIO_STOP)
+             
          self.frame += 1
  



-------------------------------------------------------
This SF.Net email is sponsored by: thawte's Crypto Challenge Vl
Crack the code and win a Sony DCRHC40 MiniDV Digital Handycam
Camcorder. More prizes in the weekly Lunch Hour Challenge.
Sign up NOW http://ad.doubleclick.net/clk;10740251;10262165;m
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to