Review Request: Make the kded module use async dbus calls

Martin Klapetek martin.klapetek at gmail.com
Wed Aug 8 13:40:00 UTC 2012



> On Aug. 6, 2012, 7:08 p.m., George Kiagiadakis wrote:
> > Much better now. It's a bit unclear how it behaves if there are multiple clients, but this is not a realistic scenario anyway. One other thing I just noticed (but don't hold this commit for this) is that if a client quits without stopping music first (i.e. the service gets unregistered), you may want to change presence back.
> 
> Martin Klapetek wrote:
>     > It's a bit unclear how it behaves if there are multiple clients
>     
>     It should be whichever player sends the Metadata last, will "win". Unfortunately Amarok seems retarted, because it sends with every manual track change the "PlaybackStatus=Stopped" signal first, which disables the plugin as it listens to that signal. This makes it effectively unusable with Amarok, but also JuK. Works perfectly fine with Clementine.
>     
>     So the question is - should we deactivate this presence when you stop the playback (like it is now) or just leave it on the "Now playing..." and keep waiting for the playback status to change until the user changes the presence manually?
>     
>     > if a client quits without stopping music first, you may want to change presence back
>     
>     I tested with Clementine and that one behaves correctly - before it quits, it sends the "PlaybackStatus=Stopped" message, while Amarok just quits. So we'll have to add a connection for the service being unregistered and disable it then. I might try to fix amarok/report a bug.
> 
> George Kiagiadakis wrote:
>     Hmm, I didn't notice this. I don't think the plugin should be disabled when you stop playing. You may well want to stop the player without quitting it and start it again later. I think it should only be disabled when the player quits. When it just stops, you could just reset the presence.

Just in case it was misunderstood, this is how it works right now - user selects the "now playing" presence, the plugin is activated in kded where it waits for player signal, player starts playing, a temp presence is inserted into the contact list presence chooser and is selected, when the player stops/pauses, the plugin in kded is deactivated again and the previous user presence is restored, which causes the presence chooser to select different presence and thus deactivating this plugin (once again, but nothing happens as it is deactivated). At this point, this plugin won't be activated again until user selects the "now playing" presence in contact list again. 

I did this with the assumption, that if you stop your music, you want your presence to go back to whatever it was. But this breaks badly with Amarok/JuK/possibly others, who send "PlaybackStatus=Stopped" first when changing songs manually (continuous play is fine).

I'm thinking we could change this whole thing to not be activated by an item in the presence dropdown (and deactivated when something else is selected), but rather by some checkbox "Set my presence to 'now playing' whenever there's a music playing". So it would be activated all the time and whenever you play music, it automatically sets the presence to the configured string. if you pause/stop it, it goes back to your previous presence. if you play it again, it sets the now playing presence again. Maybe a checkbox in the settings menu?

Anyway I'll commit this now as-is, to at least get rid of the sync dbus calls.


- Martin


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105813/#review16992
-----------------------------------------------------------


On Aug. 6, 2012, 9:13 a.m., Martin Klapetek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105813/
> -----------------------------------------------------------
> 
> (Updated Aug. 6, 2012, 9:13 a.m.)
> 
> 
> Review request for Telepathy.
> 
> 
> Description
> -------
> 
> I reworked the kded module to use async dbus calls. Now when it detects a player, it queries for all its properties (to save some roundtrips) and if it finds the player is playing, it sets the song info as the presence.
> 
> 
> Diffs
> -----
> 
>   telepathy-mpris.h de45cec 
>   telepathy-mpris.cpp 8386dd9 
> 
> Diff: http://git.reviewboard.kde.org/r/105813/diff/
> 
> 
> Testing
> -------
> 
> Tested with clementine.
> 
> 
> Thanks,
> 
> Martin Klapetek
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-telepathy/attachments/20120808/b2d3c1bc/attachment.html>


More information about the KDE-Telepathy mailing list