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-20-2008, 01:04 PM
shadeblue.com's Avatar
shadeblue.com shadeblue.com is offline
Sage Aficionado
 
Join Date: Jun 2008
Posts: 435
gkusnick / Sage API question?

Hello,

I am working on a plugin using Gkusnick'a wrapper API, but this is probably more of a SageAPI question.

I can use the following code to set a global context variable, which works great...

Code:
// create API and Sage Configuration
gkusnick.sagetv.api.API sageAPI = new API();
gkusnick.sagetv.api.Global sageGlobal = new gkusnick.sagetv.api.Global(sageAPI);
            
sageGlobal.AddGlobalContext("test","test var value");
But how do I set a context variable for a specific UI context, one that I don't want to be global?

Thank You,
shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB
Operating System: Windows XP Professional
HTPC/DVR Software: SageTV 7
Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun
Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200
Signals/Providers: AT&T UVerse, OTA ATSC
Set-Top-Box: 2 @ Motorola Box VIP 1200
Reply With Quote
  #2  
Old 11-20-2008, 01:34 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
You're getting confused by two different meanings of "global". AddGlobalContext does not affect all UI contexts; it affects only the one in which it's called. "Global" in this case means visible to all widget code in that UI context (as compared to Attribute variables, whose scope is limited to a subset of widgets). There is no such thing as a global variable visible to all code in all UI contexts (unless you count property file entries).

When you instantiate the API object with no UI context argument, you're not getting a "global" API that affects all contexts. You're getting one with no UI context at all, i.e. one that can be reliably used only for core functions and not for UI functions. To affect a specific UI context, pass that context in when you instantiate the API object.

Also, you don't need to instantiate the Global class. The API object already contains a public instance of that class (i.e. sageAPI.global).
__________________
-- Greg
Reply With Quote
  #3  
Old 11-20-2008, 10:52 PM
shadeblue.com's Avatar
shadeblue.com shadeblue.com is offline
Sage Aficionado
 
Join Date: Jun 2008
Posts: 435
Greg,

Thanks for the info! That helps explain things much better.

On the Attribute variables you mentioned where their scope is limited to a subset of widgets in a chain, is there a way from the API to set the value of one of these variables.

For example, if I find a widget in a UI context that defines a variable, can I update this variables runtime value from the API? I don't want to update the permanent value to the widget causing a change to the STV file, just the value of the variable at runtime where I may execute a chain a widgets after this variable value widget.


Thanks, shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB
Operating System: Windows XP Professional
HTPC/DVR Software: SageTV 7
Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun
Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200
Signals/Providers: AT&T UVerse, OTA ATSC
Set-Top-Box: 2 @ Motorola Box VIP 1200
Reply With Quote
  #4  
Old 11-20-2008, 11:06 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
No, there is no way to read out or change runtime variable values through the API, except for AddGlobalContext and AddStaticContext.
__________________
-- Greg
Reply With Quote
  #5  
Old 11-20-2008, 11:07 PM
shadeblue.com's Avatar
shadeblue.com shadeblue.com is offline
Sage Aficionado
 
Join Date: Jun 2008
Posts: 435
Ok, Thank You!
shadeBlue
__________________
Server Hardware: Intel Core 2 Quad Q6700 2.66GHz CPU, 4GB DDR2 RAM, NVIDIA nForce 780i SLI Motherboard, GeForce 8600 GT, Seagate Barracuda 7200.11 2.5TB
Operating System: Windows XP Professional
HTPC/DVR Software: SageTV 7
Capture Devices: 2 @ Hauppauge HD-PVR (1212), Hauppauge WinTV-HVR-1600 ATSC/QAM, HD Homerun
Media Extenders: 2 @ Sage HD100 & 1 @ Sage HD200
Signals/Providers: AT&T UVerse, OTA ATSC
Set-Top-Box: 2 @ Motorola Box VIP 1200
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
Sage + DirecTV HD DVR question subhadipsas Hardware Support 11 07-08-2008 11:45 PM
My Sage TV 6.3 Problems and Fixes (Long) tcsubwoofer SageTV Software 12 05-08-2008 07:35 PM
Maybe newbie question on Watch API method Sendero SageTV Customizations 0 03-07-2008 03:19 PM
HD Extender + Sage Server + HDHomerun Question FreshOne SageTV Media Extender 4 12-04-2007 12:34 PM
Studio API question lotus298 SageTV Studio 2 12-07-2005 01:01 PM


All times are GMT -6. The time now is 02:30 AM.


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