[MPRIS] "TimeFocused" property?
Alex Merry
alex.merry at kde.org
Mon Mar 17 07:44:31 PDT 2014
On 07/11/13 13:38, Bastien Nocera wrote:
> Heya,
>
> gnome-settings-daemon, which handles media-keys in GNOME, recently (in
> GNOME 3.10) got support for MPRIS in addition to its own media-keys API.
>
> This is the documentation for the gnome-settings-daemon API:
> https://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/media-keys/README.media-keys-API
> and the API itself:
> https://git.gnome.org/browse/gnome-settings-daemon/tree/plugins/media-keys/gsd-media-keys-manager.c#n79
>
> as you can see, we could replace all of that with MPRIS, apart from one
> thing, the "time" argument passed to GrabMediaPlayerKeys().
>
> This is used for gnome-settings-daemon to know which one was the last
> focused (or last used) media player so that keyboard keys are forwarded
> to that player even if the player isn't focused.
>
> I could track the last media player to appear on the bus, or the last
> one we sent events to, but that would mean that unfocusable players (the
> "daemon" kind) would get the benefit of that, and changing playback
> using the media player gnome-shell extension wouldn't update that "last
> focused" variable.
Hey, sorry for the extremely long delay in replying.
The mpris2 engine for the KDE Plasma desktop uses a heuristic that picks
a playing media player, or else a paused one, or else a stopped one, and
tries to keep a consistent player subject to those constraints.
Now, we could add a property to the root interface that indicated that
last time a user interacted with the media player for this sort of
multiplexing, but there would have to be some decision about what
constituted an "interaction". Should it be any interaction? If you
have mpd playing some music, and want to inspect a playlist in another
media application, should that cause the active player to change? Is
focussing an application enough, or should it be proper interaction, or
should it be something like queuing up a track?
This is something where I'd rather not leave the decision to the media
players themselves; it should either be determined by the spec or
(somehow) by the client.
Alex
More information about the MPRIS
mailing list