Re: [Freevo-users] a small menu patch

2008-01-13 Thread Duncan Webb
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Alberto González Rodríguez wrote:
| 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 http://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

Will you submit a feature request for this to be included.
https://sourceforge.net/tracker/?func=addgroup_id=46652atid=446898

Thanks
Duncan
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHigasNi6l+Xvys44RAj9rAJ9UEHms4Qn3Hjm44rjux3Sqop/biwCgiu8Y
3S8p9NECM2XCebdJO1bo1jI=
=9BrS
-END PGP SIGNATURE-


-
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
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users


[Freevo-users] a small menu patch

2008-01-12 Thread Alberto González Rodríguez
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.0 +0100
+++ menu.py	2008-01-12 20:57:20.0 +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
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users