mpris media controller (WIP)
Posted
#1
(In Topic #982)
Guru

it's a DBus mpris.MediaPlayer2 controller.
What i have so far..
The program opens a tray icon on launch.
Right clicking the icon shows the menus.
A menu is created for any found controlable DBus mpris players
(things like vlc, firefox (youtube), SMplayer, Spotify, many other media players)
The related players icon is shown and the menu will contain Rewind/Prev/Pause+Play/Next/Forward options.
If the player does not support Rewind/Prev/etc options the menu only shows what's supported.
Rewind and Forward menu options will go 10 seconds
also you can left click the Tray icon to open the window
In the window the players are listed with controls and a position slider (if available)
It's new and pretty untested and may give some errors yet but maybe you like the idea and it inspires you to do better
Todo:
Add Volume and other controls but i cannot get the Volume DBus command to use a Double (Float) instead of a Variable
Sort out the interface as it needs to be flashy/cool/changable
Much much much more error checking and improvements.
Posted
Guru

I figured out Volume , also how to set LoopStatus and Shuffle
Added a signal watcher that detects DBus MPRIS events like Volume/Position changes so updates instantly.
(Seems there is no way to tell what program sent the signal so on getting notification it checks all controllers)
I removed the Info Label and put the info in a Tooltip to make it more compact
Position slider/Volume/controls will hide what's not available
Still a long way to go but it's coming along nicely
Posted
Guru

When I clicked on the TrayIcon I got a blueish rectangle in the middle of the monitor, nothing else, just a blue rectangle. I clicked on the 'PlayerControl' button that caused the crash.
Is it me or some other issue?
<IMG src="https://www.cogier.com/gambas/MControl.png">
</IMG>
Posted
Guru

Did you have no mpris players loaded at the time? (I've since added handling to not open the window if no players exist)
Players I know of so far…
Firefox video, SMplayer, VLC, Spotify
SMplayer is not great, it always reports it's volume as 0.4 regardless what it's set to, this causes a glitch in the program i need to account for :-\
Also there seems to be a position sliding issue where sometimes the slider updates to the current position before it sets the position to somewhere else after sliding.
Posted
Guru

I doesn't seem to matter what I do, nothing, other than 'Quit', appears on the menu.
<IMG src="https://www.cogier.com/gambas/VLC.png">
</IMG><IMG src="https://www.cogier.com/gambas/Chrome.png">
</IMG>I was going to try Firefox but on relaunching the program it put a 'No Entry' sign on the taskbar and the Console in Gambas announced 'gb.desktop: unable to get icon for file:'.
What I am after is to allow Mint to be able to access my program as YouTube can, through Chrome, as you can see in the second picture.
Posted
Guru

Dunno why you have problems with the program?
it works here.
Posted
Guru

Posted
Guru

cogier said
OK Thanks, I'll have to look into MPRIS.
oooh it's complicated.
So far I have a half built project that adds mpris to MediaView
My DBus experience is not good enough i think though.
I think i'll add another post about it and see if anyone can help make it work properly.
Posted
Guru

Posted
Guru

Did you sre my post on the m/l ?
I'm part way there
[Gambas-user] mpris MediaPlayer2 interface
Posted
Guru

Changes ,
It no longer shows all players at once just one and others are selectable via menubutton. this is better as only the one main form has timers and updating objects not many.
Show art images if present. uses Task.class and gets the image uri be it local or online.
Added an Auto-Stop option , if set when you play any player any other running players will stop. (not just via this programs buttons, the program detects a new player starting and turns others off automatically)
Just ironing out bugs now.
it should auto-adapt to players being loaded/closed but could throw an error or 2.
NOTE: this is the old version, see the post below for later version.
Posted
Guru

now BG color can be changed to your liking.
Added a couple of features where if the files being played are local then you can open the dir and Play Next/Prev will Dir() the folder and use that as a playlist if no playlist exists in the player.
(nice if you have watched a single series episode from a folder and want to watch the next)
1 guest and 0 members have just viewed this.







