Thread: Help with DBUS
View Single Post
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#5
Originally Posted by christye View Post
Only thing I have to look at now is why, upon restarting the phone can't I use any command to start music playing - I have to press the play button on the widget instead. Anyway, I am happy with the results!
Cause there isn't any playlist assigned to the renderer, so it doesn't know what to play.

Code:
method call sender=:1.595 -> dest=com.nokia.mafw.playlist serial=128 path=/com/nokia/mafw/playlist; interface=com.nokia.mafw.playlist; member=create_playlist
   string "FmpAudioPlaylist"
method return sender=:1.87 -> dest=:1.595 reply_serial=128
   uint32 4
You'll need to create a playlist with the name FmpAudioPlaylist, since you already have one, a dbus reply would have the number of the playlist object (4 in my case above).

After that, you'll need to assign the playlist number above to the renderer.

Code:
method call sender=:1.595 -> dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer serial=226 path=/com/nokia/mafw/renderer/gstrenderer; interface=com.nokia.mafw.renderer; member=assign_playlist
   uint32 4
Now, chances are the playlist number will always be the same on your device (it will be different on other devices), you can get the number easily (if you don't want to listen to DBus) with:

Code:
Nokia-N900:~# grep FmpAudioPlaylist /home/user/.mafw-playlists/*
/home/user/.mafw-playlists/4:FmpAudioPlaylist
So, here's the lazy way of doing it.
Get the number as I showed you above, then
Code:
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.assign_playlist uint32:4

dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.goto_index uint32:0

dbus-send --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.renderer.play
Replace 4 with the playlist you want (you can also use your saved playlists, it doesn't have to be FmpAudioPlaylist (just make sure it's not a video playlist)).

Replace the last 0 in the goto_index command with the song you want to start first, numbering starts at 0, so if you're looking at the number in the UI, subtract a 1.

Play the playlist, as per the last command.
 

The Following 4 Users Say Thank You to MohammadAG For This Useful Post: