If I go to YouTube in Chrome and play a song, a player control is available in the system tray.
I would like to access this from within Gambas.
Has anybody got any idea how to do this.
Linux Mint 20.3 Cinnamon Desktop
Music controls
Re: Music controls
I think that this would be either horrifying difficult or it would depend on something made public by the player application - dbus?
The horrible method would involve somehow finding the application icon on the screen and somehow activating it with generated mouse actions (and I dont think that is easy either).
b
The horrible method would involve somehow finding the application icon on the screen and somehow activating it with generated mouse actions (and I dont think that is easy either).
b
Have you ever noticed that software is never advertised using the adjective "spreadable".
- BruceSteers
- Posts: 1578
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Music controls
apparently the cinnamon sound applet uses dbus mpris
https://specifications.freedesktop.org/ ... ec/latest/
https://specifications.freedesktop.org/ ... index.html
https://specifications.freedesktop.org/ ... ec/latest/
https://specifications.freedesktop.org/ ... index.html
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Music controls
Thanks Bruce. I think, as thatbruse says, this would not be easy. I'd need to understand dbus first.
-
- Posts: 195
- Joined: Tuesday 26th September 2017 3:17pm
- Location: NW England
Re: Music controls
I've just seen mps-youtube (and others) on the command line which I think could be run from EXEC[].
Just a thought!
Just a thought!
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Music controls
Thanks Bill, but I have already written the player, and it uses youtube-dl to download the music I like. What I want to do is connect it to the built-in music controls that most distros have. As you can see above, Chrome allows Mint to control the playing of the track/video.I've just seen mps-youtube (and others) on the command line which I think could be run from EXEC[].
Just a thought!
- BruceSteers
- Posts: 1578
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Music controls
Here's a simple way
xdotool key XF86AudioRaiseVolume
xdotool key XF86AudioLowerVolume
xdotool key XF86AudioMute
If at first you don't succeed , try doing something differently.
BruceS
BruceS
- cogier
- Site Admin
- Posts: 1127
- Joined: Wednesday 21st September 2016 2:22pm
- Location: Guernsey, Channel Islands
Re: Music controls
Unfortunately, these tools only do what I have already mastered. To change the volume I use: -
Shell "amixer -D pulse set Master " & Str(SliderVol.Value) & "%"
And to pause the music: -MediaPlayer1.Pause()
I was after using the controls on the desktop to control my program (see picture in first post).