NowPlaying returns wrong State value

Report bugs with the Rainmeter application and suggest features.

NowPlaying returns wrong State value

October 28th, 2017, 12:11 am
Xopa
   [1 posts]

Hello. I am using latest Rainmeter (r2947) and iTunes 12.6.2. Here is my simple music player script:

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"]


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:
Untitled.png

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.
User avatar

Re: NowPlaying returns wrong State value

October 28th, 2017, 4:06 am
CyberTheWorm
   [466 posts]

I do this but have an image for play and pause

Code: Select all

[MeasureState]
Measure=Plugin
Plugin=NowPlaying.dll
PlayerName=[MeasurePlayer]
PlayerType=State
Substitute="0":"#@#Images\play.png","1":"#@#Images\pause.png","2":"#@#Images\play.png"

Return to “Bugs & Feature Suggestions”



Who is online

Users browsing this forum: Bing [Bot] and 1 guest