Firstly, I had wanted to make a sort of a button to play the song on Spotify. below is the original code used to make that button.
Code: Select all
[MeasureNowPlaying]
Measure=NowPlaying
PlayerName=Spotify
PlayerType=Title
;--- other meters ---
[MeterPlay]
Meter=Image
Hidden=1
SolidColor=0,0,0,1
DynamicVariables=1
ImageName=#@#play.png
ImageAlpha=100
PreserveAspectRatio=1
W=20
X=130
Y=85
MouseOverAction=[!SetOption "MeterPlay" ImageAlpha "200"]
MouseLeaveAction=[!SetOption "MeterPlay" ImageAlpha "100"]
LeftMouseUpAction=[!CommandMeasure "MeasureNowPlaying" "Play"]
Since this happened, what I did next was that I decided I could do with one button that played if pressed when the song was paused (and vice versa). I modified my code a bit so that the image for the button itself would change. However, what happened next was the image for the button which was supposed to change depending on the state of the player did not change regardless as to whether the song was played or paused. I thought maybe this had to do with the state not updating, so I included the state inside one of my meters (the "NPHead"), and turns out the state actually doesn't get updated. below is my code used to do that
Code: Select all
[Rainmeter]
Update=16
[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,300,115 | Fill Color 255,255,255,0 | Stroke Color 255,255,255,0
SolidColor=0,0,0,1
MouseOverAction=[!SetOption "MeterNPLine" Shape "Rectangle ([MeterNPHead:X]+90), 10, 2, 105 | Fill Color 255,255,255,100 | Stroke Color 255,255,255,150"][!UpdateMeter "MeterNPLine"][!ShowMeter MeterPlay][!Redraw]
MouseLeaveAction=[!SetOption "MeterNPLine" Shape "Rectangle ([MeterNPHead:X]+90), 10, 2, 75 | Fill Color 255,255,255,100 | Stroke Color 255,255,255,150"][!UpdateMeter "MeterNPLine"][!HideMeter MeterPlay][!Redraw]
[MeasureNowPlaying]
Measure=NowPlaying
PlayerName=Spotify
PlayerType=Title
[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasureNowPlaying]
PlayerType=Artist
[MeasureState]
Measure=NowPlaying
PlayerName=[MeasureNowPlaying]
PlayerType=State
IfCondition=(MeasureState=1)
IfTrueAction=[!SetOption "MeterPlay" "ImageName" "#@#pause.png"][!UpdateMeter "MeterPlay"][!Redraw]
IfFalseAction=[!SetOption "MeterPlay" "ImageName" "#@#play.png"][!UpdateMeter "MeterPlay"][!Redraw]
[MeterNPHead]
Meter=String
Text=Now#CRLF#Playing#CRLF#[MeasureState]
StringCase=lower
FontColor=255,255,255,150
FontFace=Montserrat Medium
AntiAlias=1
FontSize=14
DynamicVariables=1
SolidColor=0,0,0,1
Y=20
[MeterNPLine]
Meter=Shape
DynamicVariables=1
Shape=Rectangle ([MeterNPHead:X]+90), 10, 2, 75 | Fill Color 255,255,255,100 | Stroke Color 255,255,255,150
SolidColor=0,0,0,1
[MeterNPName]
Meter=String
MeasureName=MeasureNowPlaying
FontColor=255,255,255,150
ClipString=1
W=170
H=40
FontFace=Montserrat Medium
AntiAlias=1
FontSize=20
DynamicVariables=1
X=100
Y=10
SolidColor=0,0,0,1
[MeterNPArtist]
Meter=String
Text=by [MeasureArtist]
ClipString=1
W=170
H=20
FontColor=255,255,255,150
FontFace=Montserrat Medium
AntiAlias=1
FontSize=11
DynamicVariables=1
X=105
Y=55
SolidColor=0,0,0,1
[MeterPlay]
Meter=Image
Hidden=1
SolidColor=0,0,0,1
DynamicVariables=1
ImageName=#@#play.png
ImageAlpha=100
PreserveAspectRatio=1
W=20
X=130
Y=85
MouseOverAction=[!SetOption "MeterPlay" ImageAlpha "200"]
MouseLeaveAction=[!SetOption "MeterPlay" ImageAlpha "100"]
LeftMouseUpAction=[!CommandMeasure "MeasureNowPlaying" "PlayPause"]
Any help would be appreciated!
(sorry for the messy code btw, no idea how to make it into code block)
Thanks in advance