Author Topic: Windows 10 Media Control Overlay  (Read 50647 times)

Nokiaman

  • Jr. Member
  • **
  • Posts: 63
The whole problem is because of the media control "feature" that if you press a keyboard media key, the media control also simulates a click on its buttons. And the plugin defines the appropriate action for the buttons. So everything is executed two times - one from media control buttons callback and one from music bee global hotkey.

So here is a fixed plugin for everyone who wants to have working media control buttons and working global hotkeys:
http://www.mediafire.com/file/7fdiewd2r3df62i/mb_MediaControl.zip/file

The fix uses a keyboard key press hook that watches for keyboard media key presses and saves the time of the last press. And if last press is less than 1500 milliseconds ago the media control button press is ignored.

For everyone who doesn't trust me, here is the source to see what is done and compile it yourself:
http://www.mediafire.com/file/hfrflurmkonsv8f/MediaControlSource.zip/file

Thank you so much!

PlumBlossom

  • Newbie
  • *
  • Posts: 9
Hello everyone!
I recently reset my laptop and reinstalled Windows and everything related. I downloaded the patched Windows 10 Media Overlay plugin and it works perfectly. The only thing I noticed is that the overlay block thing lingers on the screen for a bit before it fades away. It used to fade away much sooner when I had it before. It's really not too big of a deal because, like I said, the plugin works perfectly but I was wondering if there was a way to adjust it? Thanks!

literaldehyde

  • Newbie
  • *
  • Posts: 6
The whole problem is because of the media control "feature" that if you press a keyboard media key, the media control also simulates a click on its buttons. And the plugin defines the appropriate action for the buttons. So everything is executed two times - one from media control buttons callback and one from music bee global hotkey.

So here is a fixed plugin for everyone who wants to have working media control buttons and working global hotkeys:
http://www.mediafire.com/file/7fdiewd2r3df62i/mb_MediaControl.zip/file

The fix uses a keyboard key press hook that watches for keyboard media key presses and saves the time of the last press. And if last press is less than 1500 milliseconds ago the media control button press is ignored.

For everyone who doesn't trust me, here is the source to see what is done and compile it yourself:
http://www.mediafire.com/file/hfrflurmkonsv8f/MediaControlSource.zip/file

I have the bug where the base plugin plays tracks over each other, but this version of the plugin just completely disables media controls for me. Using 3.4.8033.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8511
Using 3.4.8033.
If you're not using the Store version, try using the latest 3.5 from the first forum topic. If you're on the Store version there's nothing you can do until a new Store version is released.
Download the latest MusicBee v3.5 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here.

literaldehyde

  • Newbie
  • *
  • Posts: 6
Using 3.4.8033.
If you're not using the Store version, try using the latest 3.5 from the first forum topic. If you're on the Store version there's nothing you can do until a new Store version is released.

I've updated to 3.5 and it hasn't changed anything. But I believe I've fixed the problem for myself.

I forgot to mention that because my laptop doesn't have dedicated media control buttons, I use an AutoHotkey script to rebind Ctrl+Shift+Left to Media_Prev, Ctrl+Shift+Right to Media_Right, and Ctrl+Shift+/ to Media_Play_Pause. I believe these AHK hotkeys send simulated media control presses, but aren't real buttons so alexdo's fix wasn't actually necessary for me. I only thought I needed it because I gave myself the double register bug by having the MusicBee multimedia global hotkeys set to the virtual media control buttons because I must have had the script running when I set them. This caused both MusicBee and Autohotkey to send media control commands simultaneously, instead of MusicBee + keyboard button conflicts other people were having.

I fixed it by changing the MusicBee multimedia global hotkeys to Ctrl+Shift+Left, Right, etc. while the AHK script was disabled. And now after reenabling it everything seems to be working fine including the overlay using the original version of the plugin. Only minor gripe is that as others have reported, audio needs to be played directly through the MusicBee window once after it starts up before the hotkeys begin to register. I noticed the Spotify app doesn't have that problem so I imagine there's a potential fix but who knows? Media Controls do conflict with other media players like Spotify, but that's not a problem for me because I've never needed to have both open at the same time.

Cheers!
Last Edit: February 14, 2023, 01:09:27 AM by literaldehyde

froschfinger

  • Newbie
  • *
  • Posts: 10
So far, this is working really well with the fixed version for the media keys from here. On Windows 11, this also intends to show the duration and track position a song is at, only it shows its length as 0:00 and as 100% played, no matter at what position the playback actually is, so the duration functionality doesn't seem to work. Did anybody ever solve this?
On top of it, this would be even sweeter if it showed up each time a new track is playing, just like the internal playback toast notification. I guess one can't have it all…