|
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
|
||||
|
||||
Using the default STV in Custom STV Mode from custom STVs (v6.4 & later)
Version 6.4 of the default STV has a Custom STV Mode that custom STVs can use for configuration options, such as setting up recording sources, or for use of any other menu in the default STV. This makes sure that users are always using the most up to date setup code and the custom STV authors do not need to worry about that code at all.
I believe SageMC does something like that already, but it provides a customized version of the default STV which could get out of date since the default STV's setup code gets modified often. To use the default STV in Custom STV Mode, a custom STV would set these global variables: Code:
AddGlobalContext("gCurCustomSTVFilePath", GetCurrentSTVFile()) Optional variable to reload the custom STV w/o confirmation, set to true or false, default false: AddGlobalContext("gReloadCustomSTVWithoutConfirm", true) Optional variable to set name of menu to jump to, default null: AddGlobalContext("gTargetMenuName", "<name of menu widget>") Optional variable to use the Home command to return to the custom STV, set to true or false, default false: AddGlobalContext("gReloadCustomSTVOnHome", true) Optional variables used to call a custom init method - set gCustomSTVInit to the name of the method to call and gCustomSTVInitParams are the parameters: AddGlobalContext("gCustomSTVInit", <name of method to call> ) AddGlobalContext("gCustomSTVInitParams", <parameters> ) Use the GetDefaultSTVFile() API call to load the default STV: LoadSTVFile(GetDefaultSTVFile()) Optional variable to reload the custom STV after entering the playback menu, set to true or false, default false: AddGlobalContext("gReloadCustomSTVOnPlayback", true) If gReloadCustomSTVWithoutConfirm has been set to true, then the custom STV is reloaded w/o asking the user to confirm that step. If gTargetMenuName has been set, then the default STV will attempt to jump directly to the menu widget with the specified name. If the name doesn't exist, then the Main Menu will be used. If this variable is null, the Setup Menu will be loaded. If gReloadCustomSTVOnHome has been set to true, then the default STV will reload the custom STV when the Home command is used. Use the gReloadCustomSTVWithoutConfirm variable to control whether the action is confirmed or not. If gReloadCustomSTVOnPlayback has been set to true, then the default STV will reload the custom STV after entering the playback menu. If gCustomSTVInit has been set to the name of a method to call, then this function is called after the default STV has been loaded and its initial settings are configured -- it gets called as one of the last things to be done in the Main Menu's AfterMenuLoad hook, but before the jump to another menu. gCustomSTVInitParams is sent as the array of parameters. This is done via a call to: sage_SageTV_apiUI( GetUIContextName(), gCustomSTVInit, gCustomSTVInitParams ) Code:
Custom Java code: package CustomCode; public class CustomInit { public static void initialize(String arg1, String arg2) throws InvocationTargetException { [...] } } Custom STV: AddGlobalContext("gCustomSTVInit", "CustomCode_CustomInit_initialize" ) AddGlobalContext("gCustomSTVInitParams", CreateArray(param1,param2,...) ) Note: These global variables are cleared before reloading the custom STV. If the custom STV needs to do anything specific when it is reloaded, it should set its own custom global variables before loading the default STV. I'm looking for comments from custom STV authors regarding anything else they think would be needed. Nothing else jumps out at me and I don't think the default STV needs to look for or set any other global variables to talk to the custom STV, because the custom STV could set those before loading the default STV so it knows Custom STV Mode was just exited when it gets reloaded. See the attached STV for sample code used to test jumping between the default & sample STV. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#2
|
|||
|
|||
Quote:
One thing less to worry about. Awesome... Dirk |
#3
|
||||
|
||||
I figured you would like that one. And, it was really easy to implement.
Are you doing anything else in your customized default STV? Have you run into usability issues that should be considered? ... it doesn't seem too difficult to me: when done, choose "Exit Setup Mode" and confirm. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#4
|
||||
|
||||
One other feature is that 'Back' and 'Home' both return you to SageMC.
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) |
#5
|
||||
|
||||
Not an author, but this sounds awesome. If I am reading this right it will give us a way to keep the original STV "pure" and independent, not have to worry about SageTV3-2, then 3-3, 3-4, etc. Is this true?
|
#6
|
||||
|
||||
I've been doing something like this in my own (unreleased) custom STV for some time. In my case I use more than just the Setup menu; I also have menu items that jump into the stock Video Browser and Music Browser screens (since I didn't feel like duplicating that functionality in my STV).
Basically what my code does is this: 1. Remember the name of the currently loaded STV. 2. Load the target STV. 3. Set the STV property in the properties file to the calling STV (so if the user quits and restarts Sage, that's the one that will be loaded). 4. Search for the Standby item on the Main Menu in the target STV. 5. Replace it with a "Return to caller" menu item that reloads the original STV. 6. Jump to the target menu by name. The interesting thing is that steps 3-6 continue to execute even after the target STV has been loaded, even though the code for those steps is defined in the STV that has just been unloaded. I guess we have Java garbage collection to thank for that.
__________________
-- Greg |
#7
|
||||
|
||||
Quote:
Quote:
Quote:
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#8
|
||||
|
||||
Quote:
The same thing applies to any forked threads -- they will continue until they hit an exit point... I think I have one to double check for stopping itself when the STV changes. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#9
|
||||
|
||||
Quote:
I've now set the STV property as you mentioned. I also added a check for an optional variable named "gExitSetupWithoutConfirm", which will change the exit button so that when selected, the user immediately returns to the custom STV instead of being asked whether to return. (First post has been modified.) - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#10
|
||||
|
||||
Will there be a way to jump directly to menus other than Setup? So instead of a boolean gInSetupMode, you might have a string-valued gTargetMenuName that determines which menu to jump to.
__________________
-- Greg |
#11
|
||||
|
||||
Quote:
The gInSetupMode variable has been removed; it wasn't really needed in the first place. I changed gExitSetupWithoutConfirm to gReloadCustomSTVWithoutConfirm. And, gTargetMenuName was added. As the first post says: "If gTargetMenuName has been set, then the default STV will attempt to jump directly to the menu widget with the specified name. If the name doesn't exist, then the Main Menu will be used. If this variable is null, the Setup Menu will be loaded." I decided that selecting a random menu if the specified menu name doesn't exist just wasn't a good way to handle it. So, for setup mode, you only need to set the gCurCustomSTVFilePath variable & the other 2 are optional. I should call it something other than "Setup Mode" now... - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#12
|
||||
|
||||
Very nice indeed. When new menus (like online services) are added to the default STV, this could be a great way for users of custom STV's to link to those screens and immediately gain the new functionality. How would a user return to a custom STV from any given (linked) screen? In a related (admittedly hair brained) thought, would there be any way to preserve the menu history of the calling STV when linking to a menu in the default STV? The idea is when 'back' is hit within the default STV taking you back to the point where it was originally called (i.e when the menu history in the default STV is exhausted), it would reload the calling custom STV and its menu history. This could make the transition between STV's seamless in both directions. Aloha, Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) |
#13
|
||||
|
||||
Somehow, I'm not even subscribed to my own thread...
Quote:
Quote:
To return to the original menu in the custom STV, it could set its own variable to track that & then when it gets reloaded, it could jump to that menu when the variable is set. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#14
|
||||
|
||||
Quote:
Quote:
Quote:
Thanks! Aloha, Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full." - Nikolaus (4yrs old) |
#15
|
||||
|
||||
I have Home optionally returning to the custom STV with or w/o confirmation.
I was going to use Back to return to the custom STV when the Back history limit was reached, but there are only so many menus stored in the history. The user could go to more menus than the history can hold & then use Back enough times to hit the history limit w/o reaching the menu where everything started. I don't think I'm going to add that one unless you are really sure you want to have Back return to the custom STV. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#16
|
||||
|
||||
I have updated the first post of this thread with the latest global variable info and a simple sample STV used to test this feature.
You can update your current default STV for this & other new features by testing the STV updating feature described here: STV Update Tests for beta v6.4.3 Let me know how it goes. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#17
|
|||
|
|||
How would Themes work in the case where a Custom STV branches out to the default STV? I assume that while in the default STV function, the default STV last selected Theme would be used? Would there be any way for the Custom STV to handle this so the Custom STV could control the Themed elements from the default STV function it is calling (to try and keey a consistent look/feel for the user)?
I hope this question makes sense |
#18
|
||||
|
||||
The default STV will use whatever theme it has been set to use. If the custom STV author wants the default UI to look similar, then there needs to be an appropriate theme that the default STV can load & it needs to be set to use that theme.
- Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#19
|
||||
|
||||
Note that v6.4.4 has a new API call: GetDefaultSTVFile(). You can use this new call to easily load the default STV w/o needing to worry about whether the file name or path for the default STV ever changes:
LoadSTVFile(GetDefaultSTVFile()) The example STV in the first post has been updated. - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
#20
|
||||
|
||||
Based on a request from flachbar, the next version of the default STV will use new global variables gCustomSTVInit and gCustomSTVInitParams to allow calling a custom init method.
Added to the first post, above: Code:
Optional variables used to call a custom init method - set gCustomSTVInit to the name of the method to call and gCustomSTVInitParams are the parameters: AddGlobalContext("gCustomSTVInit", <name of method to call> ) AddGlobalContext("gCustomSTVInitParams", <parameters> ) sage_SageTV_apiUI( GetUIContextName(), gCustomSTVInit, gCustomSTVInitParams ) Code:
Custom Java code: package CustomCode; public class CustomInit { public static void initialize(String arg1, String arg2) throws InvocationTargetException { [...] } } Custom STV: AddGlobalContext("gCustomSTVInit", "CustomCode_CustomInit_initialize" ) AddGlobalContext("gCustomSTVInitParams", CreateArray(param1,param2,...) ) Any comments/requests about this from other developers? - Andy
__________________
SageTV Open Source v9 is available. - Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1. - Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus - HD Extenders: A) FAQs B) URC MX-700 remote setup Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How To: Add custom online video feed definitions (default STV; v7.0+) | Opus4 | SageTV v7 Customizations | 14 | 04-18-2015 07:06 AM |
How To: Add custom online video feed definitions (default STV; v6.4+) | Opus4 | SageTV Customizations | 69 | 08-15-2010 10:13 AM |
How To: Add custom online video feed definitions (default STV; v6.3.10) | Opus4 | SageTV Customizations | 34 | 06-04-2008 08:11 PM |
Custom STV: My ShowLogos STV working in Linux | laurenglenn | SageTV Linux | 0 | 02-19-2006 05:49 PM |