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 07-05-2007, 10:31 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
STV Initializations vs. ApplicationStarted hook

Are any of the STV customizations adding code under the ApplicationStarted hook to initialize settings? If so, you should note that this hook is only called when SageTV is starting, not when an STV is loaded or imported.

For the default STV, I changed things so that while the global init code is located in the ApplicationStarted hook, I also check to see if it needs to be reloaded in the Main Menu's BeforeMenuLoad hook -- if the global variable gGlobalVarsAreSet is not true, then the init code is called again. When an STV is loaded or imported, that global variable is cleared so the global init gets called again when the Main Menu is entered, which automatically happens after an STV load/import.

So, if your STV import is meant to work with the default STV, you can add init code under the "REM Set the global variables for this STV" action widget & it will get called when your customization is imported. This helps prevent the need to restart SageTV when a customization is loaded, unless external plugins need to be loaded at startup.

- 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.
Reply With Quote
  #2  
Old 07-06-2007, 03:30 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
But the Main Menu BeforeMenuLoad is not going to get called if you're using nielm's Dynamic Menus right?

John
Reply With Quote
  #3  
Old 07-06-2007, 04:55 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
The BeforeMenuLoad hook of the menu whose widget name is "Main Menu" will always be called when the STV is loaded. If that hook then wants to load a different menu, that's fine, so long as the global initialization happens first.

I haven't looked at how the Dynamic Menu STVI is implemented, but if it works by renaming the default Main Menu to something else and creating a new menu called "Main Menu" (instead of chaining to the new menu from the default menu's BeforeMenuLoad hook), then I guess that STVI will need to be updated to accommodate the global init code.
__________________
-- Greg
Reply With Quote
  #4  
Old 07-07-2007, 02:46 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by JREkiwi View Post
But the Main Menu BeforeMenuLoad is not going to get called if you're using nielm's Dynamic Menus right?
I think I wrote it so that the contents of the BeforeMenuLoad hook from the original main menu still get executed...

However, I think that you need to import the dynamic menus last for this to work correctly.

(Greg, yes, it renames the Original Main Menu to something else, and imports a new Main Menu... there were various reasons for this, mainly relating to getting the Home key to work correctly....)
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #5  
Old 07-07-2007, 10:06 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
If it would help to have the Main Menu's BeforeMenuLoad hook contents all under a single comment widget for easier linking, let me know.

- 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.
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
Simple (but effective) security for any STV Lester Jacobs SageTV Customizations 5 12-17-2010 03:21 PM
STV: SageMC 16x9 Version 6.x (latest dev build) dflachbart SageMC Custom Interface 6112 04-04-2008 11:16 PM
Recovering Default STV aukauk SageTV Customizations 2 03-20-2007 01:18 PM


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


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