Author: duncan
Date: Fri Nov 30 17:49:33 2007
New Revision: 10168

Log:
Updated pygoom to use fast_memcpy, makes a difference
Also when the fast_memcpy method can be selected at run-time from cpu detect
Also the config.h and setup.py have been updated

The initial mode of mplayervis can now be set in the local_config.py, changed 
with button 0
The song title can also be displayed with button 8 (8=title)


Modified:
   branches/rel-1-7/freevo/contrib/runtime/pygoom-2k4.tar.bz2
   branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py
   branches/rel-1/freevo/contrib/runtime/pygoom-2k4.tar.bz2
   branches/rel-1/freevo/src/audio/plugins/mplayervis.py

Modified: branches/rel-1-7/freevo/contrib/runtime/pygoom-2k4.tar.bz2
==============================================================================
Binary files. No diff available.

Modified: branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py
==============================================================================
--- branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py     (original)
+++ branches/rel-1-7/freevo/src/audio/plugins/mplayervis.py     Fri Nov 30 
17:49:33 2007
@@ -6,7 +6,7 @@
 # $Id$
 #
 # Notes: - I'm no fan of all the skin.clear() being done :(
-# Todo:  - Migrate with Gustavos pygoom when done and change name to mpav
+# Todo:  - 
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
@@ -51,7 +51,7 @@
 osd  = osd.get_singleton()
 
 
-class mpv_Goom(BaseAnimation):
+class MpvGoom(BaseAnimation):
     message    = None
     coversurf  = None
 
@@ -73,7 +73,6 @@
         pygoom.set_resolution(width, height, 0)
 
 
-
     def set_cover(self, coverfile):
         """
         Set a blend image to toggle between visual and cover
@@ -82,6 +81,18 @@
         self.coverfile = coverfile
 
 
+    def set_title(self, title):
+        """ pass the song title to pygoom """
+        _debug_('pygoom.set_title(title=%r)' % (title), 2)
+        pygoom.set_title(title)
+
+
+    def set_info(self, info):
+        """ pass the song information to pygoom """
+        _debug_('pygoom.set_message(info=%r)' % (info), 2)
+        pygoom.set_message(info)
+
+
     def set_message(self, message, timeout=5):
         """
         Pass a message to the screen.
@@ -98,8 +109,7 @@
 
         s = Surface((w,h), 0, 32)
 
-        osd.drawstringframed(message, 0, 0, w, h, font,
-                             mode='hard', layer=s)
+        osd.drawstringframed(message, 0, 0, w, h, font, mode='hard', layer=s)
 
         self.m_timer   = time.time()
         self.m_timeout = timeout
@@ -237,17 +247,25 @@
         plugin.Plugin.__init__(self)
         self._type    = 'mplayer_audio'
         self.app_mode = 'audio'
+        self.title    = None
+        self.info     = None
 
         # Event for changing between viewmodes
         config.EVENTS['audio']['0'] = Event('CHANGE_MODE')
+        config.EVENTS['audio']['8'] = Event('TOGGLE_TITLE')
+        config.EVENTS['audio']['4'] = Event('TOGGLE_INFO')
 
         self.plugin_name = 'audio.mplayervis'
         plugin.register(self, self.plugin_name)
 
-        self.view_func = [self.dock,
-                          self.fullscreen,
-                          self.noview]
+        self.view = config.MPLAYERVIS_MODE
+        self.view_func = [self.dock, self.fullscreen, self.noview]
+
 
+    def config(self):
+        return [
+            ('MPLAYERVIS_MODE', 0, 'Set the initial mode of the display, 
0)DOCK, 1)FULL or 2)NOVI')
+        ]
 
     def play( self, command, player ):
         self.player = player
@@ -279,6 +297,21 @@
             self.toggle_view()
             return True
 
+        if event == 'TOGGLE_TITLE':
+            if self.title:
+                self.title = ''
+            else:
+                self.title = self.item.name
+            self.visual.set_title(self.title)
+            return True
+
+        if event == 'TOGGLE_INFO':
+            if self.info:
+                self.info = ''
+            else:
+                self.info = self.item_info()
+            self.visual.set_message(self.info)
+
         if self.visual and self.view == FULL:
 
             if event == OSD_MESSAGE:
@@ -387,7 +420,7 @@
 
         if rc.app() == self.player.eventhandler:
 
-            self.visual = mpv_Goom(300, 300, 150, 150, self.item.image)
+            self.visual = MpvGoom(300, 300, 150, 150, self.item.image)
 
             if self.view == FULL:
                 self.visual.set_message(self.item.name, 10)

Modified: branches/rel-1/freevo/contrib/runtime/pygoom-2k4.tar.bz2
==============================================================================
Binary files. No diff available.

Modified: branches/rel-1/freevo/src/audio/plugins/mplayervis.py
==============================================================================
--- branches/rel-1/freevo/src/audio/plugins/mplayervis.py       (original)
+++ branches/rel-1/freevo/src/audio/plugins/mplayervis.py       Fri Nov 30 
17:49:33 2007
@@ -6,7 +6,7 @@
 # $Id$
 #
 # Notes: - I'm no fan of all the skin.clear() being done :(
-# Todo:  - Migrate with Gustavos pygoom when done and change name to mpav
+# Todo:  - 
 #
 # -----------------------------------------------------------------------
 # Freevo - A Home Theater PC framework
@@ -51,7 +51,7 @@
 osd  = osd.get_singleton()
 
 
-class mpv_Goom(BaseAnimation):
+class MpvGoom(BaseAnimation):
     message    = None
     coversurf  = None
 
@@ -73,7 +73,6 @@
         pygoom.set_resolution(width, height, 0)
 
 
-
     def set_cover(self, coverfile):
         """
         Set a blend image to toggle between visual and cover
@@ -82,6 +81,18 @@
         self.coverfile = coverfile
 
 
+    def set_title(self, title):
+        """ pass the song title to pygoom """
+        _debug_('pygoom.set_title(title=%r)' % (title), 2)
+        pygoom.set_title(title)
+
+
+    def set_info(self, info):
+        """ pass the song information to pygoom """
+        _debug_('pygoom.set_message(info=%r)' % (info), 2)
+        pygoom.set_message(info)
+
+
     def set_message(self, message, timeout=5):
         """
         Pass a message to the screen.
@@ -98,8 +109,7 @@
 
         s = Surface((w,h), 0, 32)
 
-        osd.drawstringframed(message, 0, 0, w, h, font,
-                             mode='hard', layer=s)
+        osd.drawstringframed(message, 0, 0, w, h, font, mode='hard', layer=s)
 
         self.m_timer   = time.time()
         self.m_timeout = timeout
@@ -237,17 +247,25 @@
         plugin.Plugin.__init__(self)
         self._type    = 'mplayer_audio'
         self.app_mode = 'audio'
+        self.title    = None
+        self.info     = None
 
         # Event for changing between viewmodes
         config.EVENTS['audio']['0'] = Event('CHANGE_MODE')
+        config.EVENTS['audio']['8'] = Event('TOGGLE_TITLE')
+        config.EVENTS['audio']['4'] = Event('TOGGLE_INFO')
 
         self.plugin_name = 'audio.mplayervis'
         plugin.register(self, self.plugin_name)
 
-        self.view_func = [self.dock,
-                          self.fullscreen,
-                          self.noview]
+        self.view = config.MPLAYERVIS_MODE
+        self.view_func = [self.dock, self.fullscreen, self.noview]
+
 
+    def config(self):
+        return [
+            ('MPLAYERVIS_MODE', 0, 'Set the initial mode of the display, 
0)DOCK, 1)FULL or 2)NOVI')
+        ]
 
     def play( self, command, player ):
         self.player = player
@@ -279,6 +297,21 @@
             self.toggle_view()
             return True
 
+        if event == 'TOGGLE_TITLE':
+            if self.title:
+                self.title = ''
+            else:
+                self.title = self.item.name
+            self.visual.set_title(self.title)
+            return True
+
+        if event == 'TOGGLE_INFO':
+            if self.info:
+                self.info = ''
+            else:
+                self.info = self.item_info()
+            self.visual.set_message(self.info)
+
         if self.visual and self.view == FULL:
 
             if event == OSD_MESSAGE:
@@ -387,7 +420,7 @@
 
         if rc.app() == self.player.eventhandler:
 
-            self.visual = mpv_Goom(300, 300, 150, 150, self.item.image)
+            self.visual = MpvGoom(300, 300, 150, 150, self.item.image)
 
             if self.view == FULL:
                 self.visual.set_message(self.item.name, 10)

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Freevo-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to