Hello:

     i wanted to play a sound when i entering in any menu, and i did a patch
and now i include in this list for if somebody need it, i use
OSD_SOUNDS_ENABLED feature included in freevo.

     example:

       before we only could do it:
                 OSD_SOUNDS= {
                      'menu.navigate': None,
                      'menu.back_one': None,
                      'menu.select'  : None
                 }

       with my path:

OSD_SOUNDS = {
        'menu.tv': '/home/owen/Musica/menu_tv.wav',
        'menu.video': '/home/owen/Musica/menu_video.wav',
        'menu.audio': '/home/owen/Musica/menu_audio.wav',
        'menu.image': '/home/owen/Musica/menu_image.wav',
        'menu.WeatherMainMenu': '/home/owen/Musica/menu_weather.wav',
        'menu.HeadlinesMainMenuItem':
'/home/owen/Musica/menu_headlines.wav',
        'menu.ShutdownItem': '/home/owen/Musica/menu_shutdown.wav'
}

and similar things, in tv, video, audio, image, radio no problem, with
plugins you should see the class declaration for know what name to use in
config
--- /root/freevo-1.x/freevo/src/menu.py	2008-01-08 10:03:15.000000000 +0100
+++ menu.py	2008-01-12 20:57:20.000000000 +0100
@@ -317,7 +317,14 @@
                         pass
                 try:
                     if menuitem.arg[0] == mediaitem:
-                        menuitem.select(menuw=self)
+                        if config.OSD_SOUNDS:
+			   try:
+			       key = "menu." + media
+  		               if config.OSD_SOUNDS[key]:
+			          sounds.play_sound(sounds.load_sound(key))
+			   except:
+			       pass
+			menuitem.select(menuw=self)
                         break
                 except AttributeError: # may have no .arg (no media menu)
                     pass
@@ -678,6 +685,23 @@
                 # because we'll break some (or all) plugins behavior.
                 # Does that sound correct?
                 #
+		if config.OSD_SOUNDS:
+                   if hasattr(menu.selected, 'arg'):
+			try:
+			  key = "menu." + menu.selected.arg[0]
+  		          if config.OSD_SOUNDS[key]:
+			     sounds.play_sound(sounds.load_sound(key))
+			except:
+			  pass
+		   else:
+		       try:
+		         key = "menu." + menu.selected.__class__.__name__
+                         if config.OSD_SOUNDS[key]:
+                            sounds.play_sound(sounds.load_sound(key))
+		       except:
+                         pass
+
+            
                 if not hasattr(menu, 'is_submenu'):
                     plugins = plugin.get('item') + plugin.get('item_%s' % menu.selected.type)
 
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to