music icon indicating copy to clipboard operation
music copied to clipboard

pause on suspend/hibernate

Open elementaryBot opened this issue 7 years ago • 9 comments

On suspend or hibernate, pause should be sent out to all media players.

Nothing like closing your notebook at home, and opening it somewhere else with your music blaring XD

Launchpad Details: #LP769598 Daniel Fore - 2011-04-23 19:09:36 +0000


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

is there a dbus api that all music players share for this or something? Or am I only gonna support BeatBox?

Launchpad Details: #LPC Allen Lowe - 2011-04-25 17:36:01 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

If it's possible, we should do whatever happens when you press the pause media key on the keyboard. In that way it's respected by music and video players.

Launchpad Details: #LPC Daniel Fore - 2011-04-25 17:52:03 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

The best choice should be MPRIS. BeatBox is going to support as far as I was told, and further more Audacious, Banshee, Rhythmbox, XMMS and VLC support it (to different degrees):

http://xmms2.org/wiki/MPRIS

Launchpad Details: #LPC Christian Dywan - 2011-04-25 18:05:36 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

I have tried tackling this problem.

It looks like we need to add a script to /etc/pm/sleep.d

Launchpad Details: #LPC Jason Anderson - 2014-12-03 04:34:08 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

...and use dbus to pause the media players. When the computer is about to go to sleep it fires off a signal on dbus to the listening programs. I have enclosed the script which may make this work.

Launchpad Details: #LPC Jason Anderson - 2014-12-03 04:35:51 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

Okay, I think this little feature is ready for testing. If anyone wants, they can clone my branch and test it out.

Launchpad Details: #LPC Jason Anderson - 2015-03-06 02:59:56 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

You need to listen for the PrepareForSleep() signal in Noise and pause the music when you get that signal.

www.freedesktop.org/wiki/Software/systemd/inhibit/

Launchpad Details: #LPC Cameron Norman - 2015-06-08 18:48:27 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

I believe this should be a system-wide pause command (MPRIS) and should not be limited to only VLC. I don't think the player should care what sleep state the system is in.

Launchpad Details: #LPC Zisu Andrei - 2016-05-26 21:33:17 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot

Sorry, read should not be limited only to Noise.

Launchpad Details: #LPC Zisu Andrei - 2016-05-26 21:33:33 +0000

elementaryBot avatar Apr 21 '17 02:04 elementaryBot