Problems with the mpris2 dbus interface

Use this category to discuss anything related to the development of Guayadeque.
bayanr
Posts: 2
Joined: Sun Feb 12, 2012 12:51 pm

Problems with the mpris2 dbus interface

Post 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()
bayanr
Posts: 2
Joined: Sun Feb 12, 2012 12:51 pm

Problems with the mpris2 dbus interface

Post by bayanr »

Just tested the code with rhythmbox, it works fine. Guayadeque is not emitting the Seeked signal.
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat »

Yes guayadeque have not implemented the seeked signal.

I will implement it soon. Never thought anyone was going to need it.
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat »

Please check with svn revision 1778. Signal Seeked have been added

Thanks for your help
l300lvl
Posts: 226
Joined: Sun Mar 06, 2011 12:21 pm

Problems with the mpris2 dbus interface

Post 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?
l300lvl
Posts: 226
Joined: Sun Mar 06, 2011 12:21 pm

Problems with the mpris2 dbus interface

Post 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.
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat »

SetPosition should work now in svn revision 1784

Thanks
l300lvl
Posts: 226
Joined: Sun Mar 06, 2011 12:21 pm

Problems with the mpris2 dbus interface

Post 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
User avatar
anonbeat
Posts: 2048
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat »

Sometimes?
Can you check with revision 1786 please?
l300lvl
Posts: 226
Joined: Sun Mar 06, 2011 12:21 pm

Problems with the mpris2 dbus interface

Post 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!!
Locked