![]() |
2010-02-03
, 08:11
|
Posts: 432 |
Thanked: 645 times |
Joined on Mar 2009
|
#2
|
I can receive this signal but sending it doesn't change the volume.Code:signal sender=:1.49 -> dest=(null destination) serial=1459 path=/com/nokia/mafw/renderer/gstrenderer; interface=com.nokia.mafw.extension; member=property_changed string "volume" variant uint32 54
![]() |
2010-02-03
, 08:35
|
|
Posts: 3,404 |
Thanked: 4,474 times |
Joined on Oct 2005
@ Germany
|
#3
|
bus = dbus.SessionBus() obj = bus.get_object("com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer", "/com/nokia/mafw/renderer/gstrenderer") mafw = dbus.Interface(obj, "com.nokia.mafw.extension") volume = int(mafw.get_extension_property("volume")[1])
os.system("dbus-send --session --print-reply " \ "--dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer " \ "/com/nokia/mafw/renderer/gstrenderer " \ "com.nokia.mafw.extension.set_extension_property " \ "string:'volume' variant:uint32:%d &" \ % volume)
![]() |
2010-02-03
, 13:05
|
Posts: 31 |
Thanked: 44 times |
Joined on Nov 2009
@ Czech Republic
|
#4
|
![]() |
2010-06-08
, 18:44
|
Posts: 21 |
Thanked: 6 times |
Joined on Apr 2010
|
#5
|
In case you still want to use D-Bus (shouldn't hurt), here's how:
Retrieving the current volume:
Changing the volume:Code:bus = dbus.SessionBus() obj = bus.get_object("com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer", "/com/nokia/mafw/renderer/gstrenderer") mafw = dbus.Interface(obj, "com.nokia.mafw.extension") volume = int(mafw.get_extension_property("volume")[1])
I'm using os.system here because couldn't get it work otherwise. Note that --print-reply is necessary to make the volume change happen, but there won't come a reply, and it will timeout with an error. That's why I'm sending it to background using "&". Omitting --print-reply avoids the timeout with error message but won't change the volume at all.Code:os.system("dbus-send --session --print-reply " \ "--dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer " \ "/com/nokia/mafw/renderer/gstrenderer " \ "com.nokia.mafw.extension.set_extension_property " \ "string:'volume' variant:uint32:%d &" \ % volume)
Using the mafw libs would certainly be a much cleaner solution, but this does its job.
dbus-send --session --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:'volume' variant:uint32:100
Last thing I need is to control the media player (or system global) volume.
Is there any way how to control the volume?