\/ Fixed code \/
Code: Select all
[Rainmeter]
Update=100
[Background]
Meter=IMAGE
W=500
H=100
SolidColor=0,0,0,1
;; -- Measures -- ;;
[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position
UpdateDivider=5
RegExpSubstitute=1
; Add leading zeros to the returned position (and fix Spotify returning ':NaN:NaN' when no song is loaded).
Substitute="^(\d{1}):(\d{2})$":"00:0\1:\2","^(\d{2}):(\d{2})$":"00:\1:\2","^(\d{1}):(\d{2}):(\d{2})$":"0\1:\2:\3",":NaN:NaN":"--:--:--"
[MeasureState]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=State
; If the returned state is unloaded or finished, display '--:--:--'.
IfCondition=(MeasureState = 0) || (MeasureState = 3)
IfTrueAction=[!SetOption MeterPosition Text "--:--:--"]
; If the returned state is playing or paused, display the video position.
IfCondition2=(MeasureState = 1) || (MeasureState = 2)
IfTrueAction2=[!SetOption MeterPosition Text [MeasurePosition]]
IfConditionMode=1
;; -- Meters -- ;;
[MeterPosition]
Meter=String
MeasureName=MeasurePosition
Text=%1
X=500
FontColor=255,255,255
FontFace=VCR OSD MONO
FontSize=75
StringAlign=Right
AntiAlias=1
When using WebNowPlaying's Position measure, it will output the time of the current video position as HH:MM:SS, for example:
Code: Select all
0:35
9:59
12:19
59:59
1:26:04
Code: Select all
00:00:35
00:09:59
00:12:19
00:59:59
01:26:04
If the time is 0:35 I would need to add 00:0 to the front, if the time is 1:26:04 I would need to add just 0 for example. Does anyone know how I can make this work?
WebNowPlaying Plugin: https://github.com/tjhrulz/WebNowPlaying
Code: Select all
[Rainmeter]
Update=100
[Background]
Meter=IMAGE
W=500
H=100
SolidColor=0,0,0,1
[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position
UpdateDivider=5
Substitute="0:00":"--:--:--"
[MeterPosition]
Meter=String
Text=[MeasurePosition]
X=500
FontColor=255,255,255
FontFace=Trebuchet MS
FontSize=75
StringAlign=Right
AntiAlias=1
DynamicVariables=1