It is currently September 29th, 2022, 6:36 pm

Mediaplayer state buttons not changing

Get help with creating, editing & fixing problems with skins
User avatar
Shevaara
Posts: 2
Joined: September 14th, 2022, 11:52 am

Mediaplayer state buttons not changing

Post by Shevaara »

Greetings,
times ago I started a custom skin, all nice and cool but the buttons on the media player.

Everything is working fine, but play.png and pause.png are not changing correctly
I know it may be a stupid error, thanks in advance

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Author= Shevaara
Version=1.0
Information= Follow me at https://twitter.com/Shevaara_art
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

[Variables]


[TextStyle]
FontFace=fleshandblood
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
StringEffect=SHADOW

[MeterBackground]
Meter=Image
ImageName=#@#style1.png
W=390
H=122
x=0
y=0


[MeasurePlayer]
Measure=NowPlaying
; ======== Modify your player name here. Options are Spotify, iTunes, AIMP, MediaMonkey, Winamp, WMP.
PlayerName=Spotify

[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Artist

[MeasureTitle]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Title

[MeasurePlayerState]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=STATE
Substitute="0":"#@#play.png","1":"#@#pause.png","2":"#@#play.png"

[MeterListeningTo]
Meter=String
MeterStyle=TextStyle
Fontsize=16
X=130
Y=7
Text="You're listening to"

[MeterTitle]
Meter=String
MeasureName=MeasureTitle
Stringalign=center
X=230
Y=45
W=400
H=20
MeterStyle=TextStyle
Fontsize=14
Text=%1

[MeterArtist]
Meter=String
MeasureName=MeasureArtist
Stringalign=center
X=230
Y=75*
W=400
H=20
MeterStyle=TextStyle
Fontsize=14
Text=%1

[MeterPrev]
Meter=Image
SolidColor=0,0,0,1
Imagename=#@#prev.png
H=20
X=140
Y=120
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Previous"]


[PlayPause]
Meter=Image
SolidColor=0,0,0,1
ImageName=[MeasurePlayerState]
H=20
X=80r
Y=r
LeftMouseDownAction=!CommandMeasure "MeasurePlayer" "PlayPause"
DynamicVariables=1


[MeterNext]
Meter=Image
SolidColor=0,0,0,1
Imagename=#@#next.png
H=20
X=80r
Y=r
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Next"]
User avatar
balala
Rainmeter Sage
Posts: 14566
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mediaplayer state buttons not changing

Post by balala »

Shevaara wrote: September 14th, 2022, 1:25 pm Everything is working fine, but play.png and pause.png are not changing correctly
I know it may be a stupid error, thanks in advance
No, there is no stupid error.
Unfortunately, the NowPlaying measures don't return the state of Spotify player. Spotify is just a partially supported player and as such, the measures can get only the Title and Artist, the other PlayerType options are not supported. As such, the [MeasurePlayerState] measure is always returning 0, which is replaced by the play.png image and this is the image shown up by the [PlayPause] meter. It never will be changing, unless you'll use a plugin which supports Spotify. Since me personally am not using Spotify, am not exactly sure, but know there were even more such plugins out there, but some of them have not been maintained by the author.
So, someone else, who is using Spotify will be needed here for further help.
Just to see I am right, you can try the code is working by using a fully supported player. If you don't have any, you most probably have at least Windows Media Player installed. Recommend giving it a try (by changing the PlayerName option of the [MeasurePlayer] to PlayerName=WMP, or the appropriate name), to see there is no mistake in your code.
User avatar
Shevaara
Posts: 2
Joined: September 14th, 2022, 11:52 am

Re: Mediaplayer state buttons not changing

Post by Shevaara »

balala wrote: September 14th, 2022, 3:48 pm No, there is no stupid error.
Unfortunately, the NowPlaying measures don't return the state of Spotify player. Spotify is just a partially supported player and as such, the measures can get only the Title and Artist, the other PlayerType options are not supported.
oh, I see. Since the partially supported sais
the bangs Play, PlayPause, Stop, Next, and Previous are available.
I thought it was enough for the button to change.
Thank you!
User avatar
balala
Rainmeter Sage
Posts: 14566
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Mediaplayer state buttons not changing

Post by balala »

Shevaara wrote: September 14th, 2022, 6:29 pm I thought it was enough for the button to change.
No, unfortunately it's not.
Anyone who is using Spotify on his computer is expected for further help. I can't help anymore here. Sorry...