It is currently April 25th, 2024, 10:12 am

Help with now playing state on player

Get help with creating, editing & fixing problems with skins
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Help with now playing state on player

Post by CyberTheWorm »

Yincognito wrote: June 26th, 2020, 4:07 pm So [MeasureState] works as expected, changing its value correctly? You may want to post which version of Spotify you tested this with, maybe it has some relevance.
1.1.35.458.g891674f3 (Microsoft Store version)
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Help with now playing state on player

Post by Yincognito »

Ok, this is an attempt to make the Dark.ini part of the skin to visually react to the player state changes, irrespective if they come from the skin or the player. I corrected some things that produced errors in the log, I left some things as they were, but overall it does it's job in the case of Winamp. Not sure if it'll work with Spotify, it will have to be tested against it. This can be of course "ported" to Lite.ini if desired, as I assume it's just a matter of different colors or icons. Be aware that the string value of [MeasureState] is inverted (i.e. will produce 'Pause' when playing and 'Play' when paused or stopped), to avoid creating another measure to do that for use within the bangs. The number value is the actual "true" state of the player:

Code: Select all

[Rainmeter]
Author=Jlynn @ WWW.neon-ink.TK
Update=500
Group=ConfigMazio

[Metadata]
Name=Mazio
Version=1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=http://jlynnxx.deviantart.com or http://neon-ink.tk

[Variables]
@Include=#ROOTCONFIGPATH#@Resources\Variables.inc

[Background01]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\12.png
SolidColor=0,0,0,0
X=0
Y=0
W=204
H=204

[ProgressBar]
MeasureName=MeasureProgress
Meter=ROUNDLINE
LineWidth=10
LineLength=86
Solid=1
StartAngle=4.712
RotationAngle=6.283
LineColor=#Color1#
AntiAlias=1
X=14
Y=14
H=166
W=166

[Background02]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\13.png
SolidColor=0,0,0,0
X=0
Y=0
W=190
H=190

[Background03]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\14.png
SolidColor=0,0,0,0
X=12
Y=13
W=166
H=166

[MeasurePlayer]
Measure=NowPlaying
PlayerName=#Player#
PlayerType=File

[MeasureProgress]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Progress
MaxValue=100

[MeasureTitle]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Title
Substitute="":"N\A"

[MeasureArtist]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=Artist
Substitute="":"N\A"

[MeasureState]
Measure=NowPlaying
PlayerName=[MeasurePlayer]
PlayerType=State
RegExpSubstitute=1
Substitute="^2$":"Play","^1$":"Pause","(?:^$|^0$)":"Play"
OnChangeAction=[!HideMeterGroup "StateGroup"] [!ShowMeter "[MeasureState]"] [!ShowMeter "[MeasureState]2"]
DynamicVariables=1

[SongTitle]
Meter=STRING
MeasureName=MeasureTitle
SolidColor=0,0,0,0
FontSize=10
StringAlign=Center
StringStyle=Bold
FontColor=0,0,0,230
FontFace=Segoe UI
AntiAlias=1
ClipString=1
X=95
Y=102
W=140
H=20

[Artist]
Meter=STRING
MeasureName=MeasureArtist
SolidColor=0,0,0,0
FontSize=12
StringAlign=Center
StringStyle=Normal
FontColor=0,0,0,245
FontFace=Segoe UI Light
AntiAlias=1
ClipString=1
X=95
Y=120
W=125
H=21

[Play]
Group=StateGroup
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\07.png
ImageTint=#Color1#,255
X=80
Y=50
W=33
H=35

[Play2]
Group=StateGroup
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\15.png
SolidColor=0,0,0,0
X=80
Y=50
W=33
H=35
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Play"] [!UpdateMeasure "MeasurePlayer"]

[Pause]
Group=StateGroup
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\09.png
ImageTint=#Color1#,255
Hidden=1
X=80
Y=50
W=33
H=35

[Pause2]
Group=StateGroup
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\16.png
SolidColor=0,0,0,0
Hidden=1
X=80
Y=50
W=33
H=35
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Pause"] [!UpdateMeasure "MeasurePlayer"]

[Next]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\17.png
SolidColor=0,0,0,0
X=123
Y=60
W=20
H=20
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Next"]

[Previous]
Meter=IMAGE
ImageName=#ROOTCONFIGPATH#@Resources\18.png
SolidColor=0,0,0,0
X=49
Y=60
W=20
H=20
LeftMouseUpAction=[!CommandMeasure "MeasurePlayer" "Previous"]
While I won't guarantee this will work for Spotify, based on what CyberTheWorm said, I guess there's a good chance of working. Let me know what you think of it.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth