Skip to content

Commit e1f974e

Browse files
authored
Add files via upload
1 parent d46335d commit e1f974e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1905
-0
lines changed

@Resources/Fonts/Inconsolata-Bold.ttf

103 KB
Binary file not shown.
90 KB
Binary file not shown.

@Resources/Fonts/MaterialIcon.ttf

6.99 KB
Binary file not shown.

@Resources/Main.inc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[Main.Background]
2+
Meter=Shape
3+
Shape=Rectangle 0,0,#Skin.Width#,#Skin.Height#,#Body.Corner# | StrokeWidth 0 | Fill Color 0,0,0,0
4+
5+
[Main.Background.Skin]
6+
Meter=Shape
7+
Shape=Rectangle 0,0,#Skin.Width#,#Skin.Height#,#Body.Corner# | StrokeWidth 0 | Fill Color #Colour.1#,#Colour.1.Alpha#

@Resources/Main.ps1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
$Resources=$RmApi.VariableStr("@")
2+
3+
function ReturnBodyCoordinates {
4+
$X=$RMAPI.Variable("CurrentConfigX")
5+
$Y=$RMAPI.Variable("CurrentConfigY")
6+
Return "$X $Y"
7+
}
8+
9+
function ReturnStoredCoordinates {
10+
$X=$RMAPI.Variable("Body.X")
11+
$Y=$RMAPI.Variable("Body.Y")
12+
Return "$X $Y"
13+
}
14+
15+
function SetCoordinates {
16+
$Stored=ReturnStoredCoordinates
17+
$Current=ReturnBodyCoordinates
18+
If($Stored -ne $Current){
19+
$X=$RMAPI.Variable("CurrentConfigX")
20+
$Y=$RMAPI.Variable("CurrentConfigY")
21+
$RMAPI.Bang("!SetVariable Body.X `"`"`"$X`"`"`" ")
22+
$RMAPI.Bang("!SetVariable Body.Y `"`"`"$Y`"`"`" ")
23+
$RmAPI.Bang("!WriteKeyValue Variables Body.X `"`"`"$X`"`"`" `"`"`"$($Resources)variables.inc`"`"`" ")
24+
$RmAPI.Bang("!WriteKeyValue Variables Body.Y `"`"`"$Y`"`"`" `"`"`"$($Resources)variables.inc`"`"`" ")
25+
}
26+
}
27+
28+
function Update {
29+
SetCoordinates
30+
}

@Resources/ModuleList.inc

648 Bytes
Binary file not shown.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[Variables]
2+
@IncludeBatteryVariables=#@#Modules\Battery\Include\Variables.inc
3+
4+
[Module.Battery.StyleIconString]
5+
InlineSetting=Face | #Font.Icon#
6+
InlineSetting2=Size | #Font.IconS#
7+
InlineSetting3=Color | #Colour.2#,#Colour.2.Alpha#
8+
InlineSetting4=Color | 0,0,0,0
9+
InlinePattern4=Highlight
10+
InlineSetting5=CharacterSpacing | 0 | (-[#CurrentSection#:h]*0.75)
11+
InlinePattern5=Highlight
12+
StringAlign=CenterCenter
13+
Prefix=Highlight
14+
AntiAlias=1
15+
DynamicVariables=1
16+
17+
[Module.Battery.StyleInfoString]
18+
InlineSetting=Face | #Font.Display#
19+
InlineSetting2=Size | #Font.DisplayS#
20+
InlineSetting3=Color | #Colour.2#,#Colour.2.Alpha#
21+
StringAlign=CenterCenter
22+
AntiAlias=1
23+
DynamicVariables=1
24+
25+
[Module.Battery.BatteryPercentage]
26+
Measure=Plugin
27+
Plugin=PowerPlugin
28+
PowerState=Percent
29+
UpdateDivider=(5000/#UpdateInterval#)
30+
RegExpSubstitute=1
31+
Substitute="^(\d{1,3})$":"\1"
32+
OnChangeAction=[!UpdateMeterGroup Module.Battery.Display][!Redraw]
33+
34+
[Module.Battery.Container]
35+
Meter=Image
36+
x=(#Module.Battery.P#-(#Module.Battery.A#*0.5)*#Module.Battery.W#)
37+
y=((#Body.Height#-#Body.Element#)/2)
38+
w=#Module.Battery.W#
39+
h=#Body.Element#
40+
SolidColor=0,0,0
41+
DynamicVariables=1
42+
LeftMouseUpAction=[!CommandMeasure Main.PSRM "Update"][!WriteKeyValue Variables Parent.Position "([#CurrentSection#:x]+[#CurrentSection#:w]/2)" "#RootConfigPath#\PopUp\Battery_PopUp.ini"][!ActivateConfig "#ROOTCONFIG#\PopUp" "Battery_PopUp.ini"]
43+
44+
[module.Battery.BatteryIcon]
45+
MeterStyle=module.Battery.StyleIconString
46+
Meter=String
47+
x=(#Body.Element#*0.5)
48+
y=(#Body.Element#*0.5)
49+
Text=Battery
50+
Container=Module.Battery.Container
51+
; LeftMouseUpAction=[]
52+
; MouseOverAction=[!SetOption "#CurrentSection#" "InlineSetting4" "Color | #*Colour.2*#,(#*Colour.2.Alpha*#*0.5)"][!UpdateMeter "#CurrentSection#"]
53+
; MouseLeaveAction=[!SetOption "#CurrentSection#" "InlineSetting4" "Color | 0,0,0,0"][!UpdateMeter "#CurrentSection#"]
54+
55+
[Module.Battery.PercentageDisplay]
56+
Group=Module.Battery.Display
57+
MeterStyle=Module.Battery.StyleInfoString
58+
Meter=String
59+
x=(#Body.Element#*1.5)
60+
y=(#Body.Element#*0.5)
61+
MeasureName=Module.Battery.BatteryPercentage
62+
Container=Module.Battery.Container
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Variables]
2+
; vargen|Battery Position|Battery|int|0:#Body.Width#
3+
Module.Battery.P=1424
4+
; vargen|Battery Anchor [0/1/2]|Battery|int|0:2
5+
Module.Battery.A=2
6+
Module.Battery.W=(2*#Body.Element#)
2.46 KB
Loading
Loading
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
[Variables]
2+
NowPlaying.PlayerName=
3+
NowPlaying.PlayerPlugin=WNP
4+
NowPlaying.MSUpdate=500
5+
; Arrange the six (6) player names [WEB,AIMP,CAD,ITUNES,WINAMP,WMP] in descending order of hierachy, higher hierachy means the algo will select it over the other ones
6+
NowPlaying.Hierachy=WEB,AIMP,CAD,ITUNES,WINAMP,WMP
7+
8+
[MSState.Web]
9+
Measure=Plugin
10+
Plugin=WebNowPlaying
11+
PlayerType=State
12+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
13+
OnChangeAction=[!CommandMeasure "MS.PSRM" "SetActivePlayer"]
14+
15+
[MSState.AIMP]
16+
Measure=NowPlaying
17+
PlayerName=AIMP
18+
PlayerType=State
19+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
20+
OnChangeAction=[!CommandMeasure "MS.PSRM" "SetActivePlayer"]
21+
22+
[MSState.CAD]
23+
Measure=NowPlaying
24+
PlayerName=CAD
25+
PlayerType=State
26+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
27+
OnChangeAction=[!CommandMeasure "MS.PSRM" "SetActivePlayer"]
28+
29+
[MSState.ITUNES]
30+
Measure=NowPlaying
31+
PlayerName=ITUNES
32+
PlayerType=State
33+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
34+
OnChangeAction=[!CommandMeasure "MS.PSRM" "SetActivePlayer"]
35+
36+
[MSState.WINAMP]
37+
Measure=NowPlaying
38+
PlayerName=WINAMP
39+
PlayerType=State
40+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
41+
OnChangeAction=[!CommandMeasure "MS.PSRM" "SetActivePlayer"]
42+
43+
[MSState.WMP]
44+
Measure=NowPlaying
45+
PlayerName=WMP
46+
PlayerType=State
47+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
48+
OnChangeAction=[!CommandMeasure "MS.PSRM" "SetActivePlayer"]
49+
50+
[MSState.Update]
51+
Measure=String
52+
OnUpdateAction=[!Delay 250][!CommandMeasure "MS.PSRM" "SetActivePlayer"][!DisableMeasure #CurrentSection#]
53+
54+
[MS.PSRM]
55+
Measure=Plugin
56+
Plugin=PowershellRM
57+
ScriptFile=#@#Modules\NowPlaying\Include\MediaSwitcher.ps1
58+
59+
[MS.NP.Title]
60+
Group=MS.Media | MS.NP
61+
Measure=NowPlaying
62+
PlayerName=#NowPlaying.PlayerName#
63+
PlayerType=Title
64+
DynamicVariables=1
65+
Disabled=1
66+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
67+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Title]
68+
69+
[MS.NP.Artist]
70+
Group=MS.Media | MS.NP
71+
Measure=NowPlaying
72+
PlayerName=[MS.NP.Title]
73+
PlayerType=Artist
74+
Disabled=1
75+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
76+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Artist]
77+
78+
[MS.NP.Album]
79+
Group=MS.Media | MS.NP
80+
Measure=NowPlaying
81+
PlayerName=[MS.NP.Title]
82+
PlayerType=Album
83+
Disabled=1
84+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
85+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Album]
86+
87+
[MS.NP.Cover]
88+
Group=MS.Media | MS.NP
89+
Measure=NowPlaying
90+
PlayerName=[MS.NP.Title]
91+
PlayerType=Cover
92+
Disabled=1
93+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
94+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Cover]
95+
96+
[MS.NP.Progress]
97+
Group=MS.Media | MS.NP
98+
Measure=NowPlaying
99+
PlayerName=[MS.NP.Title]
100+
PlayerType=Progress
101+
Disabled=1
102+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
103+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Progress]
104+
105+
[MS.NP.Position]
106+
Group=MS.Media | MS.NP
107+
Measure=NowPlaying
108+
PlayerName=[MS.NP.Title]
109+
PlayerType=Position
110+
Disabled=1
111+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
112+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Position]
113+
114+
[MS.NP.Duration]
115+
Group=MS.Media | MS.NP
116+
Measure=NowPlaying
117+
PlayerName=[MS.NP.Title]
118+
PlayerType=Duration
119+
Disabled=1
120+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
121+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Duration]
122+
123+
[MS.NP.Status]
124+
Group=MS.Media | MS.NP
125+
Measure=NowPlaying
126+
PlayerName=[MS.NP.Title]
127+
PlayerType=Status
128+
Disabled=1
129+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
130+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Status]
131+
132+
[MS.NP.State]
133+
Group=MS.Media | MS.NP
134+
Measure=NowPlaying
135+
PlayerName=[MS.NP.Title]
136+
PlayerType=State
137+
Disabled=1
138+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
139+
OnChangeAction=[!UpdateMeasureGroup MS.NP.State]
140+
141+
[MS.WNP.Title]
142+
Group=MS.Media | MS.WNP
143+
Measure=Plugin
144+
Plugin=WebNowPlaying
145+
PlayerType=Title
146+
DynamicVariables=1
147+
Disabled=1
148+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
149+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Title]
150+
151+
[MS.WNP.Artist]
152+
Group=MS.Media | MS.WNP
153+
Measure=Plugin
154+
Plugin=WebNowPlaying
155+
PlayerType=Artist
156+
DynamicVariables=1
157+
Disabled=1
158+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
159+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Artist]
160+
161+
[MS.WNP.Album]
162+
Group=MS.Media | MS.WNP
163+
Measure=Plugin
164+
Plugin=WebNowPlaying
165+
PlayerType=Album
166+
DynamicVariables=1
167+
Disabled=1
168+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
169+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Album]
170+
171+
[MS.WNP.Cover]
172+
Group=MS.Media | MS.WNP
173+
Measure=Plugin
174+
Plugin=WebNowPlaying
175+
PlayerType=Cover
176+
DynamicVariables=1
177+
Disabled=1
178+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
179+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Cover]
180+
181+
[MS.WNP.Progress]
182+
Group=MS.Media | MS.WNP
183+
Measure=Plugin
184+
Plugin=WebNowPlaying
185+
PlayerType=Progress
186+
DynamicVariables=1
187+
Disabled=1
188+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
189+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Progress]
190+
191+
[MS.WNP.Position]
192+
Group=MS.Media | MS.WNP
193+
Measure=Plugin
194+
Plugin=WebNowPlaying
195+
PlayerType=Position
196+
DynamicVariables=1
197+
Disabled=1
198+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
199+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Position]
200+
201+
[MS.WNP.Duration]
202+
Group=MS.Media | MS.WNP
203+
Measure=Plugin
204+
Plugin=WebNowPlaying
205+
PlayerType=Duration
206+
DynamicVariables=1
207+
Disabled=1
208+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
209+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Duration]
210+
211+
[MS.WNP.Status]
212+
Group=MS.Media | MS.WNP
213+
Measure=Plugin
214+
Plugin=WebNowPlaying
215+
PlayerType=Status
216+
DynamicVariables=1
217+
Disabled=1
218+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
219+
OnChangeAction=[!UpdateMeasureGroup MS.NP.Status]
220+
221+
[MS.WNP.State]
222+
Group=MS.Media | MS.WNP
223+
Measure=Plugin
224+
Plugin=WebNowPlaying
225+
PlayerType=State
226+
DynamicVariables=1
227+
Disabled=1
228+
UpdateDivider=(#NowPlaying.MSUpdate#/#UpdateInterval#)
229+
OnChangeAction=[!UpdateMeasureGroup MS.NP.State]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
function SetPlayerHierachy {
2+
$Reference=@("WEB", "AIMP", "CAD", "ITUNES", "WINAMP", "WMP") # Given a reference list $Reference,
3+
$Hierachy=$RMAPI.VariableStr("NowPlaying.Hierachy","$Reference -join ','") -split "," # a user-defined list $Hierachy is retrieved
4+
if(@(Compare-Object $Reference $Hierachy).count -eq 0){ # If the user-defined list is valid, i.e. contains all the elements of the reference list
5+
$Global:PlayerList=$Hierachy # Then use this order of hierachy
6+
}
7+
else{
8+
$Global:PlayerList=$Reference # Otherwise use the reference hierachy
9+
}
10+
}
11+
12+
function ReturnActivePlayer {
13+
$PlayerList=$Global:PlayerList # Given the set hierachy
14+
For($i=0; $i -lt $PlayerList.length; $i++){ # Choose the one that is hghest in hierachy and is currently playing media
15+
If($($RMAPI.Measure("MSState."+$PlayerList[$i])) -eq 1){
16+
Return $PlayerList[$i]
17+
}
18+
}
19+
For($i=0; $i -lt $PlayerList.length; $i++){ # Otherwise choose the one that is highest in hierachy and is currently paused
20+
If($($RMAPI.Measure("MSState."+$PlayerList[$i])) -eq 2){
21+
Return $PlayerList[$i]
22+
}
23+
}
24+
Return "" # Otherwise return "no player avaliable"
25+
}
26+
27+
function SetActivePlayer {
28+
$ActivePlayer=ReturnActivePlayer # Given the currently active player
29+
$CurrentPlayer=$RMAPI.Variable("NowPlaying.PlayerName") # Given the skin's current player
30+
If($ActivePlayer -ne $CurrentPlayer){ # If they are different, switch to the currently active player, otherwise do nothing (This function fires whenever any player has a state change so it can fire even when the player does not change)
31+
$RMAPI.Bang("!SetVariable `"`"`"NowPlaying.PlayerName`"`"`" `"`"`"$ActivePlayer`"`"`" ")
32+
33+
switch($ActivePlayer) {
34+
$Null {
35+
$RMAPI.Bang("!SetVariable `"`"`"NowPlaying.PlayerPlugin`"`"`" `"`"`"NP`"`"`" ")
36+
$RMAPI.Bang("!DisableMeasureGroup `"`"`"MS.NP`"`"`" ")
37+
$RMAPI.Bang("!DisableMeasureGroup `"`"`"MS.WNP`"`"`" ")
38+
}
39+
"WEB" {
40+
$RMAPI.Bang("!SetVariable `"`"`"NowPlaying.PlayerPlugin`"`"`" `"`"`"WNP`"`"`" ")
41+
$RMAPI.Bang("!DisableMeasureGroup `"`"`"MS.NP`"`"`" ")
42+
$RMAPI.Bang("!EnableMeasureGroup `"`"`"MS.WNP`"`"`" ")
43+
}
44+
default {
45+
$RMAPI.Bang("!SetVariable `"`"`"NowPlaying.PlayerPlugin`"`"`" `"`"`"NP`"`"`" ")
46+
$RMAPI.Bang("!DisableMeasureGroup `"`"`"MS.WNP`"`"`" ")
47+
$RMAPI.Bang("!EnableMeasureGroup `"`"`"MS.NP`"`"`" ")
48+
}
49+
}
50+
$RMAPI.Bang("!UpdateMeasureGroup `"`"`"MS.Media`"`"`" ")
51+
}
52+
}
53+
54+
# Initalise
55+
SetPlayerHierachy

0 commit comments

Comments
 (0)