New Nexus feature - Skin timers
#1
@enen92 
Only wanted to thank you for your work in this new Nexus feature. I haven't had the chance to use it yet, but from your description I really think that Skin Timers have a lot of potential for using it in skins. Much appreciated, thanks!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#2
907 lines of code added just to be able to close a window properly in estuary (the video osd) Smile
You're welcome, let me know if you find any issue related to the functionality (or something missing).
Reply
#3
(2022-05-25, 15:24)enen92 Wrote: 907 lines of code added just to be able to close a window properly in estuary (the video osd) Smile
Most people can’t grasp the amount of work involved in creating something for Kodi. And most of those that do know about it fail to show any gratitude, it’s the same old story… Don’t worry, your hard work will do much more good than just closing a simple window, I’m completely sure… ;-)

Thanks again!
If I have helped you or increased your knowledge, please click the 'thumbs up' button to give thanks :)
Reply
#4
The new Skin.SetNumeric() also saves so much hassle in creating a numerical skin setting such as you've used to specificy the videoosd autoclose time for the timer.
Reply
#5
@enen92 I'm trying to wrap my head around on the details of the new Estuary autoclosevideoosd timer. I'll ask here since it may help other people understand the use of timers better.

So the code is

xml:
<timer>
<name>autoclosevideoosd</name>
<description>Timer to auto close the video OSD (if enabled in the skin settings)</description>
<start reset="true">Window.IsActive(videoosd) + Skin.HasSetting(OSDAutoClose)</start>
<reset>Window.IsActive(videoosd) + !System.IdleTime(1) + Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd), 1)</reset>
<stop>!Window.IsActive(videoosd) | String.IsEmpty(Skin.String(OSDAutoCloseTime)) + Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd), 4) | !String.IsEmpty(Skin.String(OSDAutoCloseTime)) + Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd),Skin.Numeric(OSDAutoCloseTime))</stop>
<onstop>Dialog.Close(videoosd)</onstop>
</timer>

Start is clear, so start timer if autoclose setting is enabled and videoosd is opened.

It's the purpose of the reset and that has me stratching my head a bit. The reset seems to be true if videoosd is open, no input for 1 sec and if timer is 1 sec or more, so does this mean if no input timer is reset to 0 every 1 sec Huh

But if you reset every 1 sec how does it ever reach the stop condition of elapsed of 4 sec by default, or user specified elapsed time.
Reply
#6
Timers are evaluated on a 500msec interval and the respective conditions only take effect if the previous state is not the one in which the timer already is: for instance you won't start a timer all the time if the condition is true...if the timer already is running.

The reset tag is a condition that will reset the timer back to 0 seconds without going via stop and start.

!System.IdleTime(1) means -> the system is NOT idle for more than 1 second == the user has NOT provided input (keystroke, menu navigation, etc) in the last second. The last condition guards against the verification in the last second [Integer.IsGreaterOrEqual(Skin.TimerElapsedSecs(autoclosevideoosd), 1)] because when you open the OSD you provide input, so the system is for sure not idle in the last second Smile. So the reset condition is valid for the lifetime of the timer except on the first second.

So, if the system is idle for more than 1 second (counting from second 2 since you open the video OSD) the timer will be continue running until the stop condition is verified
Reply
#7
Oops I somehow missed the ! in front of System.IdleTime(1)
Reply

Logout Mark Read Team Forum Stats Members Help
New Nexus feature - Skin timers0