It is currently December 9th, 2021, 4:58 am

NowPlaying measure not executing some bangs

Report bugs with the Rainmeter application and suggest features.
qwerty user
Posts: 4
Joined: November 12th, 2021, 4:04 am

NowPlaying measure not executing some bangs

Post by qwerty user »

I posted a topic about a skin that I made that was not working, and was told it was a bug. In short, while using WMP, the "[!CommandMeasure "measurePlayer" "PlayPause"]" was not working when executed from the HotKey plugin, only from a meter. However, "[!CommandMeasure "measurePlayer" "OpenPlayer"]" works as expected. I have written about it in more detail here https://forum.rainmeter.net/viewtopic.php?p=200117.
User avatar
Brian
Developer
Posts: 2304
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: NowPlaying measure not executing some bangs

Post by Brian »

I am unsure if this is a bug with Rainmeter, or with the HotKey plugin (or worse, the plugin API).

Until I can find the culprit, you can use the "Delay trick" to fix this particular issue.

KeyDownAction=[!Log "key was pressed"][!Delay 0][!CommandMeasure "measurePlayer" "PlayPause"]

-Brian
User avatar
Brian
Developer
Posts: 2304
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: NowPlaying measure not executing some bangs

Post by Brian »

While I found the issue, solving it will take a little time (mostly due to my schedule).

The problem lies in how Rainmeter communicates with WMP via Windows Messages. After the bang is processed, the command is sent to WMP, however, WMP rejects it since the message originated from a different thread than the Rainmeter thread (this is because the HotKey plugin runs in a different thread).

The !Delay trick works because Rainmeter copies the bangs declared after the !Delay bang, and then executes them after the delay (in this case, immediately) - but these bangs are now executed from the main Rainmeter thread...so that is why it works.

Long story short, I will most likely have to modify the HotKey plugin to make this work correctly.

-Brian
qwerty user
Posts: 4
Joined: November 12th, 2021, 4:04 am

Re: NowPlaying measure not executing some bangs

Post by qwerty user »

Thank you for your help, using [!Delay 0] works perfectly.