MediaView with DBus mpris control

Ask about the individual Gambas components here.
Post Reply
User avatar
BruceSteers
Posts: 1572
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

MediaView with DBus mpris control

Post by BruceSteers »

I've been trying to make a mpris enabled MediaView control

https://gitlab.com/bsteers4/gb.mediaview.mpris

It needs some folks with more gb.DBus knowledge than me i think.

It is a copy of the MediaView control with a few modifications like accessing the internal MediaPlayer control to get State.

Plus a dbus class for the mpris.MediaPlayer2 that can control the MediaView

Todo: the MediaView does not fire property changes correctly and inform DBus of state changes.


Cinnamon media controller applet can play/pause and read the metadata
(it seems glitchy though and it's play button does not change to pause as it does not get the property change)

My own media controller application can play/pause/seek/position/set volume

but it sometimes reads Null when getting the dbus properties from this application (not others).

If you want to help on this project then find it here..
https://gitlab.com/bsteers4/gb.mediaview.mpris
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1572
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: MediaView with DBus mpris control

Post by BruceSteers »

ooh it's coming along now :)

Still pretty WIP but getting up to standard

I figured out how to send dbus property change signals.
now the player is pretty fully controllable by Cinnamon sound applet and it notices the players state changes

(This post has been deleted as is now irrelevant, see posts below)

(attachment of old version removed, see below for new version)
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1572
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: MediaView with DBus mpris control

Post by BruceSteers »

Here's a clip of me using my own controller and the Cinnamon one to show the metadata info and control the MediaView player via DBus

If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1572
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: MediaView with DBus mpris control

Post by BruceSteers »

Big update.

Changes...

Introduced an MPRIS_Metadata.class to handle all the metadata fields

This is heading out of WIP now and heading to Beta.

the server class is fully functional and seems to work well.

now the test app has a "Remote control" button that opens up a window using the MPRIS_Interface.class to control other players.

Added a ton of stuff to the readme. and a bunch of comments in the source.
https://gitlab.com/bsteers4/gb.mediavie ... /README.md
Attachments
gb.mpris-1.1.tar.gz
(39.16 KiB) Downloaded 481 times
Screenshot-mpris.png
Screenshot-mpris.png (1.22 MiB) Viewed 6420 times
If at first you don't succeed , try doing something differently.
BruceS
User avatar
BruceSteers
Posts: 1572
Joined: Thursday 23rd July 2020 5:20pm
Location: Isle of Wight
Contact:

Re: MediaView with DBus mpris control

Post by BruceSteers »

I have submitted a merge request...
https://gitlab.com/gambas/gambas/-/merge_requests/326

This would add gb.media.mpris2 as a component for gambas that includes the following...

* create gb.media.mpris2 component to support DBus MPRIS2 media control
* MPRIS_Interface, detect and control available interfaces.
* MPRIS_DBusObject, The DBus object specific routines.
* MPRIS_Server, create an interface and send/recieve MPRIS control data.
* MPRISView , a MediaView control clone that has it's own MPRIS_Server to be controlled by mpris controllers.
* MPRIS_Metadata.class, to handle metadata specific data.
* 2 Test/Example programs. MprisView (MediaView clone) and MprisReader controller.

I'm 100% sure it's not good enough for Benoit ;) lol
But he said he would take a look at it. Hopefully he's on board with the concept and he'll tell me what he does not like so i can make changes to suit.

then everyone could easily make mpris2 enabled players :)
If at first you don't succeed , try doing something differently.
BruceS
Post Reply