Page 1 of 3

Problems with the mpris2 dbus interface

Posted: Sun Feb 12, 2012 12:59 pm
by bayanr
I am having a problem trying to connect to the "seeked" signal in the mpris2 Player dbus interface. I connected to the interface and am able to make calls such as PlayPause or Next, but I am unable to connect to the "Seeked" signal in the Player. I have the correct number of arguments, is it a problem with my code or is the seeked signal not implemented yet?

Here is the python test code I ran:

import dbus
from dbus.mainloop.glib import DBusGMainLoop
import gobject

def test(x):
.....print 'seeked'

loop = DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus(mainloop=loop)
remote_player = bus.get_object('org.mpris.MediaPlayer2.guayadeque', '/org/mpris/MediaPlayer2')
iface_player = dbus.Interface(remote_player, 'org.mpris.MediaPlayer2.Player')
iface_player.connect_to_signal("Seeked", test)
#iface_player.Next()
loop = gobject.MainLoop()
loop.run()

Problems with the mpris2 dbus interface

Posted: Sun Feb 12, 2012 1:08 pm
by bayanr
Just tested the code with rhythmbox, it works fine. Guayadeque is not emitting the Seeked signal.

Problems with the mpris2 dbus interface

Posted: Sun Feb 12, 2012 1:59 pm
by anonbeat
Yes guayadeque have not implemented the seeked signal.

I will implement it soon. Never thought anyone was going to need it.

Problems with the mpris2 dbus interface

Posted: Sun Feb 12, 2012 2:48 pm
by anonbeat
Please check with svn revision 1778. Signal Seeked have been added

Thanks for your help

Problems with the mpris2 dbus interface

Posted: Mon Feb 13, 2012 6:21 pm
by l300lvl
I was thinking this was something else, and I asked a dev and he said seeked is different. So I was wondering if SetPosition is already implimented, or if it will be in the future. Will that be harder to impliment?

Problems with the mpris2 dbus interface

Posted: Tue Feb 14, 2012 8:59 am
by l300lvl
I guess what I was talkign about it something different, I'm forwarding you an email I got from someone else explaining the issue anonbeat.

Problems with the mpris2 dbus interface

Posted: Wed Feb 15, 2012 12:00 am
by anonbeat
SetPosition should work now in svn revision 1784

Thanks

Problems with the mpris2 dbus interface

Posted: Wed Feb 15, 2012 3:46 pm
by l300lvl
Hi after testing I see it is working now. But, it still seems to not always show the correct track time, this was present before but I thought it might be because of SetPosition not working. So while you can set the position now, sometimes it will show a track is 40 minutes when it is only a few minutes long, making it harder to seek through that track. Then when you go to far it just skips to the next track.
Thanks again

Problems with the mpris2 dbus interface

Posted: Wed Feb 15, 2012 3:48 pm
by anonbeat
Sometimes?
Can you check with revision 1786 please?

Problems with the mpris2 dbus interface

Posted: Wed Feb 15, 2012 10:28 pm
by l300lvl
Done. Seems much much better now thanks!!! After disabling cross-fading, it lets me skip tracks faster, and fnally makes for a useful 'sound menu' in Gnome Shell. I would recommend using the Media Player Indicator extension as it is the most updated as of now. https://extensions.gnome.org/extension/ ... indicator/

Thanks again!!