|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
||||
|
||||
Panel that updates every N seconds
There are quite a few ways to do this in studio. IS there a preferred / recommended way?
I like the simplicity of using the Animation attribute (0, seconds, 0) to set this up, but I don't want to use something that will eventually be phased out.... btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#2
|
|||
|
|||
Can't say I've ever seen the Animation attribute way of doing it.... sounds pretty interesting.
Anyway, I always prefered using a Hook with Fork() Wait(100) RefreshArea("Panel").... pretty much the same way Sage does it when media is playing e.g with music and you get the play length shown.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#3
|
|||
|
|||
Yup a fork and refresh is the best way. Just as long as you make sure you are checking a variable and killing the fork(thread) when it is no longer needed and not leaving it going.
|
#4
|
||||
|
||||
Do you usually put the Fork in the after menu load hook?
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#5
|
|||
|
|||
Depends on how many times you want to refresh the panel in question, if the panel is always visable etc. Also if you dont Fork it and you add a Wait it will cause screen delay if your wanting to refresh that panel multiple times.
EDIT I think I missunderstood your question.... what do you want to refresh, how soon should it be refreshed and is it always visable?
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders Last edited by jaminben; 01-11-2011 at 11:45 AM. |
#6
|
|||
|
|||
That depends on what you are wanting to do. If you are drawing the panel on load with contents and then want it to refresh after so long and continue to do so yes. Then in beforemenuunload you would change your variable to kill the fork since the panel won't be there anymore.
|
#7
|
||||
|
||||
Thanks guys - I think that covers the forking/wait approach pretty well. And yes, it's a panel that's always visible that needs to be updated every so often as long as the menu is loaded.
Opus - is the Animation attribute scheduled for decomission anytime soon? The Studio manual hints that this might be so, but I do see it being used a bit in the default STV.... btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#8
|
|||
|
|||
Quote:
|
#9
|
||||
|
||||
Not those calls. It's the OTHER usage of that field:
Quote:
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#10
|
|||
|
|||
Ah yeah that hmm that should work but probably isn't very efficient either. I remember using that back in the SMW days . I had forgotten that even existed.
|
#11
|
||||
|
||||
Not everything has to be efficient Sometimes easier is better....
btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#12
|
|||
|
|||
|
#13
|
|||
|
|||
If I were you all I'd do is:
1. Add an attribute widget in the main menu called "IsMenuLoaded" = false 2. In the beforemenunload hook add an Action Widget "IsMenuLoaded" = true 3. In the beforemenuunloaded hook add an Action Widget "IsMenuLoaded" = false Now your all set to add your looping fork. Code:
Fork() "REM Start Panel Refresh" Wait(100) IF IsMenuLoaded RefreshArea("YourPanel") Link back to "REM Start Panel Refresh"
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#14
|
||||
|
||||
The problem I have with that is you can end up with thread creep - if you exit the menu, and come back while this fork is sleeping, you end up with TWO threads refreshing the panel.
1 gets created when you come back to the menu. The other wakes up after you came back, and it's variable (IsMenuLoaded) is true, so it keeps on chuggin' SO then you have to keep track of if you started a thread already.... btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#15
|
|||
|
|||
Ahhh, you noticed this as well
There is a way around this if your Wait() time is quite long..... create a sub Timed loop within the Fork(). So basically what I did is shown in the attached screenshot.... obviously if you can leave the menu and come back again within 10ms your going to get your creep But so far I've not been able to do this in my testing and there is no slowdown as its still all contained within the original Fork(). Maybe I'm doing it wrong..... someone will no doubt shout if I am.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
#16
|
||||
|
||||
Cool - that looks like a good method. I'll give it a try.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#17
|
||||
|
||||
Quote:
And FWIW the three non-negative integers specify the milliseconds, so 0,1000,0 animates the panel once a second. What's wrong with using the panel Animate property?
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#18
|
||||
|
||||
This statement from the Studio manual is what concerns me :
Quote:
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#19
|
||||
|
||||
I'm not referring to using it for animations, I'm referring to using the panel property for refreshing. Animations and refreshing are two very different things. Maybe they need to change the panel property to "Refresh" instead of "Animate".
__________________
Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders. |
#20
|
|||
|
|||
I didn't know it did that.... you learn something new every day
However it wouldn't work for my case example as within each 120ms animation loop I needed to load a new image. I've attched a small video I made which shows 6 forked threads running (5 for weather and 1 music playback). I don't know if you can remember the old Track & Field game made by Ocean way back in the eighties where you had to hammer the keys to make the athelete run faster? Well thats what I did to test this out trying to get it to creep and I couldn't...... 10ms is rather quick
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Panel Properties | broconne | SageTV Studio | 2 | 10-28-2010 08:24 AM |
color control panel | mkloharry | SageTV Software | 1 | 05-10-2008 09:12 AM |
Right-to-left panel layout | GKusnick | SageTV Studio | 0 | 02-12-2007 02:30 AM |
Panel bug ? | dflachbart | SageTV Studio | 2 | 02-11-2007 04:53 AM |