![]() |
|
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
|
||||
|
||||
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"); 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 |
#2
|
||||
|
||||
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 |
#3
|
||||
|
||||
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 |
#4
|
||||
|
||||
No, there is no way to read out or change runtime variable values through the API, except for AddGlobalContext and AddStaticContext.
__________________
-- Greg |
#5
|
||||
|
||||
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 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
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 |