It is currently March 29th, 2024, 6:51 am

Rainmeter NowPlaying measure

Get help with creating, editing & fixing problems with skins
qwerty user
Posts: 4
Joined: November 12th, 2021, 4:04 am

Rainmeter NowPlaying measure

Post by qwerty user »

Hello, I have a problem with a Rainmeter bang not executing.
While using the NowPlaying measure with Windows Media Player, if Windows Media Player is closed, the measure commands still work, so the media can be controlled using a Rainmeter skin. However, the media keyboard keys do not work, so the media cannot be controlled with the media keys. I am trying to run

Code: Select all

[!CommandMeasure "measurePlayer" "PlayPause"]
when the play/pause key is pressed. So far, I have installed the HotKey plugin from https://github.com/brianferguson/HotKey.dll, and written

Code: Select all

[measurePlayPauseKey]
Measure=Plugin
Plugin=HotKey
HotKey=a
KeyUpAction=[!Log "key was pressed"][!CommandMeasure "measurePlayer" "PlayPause"]
I am using the "a" key instead of the play/pause key while I write the code. When I press "a", "key was pressed" is shown in the log, but the media keeps playing. However, when I click on the "[play]" meter, the media pauses. I don't know why the !log command works, but the !CommandMeasure command does not. Below is my code.

Code: Select all

[Rainmeter]
Update=50
BackgroundMode=2
SolidColor=0,0,0,1

[Variables]
fontName=Trebuchet MS
textSize=8
colorText=00FF00FF

[measurePlayer]
Measure=NowPlaying
PlayerName=WMP
PlayerPath=C:\Program Files (x86)\Windows Media Player\wmplayer.exe
PlayerType=TITLE
DisableLeadingZero=1
Substitute="":"MUSIC"

[measurePlayPauseKey]
Measure=Plugin
Plugin=HotKey
HotKey=a
KeyUpAction=[!Log "key was pressed"][!CommandMeasure "measurePlayer" "PlayPause"]
ShowAllKeys=0

[styleTitle]
StringAlign=Center
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1
SolidColor=00000001

[styleText]
StringAlign=Left
StringCase=None
StringStyle=Bold
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1
SolidColor=00000001

[meterTitle]
Meter=String
MeterStyle=styleTitle
MeasureName=measurePlayer
X=100
Y=12
W=190
H=18
Text=%1

[meterPlayPause]
Meter=String
MeterStyle=styleText
StringAlign=Center
X=100
Y=20r
W=40
H=30
Text=[play]
LeftMouseUpAction=[!CommandMeasure "measurePlayer" "PlayPause"]
SolidColor=00000001
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter NowPlaying measure

Post by balala »

qwerty user wrote: November 12th, 2021, 7:03 am Hello, I have a problem with a Rainmeter bang not executing.
It seems there is a bug with the HotKey plugin: some of the controls done with the !CommandMeasure bang are working through the plugin and others are looking not to work. The PlayPause, along with Play, Pause, Stop or SetPosition are not working, while for instance ClosePlayer or OpenPlayer are working well. I suppose the developer of the HotKey plugin (Brian, if I'm not mistaken) should take a look (unless this is a known bug - but I'm not sure if it is). Suggest you to post a description of the issue into the HotKey Plugin topic. However I didn't try out other players, besides WMP.
qwerty user
Posts: 4
Joined: November 12th, 2021, 4:04 am

Re: Rainmeter NowPlaying measure

Post by qwerty user »

If the !log command runs whenever I press "a", then wouldn't the !CommandMeasure command run too? I can get it to open the media player when I press "a". If the command is successfully being called whenever I press "a", wouldn't it be a problem with the NowPlaying measure? Sorry if I'm missing something about how plugins work.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Rainmeter NowPlaying measure

Post by balala »

qwerty user wrote: November 12th, 2021, 9:02 pm If the !log command runs whenever I press "a", then wouldn't the !CommandMeasure command run too? I can get it to open the media player when I press "a". If the command is successfully being called whenever I press "a", wouldn't it be a problem with the NowPlaying measure? Sorry if I'm missing something about how plugins work.
Unfortunately I can't tell exactly where the problem resides, however I suspect there definitely is a problem somewhere. Post a description either on the HotKey plugin topic, or on Bugs & Feature Suggestions section.