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 » Sun Feb 12, 2012 12:59 pm

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 » Sun Feb 12, 2012 1:08 pm

Just tested the code with rhythmbox, it works fine. Guayadeque is not emitting the Seeked signal.

User avatar
anonbeat
Posts: 1953
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat » Sun Feb 12, 2012 1:59 pm

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: 1953
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat » Sun Feb 12, 2012 2:48 pm

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 » Mon Feb 13, 2012 6:21 pm

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 » Tue Feb 14, 2012 8:59 am

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: 1953
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat » Wed Feb 15, 2012 12:00 am

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 » Wed Feb 15, 2012 3:46 pm

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: 1953
Joined: Thu Sep 16, 2010 9:47 pm

Problems with the mpris2 dbus interface

Post by anonbeat » Wed Feb 15, 2012 3:48 pm

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 » Wed Feb 15, 2012 10:28 pm

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

Post Reply