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 11-14-2010, 11:25 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Refreshing UI from a Sage Event.

I am trying to figure out how to cause a UI refresh to be triggered by a particular sage event.

For example, when "RecordingComplete" event is fired, I want to refresh my UI. However, I don't understand how I can push the command to the active UIs from my non STVI - plugin?
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #2  
Old 11-14-2010, 12:00 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
You could write a sagetv plugin implementation class but that seems overkill and it would be tricky to refresh the correct uicontext.I believe there is hooks in the stv for this you can fire off. Look how the default recordings menu does it.

I also would set a variable when in your menu and leaving your menu so you know if you need to refresh or not and you aren't firing it when they aren't in your menu.
Reply With Quote
  #3  
Old 11-14-2010, 06:47 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
From a Java event listener, you can execute API calls on any connected client using the appropriate UI context. How exactly you do that will depend on which (if any) API wrappers you're using. But basically, to force a refresh on all clients, you would enumerate the results of GetConnectedClients() and GetUIContextNames() and call the Refresh() API method on each one.

But as Plucky indicates, there may not be much point in forcing a refresh on clients that are sitting at the Main Menu. It might help if you describe what you're trying to accomplish in more detail so we can target our advice to your specific requirements.
__________________
-- Greg
Reply With Quote
  #4  
Old 11-14-2010, 08:10 PM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by GKusnick View Post
It might help if you describe what you're trying to accomplish in more detail so we can target our advice to your specific requirements.
I am looking to refresh my UI when a Recording is started or stopped.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
Reply With Quote
  #5  
Old 11-15-2010, 12:41 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Sorry, but I'm still unclear on what you mean by "my UI", since you said earlier that your plugin is not a UI mod (STVI) plugin. So what UI do you have that needs refreshing? Or are you saying you want to force a refresh of all connected clients, even if they're sitting at the Main Menu (or running some totally unrelated third-party UI)?

In fact you may find that you don't need to do anything. The screen is going to refresh anyway to show or hide the red REC icon in the menu header. This is accomplished by the global RecordingScheduleChanged hook in the stock STV.

If depending on that makes you nervous, then what I'd probably do in any UI mod that displays information based on the recording schedule would be to put a local RecordingScheduleChanged hook on the panel containing such information, and do a targeted RefreshArea on that panel, rather than a blanket Refresh of the whole screen.

But all of this can be done completely within Studio. So I'm not sure where your Java-based plugin comes into it (assuming I haven't misunderstood that part of your original post).
__________________
-- Greg
Reply With Quote
  #6  
Old 11-15-2010, 04:26 AM
broconne broconne is offline
Sage Aficionado
 
Join Date: Feb 2009
Location: Cary, NC
Posts: 306
Quote:
Originally Posted by GKusnick View Post
Sorry, but I'm still unclear on what you mean by "my UI", since you said earlier that your plugin is not a UI mod (STVI) plugin. So what UI do you have that needs refreshing? Or are you saying you want to force a refresh of all connected clients, even if they're sitting at the Main Menu (or running some totally unrelated third-party UI)?
My plugin consists of two parts. An API part (Java/implements STVPlugin) and an STVI mod. I wanted to refresh the STVI from the API based on an event coming into the API part of my plugin.


Quote:
In fact you may find that you don't need to do anything. The screen is going to refresh anyway to show or hide the red REC icon in the menu header. This is accomplished by the global RecordingScheduleChanged hook in the stock STV.
Hmmm. I had tried the RecordingScheduleChanged hook and when it fired it seemed as if the newly recorded show was not yet appearing GetMediaFiles.. But based on what you are saying that hook should detect a recording, start, stop, etc.. I will add some more logging and try again.


Quote:
If depending on that makes you nervous, then what I'd probably do in any UI mod that displays information based on the recording schedule would be to put a local RecordingScheduleChanged hook on the panel containing such information, and do a targeted RefreshArea on that panel, rather than a blanket Refresh of the whole screen.
Yep, RefreshArea is what I plan to do.


Quote:
But all of this can be done completely within Studio. So I'm not sure where your Java-based plugin comes into it (assuming I haven't misunderstood that part of your original post).
Yep, my post wasn't clear that my plugin has two parts. Thanks for all the help - I will mess around with RecordingScheduleChanged hook and see if I can't get that to work for me.
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram
Guest: Ubuntu 16.04 with Sage v9 in Docker
Tuners: 2 HDHR (OTA);
Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD
Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case.
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
Screen not refreshing pvrpenguin Sage My Movies 1 10-25-2010 07:48 AM
Feature request: Add windows system event log disk errors to Sage system messages mickp SageTV Software 0 11-18-2009 02:27 AM
Program Guide: Refreshing? PeteCress SageTV EPG Service 1 03-15-2009 07:12 AM
Media Not Refreshing Mike SageTV Software 2 12-29-2006 04:58 PM
run external program at sage screen saver event skyw33 SageTV Software 1 04-01-2005 08:53 AM


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


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