INTERACT FORUM

Windows => Third Party Plug-ins, Programs, and Skins => Topic started by: Mike Noe on August 26, 2017, 12:25:52 pm

Title: MPRIS2 Daemon
Post by: Mike Noe on August 26, 2017, 12:25:52 pm
Just polling for interest....

I writing a QT-based lib (linux/windows for now) that uses MCWS to work with MC Servers.  One feature it provides is basic MPRIS2 support in a daemon.  It's a little rough, but usable.

Any linux users interested in alpha testing the MPRIS2?  I think I'll have the daemon piece done in a few days.

FWIW, I don't see any other mention of MPRIS, but maybe there's already something available? 
Title: Re: MPRIS2 Daemon
Post by: mwillems on August 26, 2017, 04:32:53 pm
I would love to test, and as far as I know there is nothing else available. I rigged up something using libnotify that's crude (no playback controls, etc.), and would love to have actual MPRIS integration.
Title: Re: MPRIS2 Daemon
Post by: JimH on August 26, 2017, 04:49:14 pm
Mike,
Could you describe what a user might experience?

Here's a link to MPRIS:
https://specifications.freedesktop.org/mpris-spec/latest/

Thanks,

Jim
Title: Re: MPRIS2 Daemon
Post by: Awesome Donkey on August 26, 2017, 05:13:33 pm
MPRIS is at the top of my MC for Linux wishlist these days so I'd love to see it too. I know Bob is very much aware of it already, and I believe has looked into it and plans on perhaps supporting it at some point in the future.
Title: Re: MPRIS2 Daemon
Post by: Mike Noe on August 26, 2017, 05:53:13 pm
Mike,
Could you describe what a user might experience?

Yeah, so it's not a "real" daemon, so to speak, but it runs in the background, and can be set up with systemd or just a .desktop if so desired.  It's just a QT console app, simple as pie, statically linked with my lib.  So, you just need a QT runtime installed (he said "just").  A side "benefit" is that the lib also provides a QML binding, fwiw.  The QML binding is part of the lib by default.

Right now, you run it from the command line and you can start it by specifying a MC host that is exposing MCWS (or conf file), with an auth token optional (defaults to localhost:52199).  It is fully multi-zone capable, so you have to also tell it which zone is "current" for MPRIS, otherwise it defaults to zone = 0.  Zone can be changed dynamically from the CLI.  Frankly, there's no reason a simple GUI with a systray icon couldn't be added to make it easy.

The MPRIS plasmoid I'm testing with shows multiple MPRIS sources (and lets you choose), so theoretically, I could expose all zones simultaneously, but currently, it just exposes one zone as default.
Title: Re: MPRIS2 Daemon
Post by: JimH on August 26, 2017, 06:16:44 pm
Thanks.

What does it do?  ;)

This QT?
https://en.wikipedia.org/wiki/Qt_(software)
Title: Re: MPRIS2 Daemon
Post by: mwillems on August 26, 2017, 06:24:48 pm
Thanks.

What does it do?  ;)

This QT?
https://en.wikipedia.org/wiki/Qt_(software)

Jim a full MPRIS wrapper would do three things:
1) It would provide system and lock screen notifications for what's playing in MC on Linux systems, so you can see track names at a glance without switching back to MC or unlocking the computer. 
2) It would expose simple playback controls in the task bar and/or on the lock screen on linux systems (start, stop, skip track). 
3) It would (probably) also allow standard keyboard media keys to work correctly on Linux in most desktop environments, because many DE's intercept any media keys and try to hand them off to whatever media player is currently accessible via MPRIS; because MC currently has no MPRIS interface, the media keys never arrive.  This is an issue at least in Gnome, Cinnamon, and KDE in my testing, and may affect others.  It also makes MCE remotes harder to configure as you have to work around the fact that media keys can't get to MC.
Title: Re: MPRIS2 Daemon
Post by: JimH on August 26, 2017, 06:44:57 pm
So the goal of implementing MPRIS is to provide better integration into the Linux desktop?
Title: Re: MPRIS2 Daemon
Post by: mwillems on August 26, 2017, 07:25:42 pm
So the goal of implementing MPRIS is to provide better integration into the Linux desktop?

In a nutshell, but with the potential to help with some hardware integration issues as well (i.e. it may simplify using an MCE remote or keyboard media keys with MC on Linux systems).
Title: Re: MPRIS2 Daemon
Post by: Mike Noe on August 27, 2017, 06:38:21 am
@Jim:
Yes, it's C++ using the Qt Framework.  And, yes, mwillems got it right in terms of functionality.  Right now, I'm testing his points 1 and 2 on Plasma5 (working fine) using two plasmoids (systray apps):  the built in plasma audio volume control and the addon from here:  Audio Control Plasmoid (https://store.kde.org/p/1100894/)

Never even considered his point 3 re: media keys.  I will take a look at that.

Right now, I think the only thing not implemented from the MPRIS2 spec is the playlist ordering and a playlist change notify.

A note about MC Zones and the MPRIS2 spec:
You'll notice in the spec that multiple players can expose thru MPRIS.  Most of the MPRIS controllers I've seen then provide the user some option to choose the player to "control".  In MC, since one player can have many zones, we have the ability to expose each zone as a unique MPRIS player.  For those controllers that offer the choice of player selection, works fine, you just choose the zone you want to control.   Otherwise, there has to be some mechanism for the user to choose a zone to be the "current MPRIS2 zone".

My plan is to offer both options, set in the conf file per MC host, checked at host connect:
Code: [Select]
[General]
recentHostlist=localhost:52199,toshiba-laptop:52199
lastHost=localhost:52199
.
.
[localhost]
broadcastAllZones=1
currentZone=10001
.
.
[toshiba-laptop]
broadcastAllZones=0
currentZone=0
.
.
Title: Re: MPRIS2 Daemon
Post by: Mike Noe on August 27, 2017, 06:20:01 pm
@mwillems,Awesome Donkey:
I have a version that I've tested with Plasma5/Qt 5.9 only.  Send me a PM if you're interested in testing.  I "think" it will run on Qt back to 5.6, but I'm not sure.
Title: Re: MPRIS2 Daemon
Post by: zeltak on September 23, 2018, 01:18:20 am
Hi

i know this is old but has this been applied? I would also love MPRIS support

thx

Z