SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-11-2011, 10:39 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
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
Reply With Quote
  #2  
Old 01-11-2011, 10:53 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
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
Reply With Quote
  #3  
Old 01-11-2011, 11:07 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
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.
Reply With Quote
  #4  
Old 01-11-2011, 11:36 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
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
Reply With Quote
  #5  
Old 01-11-2011, 11:40 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by bialio View Post
Do you usually put the Fork in the after menu load hook?
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.
Reply With Quote
  #6  
Old 01-11-2011, 11:59 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
Do you usually put the Fork in the after menu load hook?
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.
Reply With Quote
  #7  
Old 01-11-2011, 12:45 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
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
Reply With Quote
  #8  
Old 01-11-2011, 01:05 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
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.
Are you talking the new animation widget or the AnimateTransition and such old calls? I will say that the old calls are pretty inefficient in my testing.
Reply With Quote
  #9  
Old 01-11-2011, 01:09 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Not those calls. It's the OTHER usage of that field:

Quote:
When used to automatically update the display of itself and all of its children, there are
two ways to specify an animation property:
1. The first is using a Start,Period,Duration value for the property. This is just 3 nonnegative integers separated by commas. The first value indicates the delay after
initial display of the menu to begin animation. The second value is the time
between animation updates. And the third value is the time the animation should
last for after it has begun; 0 implies forever. All 3 values are in millisec
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #10  
Old 01-11-2011, 01:34 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
Not those calls. It's the OTHER usage of that field:
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.
Reply With Quote
  #11  
Old 01-11-2011, 01:44 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
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
Reply With Quote
  #12  
Old 01-11-2011, 01:53 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by bialio View Post
Not everything has to be efficient Sometimes easier is better....

btl.
Reply With Quote
  #13  
Old 01-11-2011, 01:56 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
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
Reply With Quote
  #14  
Old 01-11-2011, 02:08 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
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
Reply With Quote
  #15  
Old 01-11-2011, 02:24 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
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.
Attached Images
File Type: jpg Giving away my secrets.jpg (108.9 KB, 124 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #16  
Old 01-11-2011, 02:35 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
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
Reply With Quote
  #17  
Old 01-11-2011, 02:37 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by bialio View Post
Not everything has to be efficient Sometimes easier is better....

btl.
I have always used the Animation Panel property instead of the Fork()-Refresh() technique. After reading this thread I don't see why the Fork()-Refresh() tecnique is better. It certianly is harder to implement and seem to be more error prone.

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.
Reply With Quote
  #18  
Old 01-11-2011, 02:41 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
This statement from the Studio manual is what concerns me :

Quote:
Important Note: The Effect Widget should be used for animations for SageTV version 7
and newer, instead of the layer animation system. The layer animation system and API
calls are still available for use by older STVs but it is likely that it will be removed from a
future version of SageTV. All new STV development should use effect widget
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #19  
Old 01-11-2011, 02:44 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by bialio View Post
This statement from the Studio manual is what concerns me :
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.
Reply With Quote
  #20  
Old 01-11-2011, 02:53 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by tmiranda View Post
What's wrong with using the panel Animate property?
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
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


All times are GMT -6. The time now is 06:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.