NowPlaying returns wrong State value
Posted: October 28th, 2017, 12:11 am
Hello. I am using latest Rainmeter (r2947) and iTunes 12.6.2. Here is my simple music player script:
According to documentation (https://docs.rainmeter.net/manual/plugins/nowplaying/), State value equals to 0 when music is stopped, 1 - playing, 2 - paused. So what I am doing is checking it in order to change "play" icon to "pause" and vice versa. But if you pause a song from iTunes itself and then click on previous/next button you'll encounter unwanted behaviour:
As you see, state value switches to 1, while song is paused (stopped?) and this breaks the logic of my script. Is it a bug of NowPlaying.dll? Please help me in finding another way of checking player state.
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
[MeasurePlayer]
Measure=Plugin
Plugin=NowPlaying
PlayerName=iTunes
PlayerType=State
[MeterPlaying]
Measure=Calc
Formula=MeasurePlayer = 1 ? 1 : 0
IfEqualValue=0
IfEqualAction=[!ShowMeter MeterButtonPlay][!HideMeter MeterButtonPause]
IfAboveValue=0
IfAboveAction=[!HideMeter MeterButtonPlay][!ShowMeter MeterButtonPause]
[MeterButtonBack]
Meter=Image
ImageName=#@#back.png
X=10
Y=10
W=20
H=20
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "Previous"][!CommandMeasure "MeasurePlayer" "Play"]
[MeterButtonPlay]
Meter=Image
ImageName=#@#play.png
X=40
Y=10
W=20
H=20
LeftMouseDownAction=[!HideMeter MeterButtonPlay][!ShowMeter MeterButtonPause][!CommandMeasure "MeasurePlayer" "Play"][!Update]
[MeterButtonPause]
Meter=Image
ImageName=#@#pause.png
X=40
Y=10
W=20
H=20
LeftMouseDownAction=[!HideMeter MeterButtonPause][!ShowMeter MeterButtonPlay][!CommandMeasure "MeasurePlayer" "Pause"][!Update]
Hidden=1
[MeterButtonNext]
Meter=Image
ImageName=#@#next.png
X=70
Y=10
W=20
H=20
LeftMouseDownAction=[!CommandMeasure "MeasurePlayer" "Next"][!CommandMeasure "MeasurePlayer" "Play"]