[Rainmeter]
;the refresh rate of the skin is 20 milliseconds.
Update=20
[Variables]
;the slow down variable is here to cacht when measure is changed
vSlowDown=0
vSwitch=0
[MeasureNow]
;this measure change every second. but refreshed 20 milliseconds.
Measure=Time
;we need this because we want the possibility rewrite this part of the skin.
DynamicVariables=1
;when the measure is realy changed we set variable so we can use if condition
OnChangeAction=[!SetVariable vSlowDown 2]
;slow down is now in action. and will make it possible to set options and variables.
IfCondition=(#vSwitch# + #vSlowDown#) = 3
IfTrueAction=[!SetVariable vSlowDown 0][!SetOption MeterText Text "One"][!SetVariable vSwitch 0]
IfCondition2=(#vSwitch# + #vSlowDown#) = 2
IfTrueAction2=[!SetVariable vSlowDown 0][!SetOption MeterText Text "Two"][!SetVariable vSwitch 1]
;when we are done with setting options and variables we undo the slowdown part and is back waiting agian for real changes.
[MeterBackground]
Meter=Shape
Shape=Rectangle , , 200, 100
[MeterText]
Meter=String
Text="Waiting On Change"
Slowdown Switch_v0.2.rmskin
You do not have the required permissions to view the files attached to this post.
[Rainmeter]
Update=20
[Variables]
SlowDownTimeInMilliSeconds=1000
; This should not be changed manually. If changed, must be in Range [1,3].
vSwitch=1
[Calc]
; Using Calc measure so I can change it at will.
Measure=Calc
; Every update, it switches between 0 and 1, so that we can execute OnChangeAction
Formula=(Calc=1?0:1)
; UpdateDivider is set to -1, so it's independent of skin's Update cycle.
UpdateDivider=-1
DynamicVariables=1
; Now I update the measure in an interval of milliseconds provided in the variable. It gives us an upper hand
; in comparison to Time measure. Since we can control the interval.
OnUpdateAction=[!Delay (#SlowDownTimeInMilliSeconds#)][!UpdateMeasure #CURRENTSECTION#]
; Then come the switches. Go wild.
IfCondition=(#vSwitch#=1)
IfTrueAction=[!SetOption MeterText Text "I am SwitchCase1"][!SetVariable vSwitch 2]
IfCondition2=(#vSwitch#=2)
IfTrueAction2=[!SetOption MeterText Text "I am SwitchCase2"][!SetVariable vSwitch 3]
IfCondition3=(#vSwitch#=3)
IfTrueAction3=[!SetOption MeterText Text "I am SwitchCase3"][!SetVariable vSwitch 1]
[MeterText]
Meter=String
Text=I am SwitchOutput
SolidColor=255,255,255
sl23 wrote: ↑September 4th, 2021, 5:54 pm
What does it do? A description would be useful
in this case i used the timer plugin. in real situation i used the nowplaying plugin and the webnowplaying plugin.
when the cover changed i need to know if spotify is selected or one of the others like winamp or media player.
the cover picture is send to my exe file. and that is heave duty cause i see my mouse changing in the waiting icon every second.
so i build this to realease the presure and only being used when the picture is realy changing.
if spotify is selected send the spotify cover. and if not then send the winamp (nowplaying) cover.
so i used the timer plugin so you can test it right away. without having to install other files or things.
i set the update rate on 20. just to see that it is only doing something heavy when there is something realy changed.
death.crafter wrote: ↑September 5th, 2021, 3:13 am
I think a more feasible solution would be:
Okay, I was wrong. !Delay bangs persist even after Skin is refreshed. So the !UpdateMeasure bang before Refresh is executed post refresh, breaking the update cycle.
death.crafter wrote: ↑September 5th, 2021, 2:31 pm
Okay, I was wrong. !Delay bangs persist even after Skin is refreshed. So the !UpdateMeasure bang before Refresh is executed post refresh, breaking the update cycle.