SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio

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-04-2005, 01:13 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,595
Creating STVi imports

Note: Version 6.4 now has a way to create STVI files from within Studio automatically; see the v6.4 Studio manual for details.

Exisitng information about the previous methods of creating imports is still listed below.



================================
There has been some curiosity regarding how to create STVi import files that can be imported into existing complete STV packages, like the many imports created by nielm -- he developed a system used for those import creations, one which has been used by a few other people. I would let him write up his explanation of this process, but he recently commented that he will be unavailable for several days. So, I am taking the liberty to pick through his previous comments on the subject to create a pseudo-post from nielm, below.

Remember: this is probably not phrased the best way it could be, because I'm just cutting & pasting from some previous discussions. Hopefully, I didn't leave anything that doesn't make sense out of context.

Also check out:

Utility functions to simplify import by flachbar

- Andy

======================================================
From previous posts by nielm regarding how to create an STVi import
======================================================


The easy answer is 'Write an STVImported Hook', but there is a lot of complexity behind that...

IF you want to 'just' link to the existing themes (and inherit their hooks), then what I do is take the exported menu and:

remove all theme children
rename all themes that I have linked to from "xxx" to REPLACE ME with xxx
Reuse the code I have written in the STVImportedHook which does:
For each imported theme:
if name starts with REPLACE ME with, then
find a matching existing theme
remove the imported theme from it's parent
add the replaced theme to the parent
end if
end loop
If you need to link something in your menus to existing menus, or existing widget trees in your exported menu, then I find it easier to place a text action widget child in my exported menu as a placeholder, eg: "Link me to MediaPlayerOSD menu"

In the STV imported hook, I look for these specific items in the imported widgets, (using FilterByMethod, GetWidgetType, GetWidgetName), and then look for the item to link to in the existing widgets, then AddWidgetChild to make the link.

Where it gets *really* difficult is to insert blocks of new widget code into existing menus... You have to find the menu, then go through it's children finding the place to link to, then AddWidgetChild the imported widget into the menu..

What is not currently possible is:
  • uninstalling
  • re-importing an existing STV, 'upgrading' the existing page to a new version
  • tidying up after yourself, deleting 'old' items that have been replaced, and deleting the STVImported hook.
This is because to do this you need to delete an entire tree of widgets, and there is no simple function to do this... (I suppose a workaround would be to unlink (RemoveWidgetChild) the old tree and link it to a 'obsolete items' menu, but this would lead to STV-bloat)

Sorry this is a bit vague... The best thing to do is to look at some existing code: my RSSnewsreader, IMDB search, and other import modules listed in the List of available customizations.

The only tips I can offer for writing an StvImported hook are:
  • Use lots and lots of DebugLog, and enable the troubleshooting console...
  • If you have an STVImported hook in one STV file, and some exported menu items in another STV file, import the exported items into the hook file, then SaveAs (not the other way around)!!
  • Keep lots of regular incremental backups!!

Keeping a patch STV up-to-date is also tricky: because you have removed the children of all the themes the STV is ugly, and almost unuseable!

======================================================
Rephrased in another post
======================================================

> but for an import, do you get a menu working in the STV and then break it out into an import?

yes... (also for enhancements to existing menus)

Once it is working I export the menu (and/or a dummny menu with links to the extra widget trees, such as Detailed Setup rowpanels).

I then grab an existing import, save it as a new file, delete everthing except the StvImported hook, and import the exported widgets... (it has to be this way around to avoid the stvimportted hook being triggered).

I then edit the stvimported hook to remove obsolete actions and add any new actions... Some of the actions are generic (such as replace imported themes with existing themes), some are specific (such as add a new detailed setup rowpanel, or inserting a new item on a menu screen, or linking existing listeners to a custom theme)...

Then test the import by importing it into a copy of the original STV...

From then on, you have to decide how to handle bugfixes: change them in the import , re-import, re-test, or work out how to fix them in the combined STV, then change them in the import.
Reply With Quote
  #2  
Old 11-08-2005, 03:21 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
just to update this...

My latest imports dont rename the themes to 'REPLACE ME with xxx' -- they use the original theme names, and one of the branches in the imported hook does a search/replace for matching theme names...

Also there are three very useful pseudofunctions/action trees in the imported hook that I link in all over the place for deleting widget trees, and for linking widgets to a new location (with sanity checking + error reporting)...

I wont be able to give much help (time) but you should be able to figure it out from looking how the import hooks work in my imports...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #3  
Old 01-24-2008, 01:14 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
See also the STVI Tools plugin in my Studio Tools package. (Support thread here.)
__________________
-- Greg
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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


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


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