|
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 |
#101
|
|||
|
|||
Quote:
Dirk |
#102
|
||||
|
||||
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. |
#103
|
||||
|
||||
Help with the new Export as STVi Tools
OK, I'm trying to use the GKusnick's tools for the first time to create an STVi. I had previously used the Flachbar tools to do this, but it appears that these tools should supersede those by automating things more and doing a bunch of other useful things.
So, I got everything installed and working and began working on a really simple STVi to try things out. It worked really well to handle automatically link up my new widgets to the existing code, but it doesn't automatically delete the existing widgets that I want to replace. It appears that I need to create an STVImported hook and add some code to delete existing widgets that I don't want anymore. Here is where I get a little confused. The GK Tools have a function called RemoveWidgetEx(). Does this remove all the widgets below it on the tree (like Flachbar's deleteWidgetTree() function) or does it just delete the referenced widget and orphan all the subwidgets (like the default studio removeWidget() command)? Also, the javadoc show only one argument (string sxPath), but the description indicates you need to pass an instance to the STVi as the first argument if called from widget code. Is this because of the Java wrapper? Is there an example on how to get the instance? For example, let's say the existing STV has the following Menu structure and I want to replace Widget C with my own new code containing Widget X and Widget Y. How do I do it? Existing Menu |->Widget A ....|->Widget B .........|->Widget C ............|->Widget D New Code |->Widget X ....|->Widget Y Existing Menu - After Import |->Widget A ....|->Widget B .........|->Widget X ............|->Widget Y ................|->Widget D Step 1: Create a dummy menu to hold the new code. Step 2: ??? Step 3: ??? Step X: Select the dummy menu and choose "Export as STVi from the Plugins|STVi Tools Menu. Thanks in advance for the help...
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2),USBUIRT (multi-zone) Source: Comcast/Xfinity X1 Cable Primary Client: Server Other Clients: (1) HD200, (1) HD300 Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE, HDHR, HVR-2250, HD-PVR |
#104
|
||||
|
||||
RemoveWidgetEx() checks to see if there are any other refs to the removed widget, and if not, does widget.DeleteTree(true) on it. This is equivalent to Select Safe Subtree followed by Delete. So only the orphaned widgets get deleted; shared widgets are retained. I'll update the docs to make this clearer. (But when in doubt, you can always look at the included source code to see exactly what it does.)
The docs show just one argument because the "this" argument is implicit for non-static methods in Java. However when calling Java methods from Studio, you must pass in the "this" argument explicitly. You don't need to create an instance to pass in; the automatically generated STVImported hook will create one (called stvi) to pass in to ProcessImportEx(), and that's the one you should use. You should be able to do what you want in your example as follows: Step 2: Paste a ref to Widget X under Widget B. Step 3: Paste a ref to Widget D under Widget Y. Step 4: Create an STVImported hook under New Code. Step 5: Put a call to RemoveWidgetEx(stvi, "") under the hook. Step 6: Right-click Widget C and choose Copy Widget Path. Step 7: Paste the path between the empty quotes in Step 5. Step 8: Export.
__________________
-- Greg |
#105
|
||||
|
||||
Thanks Greg! Very helpful.
I assume that when copying and pasting the widget path, I will need to manually escape any quote marks that appear in the widget path (i.e. for comment widgets)?
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2),USBUIRT (multi-zone) Source: Comcast/Xfinity X1 Cable Primary Client: Server Other Clients: (1) HD200, (1) HD300 Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE, HDHR, HVR-2250, HD-PVR |
#106
|
||||
|
||||
I answered my own question through experimentation:
1. Must manually insert "\" backslash character before any " marks that appear in the middle of the widget path. 2. Must remember to include the class path when calling any functions from the library, so RemoveWidgetEx(stvi,"") won't work. Instead use: gkunsick_sagetv_studio_RemoveWidgetEx(stvi,"") when calling from widget code. These are some really powerful tools, once you get the hang of them. Thanks again for all your hard work Greg!
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2),USBUIRT (multi-zone) Source: Comcast/Xfinity X1 Cable Primary Client: Server Other Clients: (1) HD200, (1) HD300 Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE, HDHR, HVR-2250, HD-PVR |
#107
|
||||
|
||||
How to make STVi safe for re-import
Well, I got my basic import working, but I am still struggling with one detail - how to make my STVi safe for re-import.
I tried adding code to the STVImported hook to delete any of the widgets that my STVi adds, but for some reason, it won't delete the menu. I also tried renaming the menu in case it was getting confused and trying to delete the wrong copy, but it didn't help. The first time I run the import, all is well and I see no errors in the error log. But the second time I run the import, I see the following errors: Code:
Wed 1/9 13:13:02.355 Module processing STVImported Hook Wed 1/9 13:13:02.403 java.lang.reflect.InvocationTargetException Wed 1/9 13:13:02.403 at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) Wed 1/9 13:13:02.403 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) Wed 1/9 13:13:02.403 at java.lang.reflect.Method.invoke(Unknown Source) Wed 1/9 13:13:02.403 at sage.e$d.a(Unknown Source) Wed 1/9 13:13:02.403 at sage.a.m$b.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.a.m.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.404 at tv.sage.b.k.a(Unknown Source) Wed 1/9 13:13:02.404 at tv.sage.c.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.d.e$2.new(Unknown Source) Wed 1/9 13:13:02.404 at sage.av.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.a.m$b.a(Unknown Source) Wed 1/9 13:13:02.404 at sage.a.m.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.a8.new(Unknown Source) Wed 1/9 13:13:02.405 at sage.a8.mouseReleased(Unknown Source) Wed 1/9 13:13:02.405 at sage.bg.if(Unknown Source) Wed 1/9 13:13:02.405 at sage.ad.if(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.405 at sage.bn.do(Unknown Source) Wed 1/9 13:13:02.406 at sage.bn.mouseReleased(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.Component.processMouseEvent(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.Component.processEvent(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.Component.dispatchEventImpl(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.Component.dispatchEvent(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventQueue.dispatchEvent(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventDispatchThread.pumpEvents(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventDispatchThread.pumpEvents(Unknown Source) Wed 1/9 13:13:02.406 at java.awt.EventDispatchThread.run(Unknown Source) Wed 1/9 13:13:02.407 Caused by: java.lang.NullPointerException Wed 1/9 13:13:02.407 at gkusnick.sagetv.studio.STVI.RemoveWidgetEx(STVI.java:473) Wed 1/9 13:13:02.407 ... 44 more Wed 1/9 13:13:02.407 java.lang.NullPointerException Wed 1/9 13:13:02.407 at gkusnick.sagetv.studio.STVI.RemoveWidgetEx(STVI.java:473) Wed 1/9 13:13:02.407 at sun.reflect.GeneratedMethodAccessor12.invoke(Unknown Source) Wed 1/9 13:13:02.407 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) Wed 1/9 13:13:02.407 at java.lang.reflect.Method.invoke(Unknown Source) Wed 1/9 13:13:02.407 at sage.e$d.a(Unknown Source) Wed 1/9 13:13:02.407 at sage.a.m$b.a(Unknown Source) Wed 1/9 13:13:02.407 at sage.a.m.a(Unknown Source) Wed 1/9 13:13:02.407 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.407 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.407 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.408 at tv.sage.b.k.a(Unknown Source) Wed 1/9 13:13:02.408 at tv.sage.c.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.d.e$2.new(Unknown Source) Wed 1/9 13:13:02.408 at sage.av.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.a.m$b.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.a.m.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.408 at sage.a8.new(Unknown Source) Wed 1/9 13:13:02.408 at sage.a8.mouseReleased(Unknown Source) Wed 1/9 13:13:02.408 at sage.bg.if(Unknown Source) Wed 1/9 13:13:02.409 at sage.ad.if(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.do(Unknown Source) Wed 1/9 13:13:02.409 at sage.bn.mouseReleased(Unknown Source) Wed 1/9 13:13:02.409 at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) Wed 1/9 13:13:02.409 at java.awt.Component.processMouseEvent(Unknown Source) Wed 1/9 13:13:02.409 at java.awt.Component.processEvent(Unknown Source) Wed 1/9 13:13:02.409 at java.awt.Component.dispatchEventImpl(Unknown Source) Wed 1/9 13:13:02.409 at java.awt.Component.dispatchEvent(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventQueue.dispatchEvent(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventDispatchThread.pumpEvents(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventDispatchThread.pumpEvents(Unknown Source) Wed 1/9 13:13:02.410 at java.awt.EventDispatchThread.run(Unknown Source) Wed 1/9 13:13:02.410 EXCEPTION in getValueAsObject:sage.a.e: Error in method reflection of gkusnick_sagetv_studio_STVI_RemoveWidgetEx of java.lang.reflect.InvocationTargetException for:gkusnick_sagetv_studio_STVI_RemoveWidgetEx(stvi,"Menu:xtra Tiki Enhancements") Wed 1/9 13:13:02.410 sage.a.e: Error in method reflection of gkusnick_sagetv_studio_STVI_RemoveWidgetEx of java.lang.reflect.InvocationTargetException Wed 1/9 13:13:02.410 at sage.e$d.a(Unknown Source) Wed 1/9 13:13:02.410 at sage.a.m$b.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.a.m.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.411 at tv.sage.b.k.a(Unknown Source) Wed 1/9 13:13:02.411 at tv.sage.c.a(Unknown Source) Wed 1/9 13:13:02.411 at sage.d.e$2.new(Unknown Source) Wed 1/9 13:13:02.411 at sage.av.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.a.m$b.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.a.m.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.e.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.a8.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.a8.new(Unknown Source) Wed 1/9 13:13:02.412 at sage.a8.mouseReleased(Unknown Source) Wed 1/9 13:13:02.412 at sage.bg.if(Unknown Source) Wed 1/9 13:13:02.412 at sage.ad.if(Unknown Source) Wed 1/9 13:13:02.412 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.412 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.413 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.413 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.413 at sage.bn.a(Unknown Source) Wed 1/9 13:13:02.413 at sage.bn.do(Unknown Source) Wed 1/9 13:13:02.413 at sage.bn.mouseReleased(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.Component.processMouseEvent(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.Component.processEvent(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.Component.dispatchEventImpl(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.Component.dispatchEvent(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.EventQueue.dispatchEvent(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) Wed 1/9 13:13:02.413 at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) Wed 1/9 13:13:02.414 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) Wed 1/9 13:13:02.414 at java.awt.EventDispatchThread.pumpEvents(Unknown Source) Wed 1/9 13:13:02.414 at java.awt.EventDispatchThread.pumpEvents(Unknown Source) Wed 1/9 13:13:02.414 at java.awt.EventDispatchThread.run(Unknown Source) Wed 1/9 13:13:02.987 UIMgr loading UI from: C:\Program Files\SageTV\SageTV\STVs\SageTV3\!!!SageTV3 (6.3.5)-origtest-4.xml Wed 1/9 13:13:03.435 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 750 Wed 1/9 13:13:03.579 setUI(sage.b1@165d53c[Main Menu]) histIdx=0 uiHistory=[sage.b1@165d53c[Main Menu]]
__________________
Server: Ryzen 2400G with integrated graphics, ASRock X470 Taichi Motherboard, HDMI output to Vizio 1080p LCD, Win10-64Bit (Professional), 16GB RAM Capture Devices (7 tuners): Colossus (x1), HDHR Prime (x2),USBUIRT (multi-zone) Source: Comcast/Xfinity X1 Cable Primary Client: Server Other Clients: (1) HD200, (1) HD300 Retired Equipment: MediaMVP, PVR150 (x2), PVR150MCE, HDHR, HVR-2250, HD-PVR |
#108
|
||||
|
||||
It looks like RemoveWidgetEx isn't prepared to handle top-level widgets with no primary parent. I can fix that in the next release (whenever that may be).
That said, in your shoes I wouldn't worry too much about re-importation. For one thing it's not necessary, because users can always start fresh from the stock STV and import new versions of your STVI into that. Flachbar has release a batch importer that automates the importation of multiple STVIs, and that's the solution that most people use when upgrading individual STVIs. Also, supporting re-importation in the general case isn't really practical. What if additional STVIs have been imported after yours that alter the STV in ways you can't predict? Maybe your STVI will become so popular that people will release STVI mods for it, in which case you might not be able to recognize your own widgets when you see them. Bottom line is that it's a non-problem for which there isn't a good general solution, so most STVI authors don't bother.
__________________
-- Greg |
#109
|
|||
|
|||
Thanks for the STV import creation tool. It really makes things a lot easier.
I noticed that all my references to themes become primary references when I import my STVI after export (into the default STV). Is this to be expected? All other secondary references seem to be fine - it is just themes that seem to behave this way.
__________________
-Craig |
#110
|
||||
|
||||
You're saying the refs are bound to the correct themes, but that they become primary refs after import? That's most likely a consequence of the way themes are stored in the STV file. Studio writes them out last, after all the menus have been written, regardless of where they actually live in the widget tree. So all refs to themes become secondary refs on save, and the last menu to refer to it becomes the new primary ref on load.
The devs already know how I feel about the fact that save and load don't preserve primary refs, so I won't repeat that rant here. Use the Normalize Refs command on the Plugins > GK Tools menu to put the primary refs back under the Theme Organizer where they belong.
__________________
-- Greg |
#111
|
|||
|
|||
Yes, that's exactly it. One would have to do the "Normalize Refs" manually in Studio after importing my STVI, right? I don't really care since the themes are still intact - just curious. Thanks.
__________________
-Craig |
#112
|
||||
|
||||
Hi Greg,
I have yet another (hopefully) quick question. I haven't really looked at this yet, but is there anything specific that has to be done to make sure that a plugin generated using the latest version of your tools can be imported from an extender or placeshifter? Does it handle this transparently now? Thanks. Aloha, Mike |
#113
|
||||
|
||||
From post #99:
Quote:
__________________
-- Greg |
#114
|
||||
|
||||
Quote:
I just wanted to make sure that I wasn't missing something. Aloha, Mike |
#115
|
||||
|
||||
Sustaining an STVi import
So now that I've got an STVi that I'll be letting into the wild, I'm wondering how to best handle the ongoing development and fixes etc that go along with that.
For instance, if I'm going to do some new development on it I'll import it into the STV parent, and make changes. Then I have to go through and check all the references to code in the base STV, and make sure they are secondary. IT seems like a few of my references always become primary after import. That's a pain. Are there tools to make this easier? Or am I stuck manually looking over every primary / secondary reference in my code every time I create an STVi? btl.
__________________
PHOENIX 3 is here! Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient |
#116
|
||||
|
||||
What I generally do is save a copy of the modified STV just before exporting, and do any further development on that saved copy. That way I don't have to re-import it unless there's a new release of Sage and a new base STV.
However that doesn't really help with the reference issue. It's just a fact of life that references migrate around on every save/load cycle. The Normalize References and Select Shared Descendents commands may be of some use here, or, if it really bugs you, you can create your own Studio plugin with your own implementation of Normalize References that does exactly what you need it to do. Short of that, there isn't really an alternative to manually eyeballing each ref (I'm picturing the Life of Brian aliens here) every time you export.
__________________
-- Greg |
#117
|
|||
|
|||
My import doesn't have any custom STVImported code but when I try to import it from an extender it doesn't connect any of the secondary references (when I look on my server at the resulting STV file it still shows "ref>>" in all the locations). The same import works fine from within SageTV or Client. It does not show an "Imported" date in the comments section which might give a clue. Any ideas? Thanks.
__________________
-Craig |
#118
|
||||
|
||||
Quote:
The JAR bundled with your PSE Photos & Videos download is version 0.4 (although oddly it seems to have a later revision date than the 0.5 JAR), so if that's what you're still using, you'll need to upgrade.
__________________
-- Greg |
#119
|
|||
|
|||
Quote:
__________________
-Craig |
#120
|
||||
|
||||
The function is getting called; it just won't do anything on an extender because it has the wrong UI context. To get the right context, it needs to call ProcessImportEx instead, which you can accomplish by re-exporting the STVI using 0.5. It's not enough to use 0.5 just for the import; you must use it for the export too.
__________________
-- Greg |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|