It is currently May 27th, 2020, 3:48 am

Action Timer stopping animation after turning off the display

Help with creating, editing & fixing problems with skins
User avatar
Yincognito
Posts: 1639
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Action Timer stopping animation after turning off the display

Post by Yincognito »

jsmorley wrote:
February 17th, 2020, 5:46 pm
I really don't know. Mine has been running for going on 2 hours now without any issue.

I have hardware acceleration turned on, but hopefully that isn't the issue, since you can't distribute a skin that depends on that.
I decided to take another shot at the ActionTimer issue today, and this appears to run without problems, it's been more than an hour working as expected:

Code: Select all

[Variables]
ContainerWidth=136
TextWidth=0
ScrollingStep=10
SlidingStep=1
CurrentStep=(#SlidingStep#)
SlidingUpdate=25
Text="Wed, 00 May 2020   ●   ‒000 °C   ●   Showers Early / Clearing Late"
SlidingWidth=0
Counter=0

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

---Measures---

[MeasureSlidingWidth]
Group=ActionTimerGroup
Measure=Calc
Formula=(Round((#ContainerWidth#+#TextWidth#)/#CurrentStep#)+1)
UpdateDivider=-1
OnUpdateAction=[!SetVariable SlidingWidth [MeasureSlidingWidth]]
DynamicVariables=1

[MeasureActionTimer]
Group=ActionTimerGroup
Measure=Plugin
Plugin=ActionTimer
ActionList1=Repeat Slide,#SlidingUpdate#,#SlidingWidth# | Wait #SlidingUpdate# | Rerun
Slide=[!SetVariable Counter (#Counter#+#CurrentStep#)][!UpdateMeasureGroup "ActionTimerGroup"][!SetOption MeterText X (#ContainerWidth#-#Counter#)][!UpdateMeter "MeterText"][!Redraw]
Rerun=[!SetVariable Counter (0)][!SetOption MeterText X (#ContainerWidth#-#Counter#)][!UpdateMeter "MeterText"][!Redraw][!UpdateMeasureGroup "ActionTimerGroup"][!CommandMeasure MeasureActionTimer "Stop 1"][!CommandMeasure MeasureActionTimer "Execute 1"]
DynamicVariables=1

---Meters---

[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,168,13 | StrokeWidth 0.5 | Stroke Color 255,64,32 | Fill Color 32,32,32,128
UpdateDivider=-1
DynamicVariables=1

[MeterTitle]
Meter=String
ClipString=2
FontFace=Tahoma
FontSize=7
AntiAlias=1
FontWeight=700
FontColor=255,255,255,255
StringEffect=Shadow
FontEffectColor=0,0,0,255
X=2
Y=0
Text="WEA"
UpdateDivider=-1
LeftMouseUpAction=[!SetVariable Counter (0)][!SetOption MeterText X (#ContainerWidth#-#Counter#)][!UpdateMeter "MeterText"][!Redraw][!UpdateMeasureGroup "ActionTimerGroup"][!CommandMeasure MeasureActionTimer "Stop 1"][!CommandMeasure MeasureActionTimer "Execute 1"]
DynamicVariables=1

[MeterContainer]
Meter=Shape
X=31
Y=0
Shape=Rectangle 0,0,136,13 | Fill Color 0,0,0,255 | StrokeWidth 0
UpdateDivider=-1
DynamicVariables=1

[MeterText]
Meter=String
Container=MeterContainer
FontFace=Tahoma
FontSize=7
FontWeight=400
FontColor=160,255,160,255
FontEffectColor=0,0,0,255
StringEffect=Shadow
Antialias=1
ClipString=0
InlineSetting=Color | 128,255,255,255
InlinePattern="^([^●]*)   ●"
InlineSetting2=Color | 255,255,255,255
InlinePattern2="(   ●   )"
InlineSetting3=Color | 255,224,128,255
InlinePattern3="●   ([^●]*)$"
X=(#ContainerWidth#/2)
Y=0
Text=#Text#
UpdateDivider=-1
OnUpdateAction=[!SetVariable TextWidth [MeterText:W]]
DynamicVariables=1
I have no idea what was wrong when we last talked about this (small details in my approach, Rainmeter version, other stuff running, etc.), and I'll probably have to test the whole thing for longer (and in different circumstances), but I just wanted to let you know that it works (hopefully it will after I send this message, LOL).
User avatar
balala
Rainmeter Sage
Posts: 10605
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Action Timer stopping animation after turning off the display

Post by balala »

Yincognito wrote:
May 11th, 2020, 2:09 pm
I have no idea what was wrong when we last talked about this (small details in my approach, Rainmeter version, other stuff running, etc.),
Since I'm a little bit late to this party, I have to ask: which is the code you had problems with? The initial one?
User avatar
Yincognito
Posts: 1639
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Action Timer stopping animation after turning off the display

Post by Yincognito »

balala wrote:
May 11th, 2020, 3:30 pm
Since I'm a little bit late to this party, I have to ask: which is the code you had problems with? The initial one?
Yes, but also the following ones. While jsmorley managed to make it work without freezing in the meantime (or maybe didn't experience freezing at all?), I tried in vain to make this small "endless animation" run continuously. Until this last post, that is. I still have the skin running without issues on my screen, and it's probably about 5 hours of non-stop sliding by now.

P.S. Why? You think you can deduce what was wrong in my initial attempts? If so, I'd be curious to find out, as right now I'm even afraid to change the current code in order not to lose this "success", hahaha! If you don't, well, no worries - at least I have it working at the moment.

P.S.S. Even though my initial question was related to a request to help from someone else in the forum at that time, it crossed my mind to use AT in my skins as well, but after thinking a bit after finally making it work, I'm not so convinced to try this. I work with pausing the animation on mouse over, "dragging" it on mouse scrolling, resetting it, etc. and some of these "features" that I'd like to keep in my skins would be a bit problematic / harder to implement using AT. For example, you can't pause an AT measure; you can, of course, stop incrementing / decrementing the position to simulate pausing, but the Repeat component in ActionListN would still be counting, and I don't see an easy way to synchronize one with the other and make pausing the animation possible...
User avatar
balala
Rainmeter Sage
Posts: 10605
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Action Timer stopping animation after turning off the display

Post by balala »

Yincognito wrote:
May 11th, 2020, 4:11 pm
Yes, but also the following ones. While jsmorley managed to make it work without freezing in the meantime (or maybe didn't experience freezing at all?), I tried in vain to make this small "endless animation" run continuously. Until this last post, that is. I still have the skin running without issues on my screen, and it's probably about 5 hours of non-stop sliding by now.
I ran the initial code and it still runs. However didn't let it too long. But set the screen to turn off quickly (after 1 minute), to check if the skin runs well when I turn the screen on again. And the skin (and the animation) runs even after this.
User avatar
Yincognito
Posts: 1639
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Action Timer stopping animation after turning off the display

Post by Yincognito »

balala wrote:
May 11th, 2020, 5:25 pm
I ran the initial code and it still runs. However didn't let it too long. But set the screen to turn off quickly (after 1 minute), to check if the skin runs well when I turn the screen on again. And the skin (and the animation) runs even after this.
Yeah, the problem had nothing to do with the screen turning off actually. I thought it did at the beginning (hence the title of the thread), because that's when those things happened (i.e. screen automatically saving power when I took short breaks from being on the computer). In the end, the problem was that the ActionTimer animation / slide froze after several minutes, irresective if the screen was off or not.
User avatar
balala
Rainmeter Sage
Posts: 10605
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Action Timer stopping animation after turning off the display

Post by balala »

Yincognito wrote:
May 11th, 2020, 5:34 pm
Yeah, the problem had nothing to do with the screen turning off actually. I thought it did at the beginning (hence the title of the thread), because that's when those things happened (i.e. screen automatically saving power when I took short breaks from being on the computer). In the end, the problem was that the ActionTimer animation / slide froze after several minutes, irresective if the screen was off or not.
Ah, alright. In meantime I unloaded the skin. But I'm not reloading it anymore, especially that first skin / code has no importance anymore, right?
User avatar
Yincognito
Posts: 1639
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Action Timer stopping animation after turning off the display

Post by Yincognito »

balala wrote:
May 11th, 2020, 5:55 pm
Ah, alright. In meantime I unloaded the skin. But I'm not reloading it anymore, especially that first skin / code has no importance anymore, right?
Correct. Thanks for the interest though. ;-)