[Rainmeter]
Update=500
AccurateText=1

[Metadata]
Name="WebNowPlaying Example"
Author=keifufu
Version=3.0.0
License=MIT - Copyright © 2024 keifufu

[Variables]
@IncludePlayers=#@#\Fonts\players.inc
PlayerId="active"
Scale=1.0
BgColor=30,30,46,255
BorderRadius=12
Font="icomoon"
FontColor=205,214,244,255

[MeasureScript]
Measure=Script
ScriptFile=#@#Scripts\example.lua

; Styles
[TextStyle]
FontFace=#Font#
AntiAlias=1
FontColor=#FontColor#
FontSize=(12*#Scale#)

[TabStyle]
X=(10*#Scale#)R
Y=(10*#Scale#)
LeftMouseUpAction=[!SetVariable PlayerId #CURRENTSECTION#]
DynamicVariables=1

; Measures
[MeasureStatus]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Status
PlayerId=#PlayerId#
DynamicVariables=1
IfCondition=MeasureStatus=0
IfTrueAction=[!SetVariable PlayerId "active"]

[MeasurePlayerName]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Name
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

[MeasurePlayerCount]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=PlayerCount

; Self explanatory
[MeasureTitle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Title
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; Self explanatory
[MeasureArtist]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Artist
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; Self explanatory
[MeasureAlbum]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Album
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; This will return the path to the cover art.
[MeasureAlbumArt]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Cover
PlayerId=#PlayerId#
DynamicVariables=1
DefaultPath=#@#Images\nocover.png

[MeasureCoverSrc]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=CoverSrc

; Elapsed time in hh:mm:ss or mm:s
[MeasurePosition]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Position
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; Duration in hh:mm:ss or mm:ss
[MeasureDuration]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Duration
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; Remaining time in hh:mm:ss or mm:ss
[MeasureRemaining]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Remaining
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; Percent of elapsed time, out of 100.
[MeasureProgress]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Progress
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; Volume from 1-100
[MeasureVolume]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Volume
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="":"N/A"

; The playing state
; 0 = Stopped
; 1 = Playing
; 2 = Paused
[MeasurePlayPause]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=State
PlayerId=#PlayerId#
DynamicVariables=1
Substitute="0":"Play","1":"Pause","2":"Play","3":"Replay"

; The repeat state
; 0 = Off
; 1 = Repeat One
; 2 = Repeat All
[MeasureRepeat]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Repeat
PlayerId=#PlayerId#
DynamicVariables=1
; An example of how to change and color the icon based on the repeat state
IfCondition=MeasureRepeat = 0
IfTrueAction=[!SetOption MeterRepeat ImageTint "#Color#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]
IfCondition2=MeasureRepeat = 1
IfTrueAction2=[!SetOption MeterRepeat ImageTint "#Highlight#"][!SetOption MeterRepeat ImageName "#@#Images\repeatOne.png"]
IfCondition3=MeasureRepeat = 2
IfTrueAction3=[!SetOption MeterRepeat ImageTint "#Highlight#"][!SetOption MeterRepeat ImageName "#@#Images\repeat.png"]

; The shuffle state
; 0 = Off
; 1 = On
[MeasureShuffle]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Shuffle
PlayerId=#PlayerId#
DynamicVariables=1
;A n example of how to color the shuffle icon based on the shuffle state
IfCondition=MeasureShuffle = 0
IfTrueAction=[!SetOption MeterShuffle ImageTint "#Color#"]
IfCondition2=MeasureShuffle = 1
IfTrueAction2=[!SetOption MeterShuffle ImageTint "#Highlight#"]

; 5 = Like / Positive rating
[MeasureRating]
Measure=Plugin
Plugin=WebNowPlaying
PlayerType=Rating
PlayerId=#PlayerId#
DynamicVariables=1
; An example of how to color two rating icons based on the rating
IfCondition=(MeasureRating < 3) && (MeasureRating > 0)
IfTrueAction=[!SetOption MeterThumbsUp ImageTint "#Color#"][!SetOption MeterThumbsDown ImageTint "#Highlight#"]
IfCondition2=MeasureRating > 3
IfTrueAction2=[!SetOption MeterThumbsUp ImageTint "#Highlight#"][!SetOption MeterThumbsDown ImageTint "#Color#"]
IfCondition3=(MeasureRating = 0) || (MeasureRating = 3)
IfTrueAction3=[!SetOption MeterThumbsUp ImageTint "#Color#"][!SetOption MeterThumbsDown ImageTint "#Color#"]

[FrostedGlass]
Measure=Plugin
Plugin=FrostedGlass
Type="Acrylic"
Corner="round"

[MeterCanvas]
Meter=Shape
Shape=Rectangle 0,0,(500*#Scale#),(200*#Scale#),5 | Fill Color 0,0,0,130 | StrokeWidth 0

[active]
Meter=String
MeterStyle=TextStyle | TabStyle
Text="Active"
X=(10*#Scale#)
[0]
Meter=String
MeterStyle=TextStyle | TabStyle
[1]
Meter=String
MeterStyle=TextStyle | TabStyle
[2]
Meter=String
MeterStyle=TextStyle | TabStyle
[3]
Meter=String
MeterStyle=TextStyle | TabStyle
[4]
Meter=String
MeterStyle=TextStyle | TabStyle
[5]
Meter=String
MeterStyle=TextStyle | TabStyle
[6]
Meter=String
MeterStyle=TextStyle | TabStyle
[7]
Meter=String
MeterStyle=TextStyle | TabStyle
[8]
Meter=String
MeterStyle=TextStyle | TabStyle
[9]
Meter=String
MeterStyle=TextStyle | TabStyle
[10]
Meter=String
MeterStyle=TextStyle | TabStyle
; TODO: until 63

[MeterPlayerCount]
Meter=String
MeasureName=MeasurePlayerCount
X=10
Y=30R
MeterStyle=TextStyle

[PreviousPlayer]
Meter=String
Text="Previous"
X=10
Y=30R
MeterStyle=TextStyle
LeftMouseDownAction=[!SetVariable PlayerId [&MeasureStatus:GetPreviousPlayerId('#PlayerId#')]]
DynamicVariables=1

[NextPlayer]
Meter=String
Text="Next"
X=100
Y=10R
MeterStyle=TextStyle
LeftMouseDownAction=[!SetVariable PlayerId [&MeasureStatus:GetNextPlayerId('#PlayerId#')]]
DynamicVariables=1

; TODO: add more tabs, see how many i can reasonably fit

; [MeterAlbumArt]
; Meter=Image
; h=250
; w=250
; MeasureName=MeasureAlbumArt
; PreserveAspectRatio=1
; ; Example of how the bangs work, in this example clicking the album art will set the song to halfway through the song, the number after SetPosition is the percent through the song you want
; LeftMouseUpAction=[!CommandMeasure MeasureArtist "SetPosition 90"]

; [MeterHeaderCurrent]
; Meter=String
; Text="Current Song:"
; y=R
; MeterStyle=TextStyle

[MeterName]
Meter=String
x=10R
y=10R
MeterStyle=TextStyle
MeasureName=MeasurePlayerName

; [MeterSongInfo]
; Meter=String
; y=R
; h=15
; w=250
; MeterStyle=TextStyle
; MeasureName=MeasureTitle
; ClipString=2

; [MeterArtistInfo]
; Meter=String
; y=R
; h=15
; w=250
; MeterStyle=TextStyle
; MeasureName=MeasureArtist
; ClipString=2

; [MeterAlbumInfo]
; Meter=String
; y=R
; h=15
; w=250
; MeterStyle=TextStyle
; MeasureName=MeasureAlbum
; ClipString=2

; [MeterPrevious]
; Meter=Image
; ImageName=#@#Images\previous.png
; ImageTint=#Color#
; X=0
; Y=R
; W=48
; H=48
; ; Goes to the previous song if possible
; LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Previous"]
; AntiAlias=1

; [MeterPlayPause]
; Meter=Image
; ImageName=#@#images\[MeasurePlayPause].png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; Toggles playing state
; LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "PlayPause"]
; DynamicVariables=1

; [MeterNext]
; Meter=Image
; ImageName=#@#Images\Next.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; Goes to the next song if possible
; LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Next"]
; AntiAlias=1

; [MeterRepeat]
; Meter=Image
; ImageTint=#Color#
; X=0
; Y=R
; W=48
; H=48
; ; Example of the repeat bang
; ; This behaves differently based on the website
; ; On some it might go off -> repeat one -> repeat all
; ; On others it might go off -> repeat one -> off
; ; This depends on what kind of repeat modes the site support and what order they're in
; LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Repeat"]
; AntiAlias=1

; [MeterShuffle]
; Meter=Image
; ImageName=#@#Images\shuffle.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; Toggles shuffle if possible
; LeftMouseUpAction=[!CommandMeasure MeasurePlayPause "Shuffle"]
; AntiAlias=1

; [MeterThumbsUp]
; Meter=Image
; ImageName=#@#Images\thumbsUp.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; Toggles like/positive rating if possible
; LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "ToggleThumbsUp"]
; AntiAlias=1

; [MeterThumbsDown]
; Meter=Image
; ImageName=#@#Images\thumbsDown.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; Toggles dislike/negative rating if possible
; LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "ToggleThumbsDown"]
; AntiAlias=1

; [MeterVolumeDown]
; Meter=Image
; ImageName=#@#Images\VolumeDown.png
; ImageTint=#Color#
; X=0
; Y=R
; W=48
; H=48
; ; This example decreases the volume by 5%
; LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "SetVolume -5"]
; AntiAlias=1

; [MeterVolumeUp]
; Meter=Image
; ImageName=#@#Images\VolumeUp.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; This example increases the volume by 5%
; LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "SetVolume +5"]
; AntiAlias=1

; [MeterPositionBack]
; Meter=Image
; ImageName=#@#Images\seekBack.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; This example goes back 5% of the songs duration
; LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "SetPosition -5"]
; AntiAlias=1

; [MeterPositionForward]
; Meter=Image
; ImageName=#@#Images\seekForward.png
; ImageTint=#Color#
; X=R
; Y=r
; W=48
; H=48
; ; This example goes forward 5% of the songs duration
; LeftMouseDownAction=[!CommandMeasure MeasurePlayPause "SetPosition +5"]
; AntiAlias=1

; [MeterPositionInfo]
; Meter=String
; y=R
; MeterStyle=TextStyle
; MeasureName=MeasurePosition

; [MeterDurationInfo]
; Meter=String
; x=R
; y=r
; MeterStyle=TextStyle
; MeasureName=MeasureDuration

; [MeterRemainingInfo]
; Meter=String
; x=R
; y=r
; MeterStyle=TextStyle
; MeasureName=MeasureRemaining

; [MeterProgress]
; Meter=String
; y=R
; Text=%1%
; MeterStyle=TextStyle
; MeasureName=MeasureProgress

; [MeterVolume]
; Meter=String
; x=R
; y=r
; Text=%1%
; MeterStyle=TextStyle
; MeasureName=MeasureVolume