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
  #81  
Old 11-09-2007, 04:29 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick
No, there's no logic in place to implicitly create the Global theme. Here's what I'd suggest as a workaround:

1. Create the Global theme manually in the stock STV and link your listeners to it using the usual backref mechanism.

2. Put code into your STVImported hook to check for the Global theme and create it if not present (but don't add any additional logic to link up your listeners).

3. Export As STVI.

4. Load up the generated STVI for editing and manually move your check-and-create code up to before the call to ProcessImport. That way when ProcessImport runs, the Global theme is guaranteed to exist and your backref links will link up properly.

5. Remember to delete the spurious Main Menu before saving.

Disclaimer: I haven't actually tried this, but it seems like something along these lines ought to work, if you don't mind hand-massaging the STVI after it's been generated.
Thanks Greg. Sounds like a good plan.

Aloha,
Mike

Last edited by MeInMaui; 11-09-2007 at 04:33 PM.
Reply With Quote
  #82  
Old 11-12-2007, 06:47 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Hi Greg,

I've been playing around trying to implement your suggestion from above. I am trying to use some of the methods in your Studio Tools to accomplish this, but I'm having difficulty. I'm pretty sure I'm missing something basic.

For instance, I'm trying to implement the following expression in an action widget in studio:

Code:
gkusnick_sagetv_api_WidgetAPI_GetWidgetFromPath( "Theme:Global" )
I'm expecting that this should return null if the widget doesn't exist, or return the wrapped widget if it does exist. When I check the console window, I get a lot of errors when I try to execute this expression and it always returns a null. Is there something I have to initialize or instantiate first? I'd appreciate any direction you can give me. Thanks.

Aloha,
Mike
Reply With Quote
  #83  
Old 11-12-2007, 07:08 PM
dflachbart dflachbart is offline
SageTVaholic
 
Join Date: Jan 2006
Location: Brookfield, CT
Posts: 2,743
Quote:
Originally Posted by MeInMaui View Post
Hi Greg,

I've been playing around trying to implement your suggestion from above. I am trying to use some of the methods in your Studio Tools to accomplish this, but I'm having difficulty. I'm pretty sure I'm missing something basic.

For instance, I'm trying to implement the following expression in an action widget in studio:

Code:
gkusnick_sagetv_api_WidgetAPI_GetWidgetFromPath( "Theme:Global" )
I'm expecting that this should return null if the widget doesn't exist, or return the wrapped widget if it does exist. When I check the console window, I get a lot of errors when I try to execute this expression and it always returns a null. Is there something I have to initialize or instantiate first? I'd appreciate any direction you can give me. Thanks.

Aloha,
Mike
Hi Mike,

I haven't used Gregs API library yet, but you might try this:

Code:
api = new_gkusnick_sagetv_api_API(GetUIContextName())
widgetApi = new_gkusnick_sagetv_api_WidgetAPI(api)
widget = gkusnick_sagetv_api_WidgetAPI_GetWidgetFromPath(widgetApi, "Theme:Global")
Dirk
Reply With Quote
  #84  
Old 11-12-2007, 07:15 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
What Dirk said. Since GetWidgetFromPath is not a static method, you need an instance of WidgetAPI to call it.

Also remember that the widget you get back from this is wrapped, so if you want to pass it directly to a native (i.e. unwrapped) Widget API function, you'll have to unwrap it first. So in practice these API extensions are not all that convenient to use from Studio code (even though they're pretty easy to call from Java).

I've actually been looking at adding logic to handle the Global theme implicitly similar to the way hooks are handled now. That seems like a straightforward addition, so if you'd rather wait for that, I can try to put a new release together some time this week. I've also got a backlog of other wishlist items and bug fixes, so it's about time for a rollup release of all that stuff anyway.
__________________
-- Greg
Reply With Quote
  #85  
Old 11-12-2007, 07:18 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Thanks Dirk!

I was beginning to suspect that something like that might be necessary.

Aloha,
Mike
Reply With Quote
  #86  
Old 11-12-2007, 07:31 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick View Post
What Dirk said. Since GetWidgetFromPath is not a static method, you need an instance of WidgetAPI to call it.

Also remember that the widget you get back from this is wrapped, so if you want to pass it directly to a native (i.e. unwrapped) Widget API function, you'll have to unwrap it first. So in practice these API extensions are not all that convenient to use from Studio code (even though they're pretty easy to call from Java).

I've actually been looking at adding logic to handle the Global theme implicitly similar to the way hooks are handled now. That seems like a straightforward addition, so if you'd rather wait for that, I can try to put a new release together some time this week. I've also got a backlog of other wishlist items and bug fixes, so it's about time for a rollup release of all that stuff anyway.
Sounds good. I think I'll wait for the update.

BTW, I have a small feature request to add. Would it be possible to modify the 'Set as Non-Primary' item in the GK Tools plugin to be able to act on multiple selections? It can get pretty repetitive when prepping to use 'Export as STVi'. Of course it is already several orders of magnitude easier than creating an import with the built in studio functions, so I probably should just appreciate what I have.

Aloha,
Mike
Reply With Quote
  #87  
Old 11-13-2007, 07:56 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Hi Greg,

Sorry to bother you again. I ran into another problem and I'm kinda stuck. I am trying to export a particular menu via 'Export as STVi' and it is causing some kind of loop that I can't break out of unless I kill the SageTV process. I've been able to reproduce this on 2 different computers. So I need to figure out what it is in my code that is causing this to happen. Is there any debug logging available that might allow me to see at which point in the export process the problem is occuring? The normal SageTV debug log just continuously repeats that a hang occured. Here is a quick snippet of the log:

Code:
Tue 11/13 14:47:58.770 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 747
Tue 11/13 14:47:59.520 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 1497
Tue 11/13 14:48:00.317 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 2294
Tue 11/13 14:48:01.067 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 3044
Tue 11/13 14:48:01.817 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 3794
Tue 11/13 14:48:02.567 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 4544
Tue 11/13 14:48:03.317 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 5294
Tue 11/13 14:48:04.068 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 6045
Tue 11/13 14:48:04.817 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 6794
Tue 11/13 14:48:05.567 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 7544
Tue 11/13 14:48:06.317 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 8294
Tue 11/13 14:48:07.067 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 9044
Tue 11/13 14:48:07.817 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 9794
Tue 11/13 14:48:08.567 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 10544
Tue 11/13 14:48:09.333 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 11309
Tue 11/13 14:48:10.098 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 12075
Tue 11/13 14:48:10.879 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 12856
Tue 11/13 14:48:11.629 EventThread-SAGETV_PROCESS_LOCAL_UI Hang Detected - hang time = 13606
Thanks.

Aloha,
Mike
Reply With Quote
  #88  
Old 11-13-2007, 08:03 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by MeInMaui View Post
Is there any debug logging available that might allow me to see at which point in the export process the problem is occuring?
Go to Plugins > Logging and put a checkmark next to gkusnick.sagetv.studio.STVI. (If you're not seeing the Logging menu, open the Manage.. dialog and enable it.) That should spew some fairly verbose output to the debug log.
__________________
-- Greg
Reply With Quote
  #89  
Old 11-13-2007, 08:29 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick View Post
Go to Plugins > Logging and put a checkmark next to gkusnick.sagetv.studio.STVI. (If you're not seeing the Logging menu, open the Manage.. dialog and enable it.) That should spew some fairly verbose output to the debug log.
Excellent. Thank you!

Edit: Hmm.... I have gkusnick.sagetv.studio.STVI checked but I still don't see the Logging menu. I'll have to play with this again later. Thanks.

Aloha,
Mike

Last edited by MeInMaui; 11-13-2007 at 08:38 PM.
Reply With Quote
  #90  
Old 11-13-2007, 10:03 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
What I meant to say is that you need to enable the Logging plugin in the Manage dialog in order to see the Logging menu. Sorry for not being clear.
__________________
-- Greg
Reply With Quote
  #91  
Old 11-14-2007, 03:00 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Just a heads-up that I'm going to be on the road for a couple of days. Should be back in touch by Friday.
__________________
-- Greg
Reply With Quote
  #92  
Old 11-28-2007, 03:57 AM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Hi Greg,

I think I have a bug to report. I am trying to export an STVi using your STVi Studio plugin. In this STVi, there is an action widget chain that is to have a reference placed as a child of a 'MediaPlayerFileLoadComplete' hook at the root level (not within a menu widget). I have been fighting with this for about 2 weeks but I can't get the reference link to work when importing the STVi. The backref looks correct and in fact the same widget chain is linked to another 'MediaPlayerFileLoadComplete' hook elsewhere under a menu widget and that link works fine.

I decided to look into this a bit more, so I tried creating a simple import where a single action widget is to have references linked under many different hooks at the root level. After import, many of the links worked but several did not. There didn't seem to be much rhyme or reason, but it was reproducible (the same hooks failed every time).

Am I just missing something obvious? Please let me know if you need more info. Thanks!

Aloha,
Mike
Reply With Quote
  #93  
Old 11-28-2007, 01:45 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Yes, that's a bug. GetWidgetFromPath is accepting any hook with the right name, not just root-level hooks. So your code is getting linked to some hook buried in a menu somewhere.

I'll have to think about what the right fix is, since for themes the current behavior is by design (i.e. you don't have to specify the full path to where a theme lives, just the theme name). I may just need to special-case it for themes.

Did you ever solve your hang-on-export issue? If there's still a bug there, I'd like to get that fixed as well.
__________________
-- Greg
Reply With Quote
  #94  
Old 11-28-2007, 01:54 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick View Post
Yes, that's a bug. GetWidgetFromPath is accepting any hook with the right name, not just root-level hooks. So your code is getting linked to some hook buried in a menu somewhere.

I'll have to think about what the right fix is, since for themes the current behavior is by design (i.e. you don't have to specify the full path to where a theme lives, just the theme name). I may just need to special-case it for themes.

Did you ever solve your hang-on-export issue? If there's still a bug there, I'd like to get that fixed as well.
Thanks Greg,

Yes, I fixed the hang-on-export issue. Somehow I ended up with secondary references to some attribute widgets with no primary reference. I have no Idea how that happened, but when I tried to export it choked on them. I just removed and re-created them and everything worked fine.

On another note, I was never able to enable the debug logging. The option never appeared on the manage plugins menu. I downloaded and re-installed the Studio Tools to make sure I have the latest version, but it didn't make any difference.

Aloha,
Mike
Reply With Quote
  #95  
Old 11-28-2007, 02:43 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Looks like you're right about the logging menu. I forgot that's a new feature that wasn't in the previous release. However you should have a file called gkusnick.util.Log.properties containing the per-class logging states, and that's what I should have pointed you to. Sorry about that.
__________________
-- Greg
Reply With Quote
  #96  
Old 12-03-2007, 01:34 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Hi Greg,

I'm just wondering how the next update is coming along. Should I wait for the update for a fix for the above mentioned bug, or should I continue to try coming up with a work-around? No pressure. I just need to decide how to best allocate my limited resources (i.e. free time after 11pm). I have a few simultaneous sage projects right now. Thanks!

Aloha,
Mike
Reply With Quote
  #97  
Old 12-03-2007, 01:59 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
I have a release almost ready to go. I kind of got tied up with holiday & family stuff the last week or so, but I'll try to wrap up my testing & documentation in the next couple of days.

This includes a fix for your root hook issue.
__________________
-- Greg
Reply With Quote
  #98  
Old 12-03-2007, 02:37 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by GKusnick View Post
I have a release almost ready to go. I kind of got tied up with holiday & family stuff the last week or so, but I'll try to wrap up my testing & documentation in the next couple of days.

This includes a fix for your root hook issue.


Thank you!

Aloha,
Mike
Reply With Quote
  #99  
Old 12-03-2007, 07:46 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
OK, here's the new release I promised: Download page

This includes the following wishlist items and bug fixes from earlier in this thread:
  • You can now assign hotkeys (menu accelerators) to Studio plugin commands. There's no UI for setting up the hotkeys, but you can configure them by creating a Studio.hotkeys file in your SageTV directory. See the gkusnick.sagetv.studio package documentation in the included Javadocs for details of this file format.
  • Export as STVI no longer blows up on versions of SageTV prior to V6.1.
  • STVIs created by Export as STVI are now importable on Placeshifter and Extender clients. If you have custom STVImported code that calls InsertWidget, RemoveWidget, RenameWidget, or SetWidgetProperty, those functions are now deprecated and you should replace them with calls to the new *WidgetEx functions that supersede them. (The old functions still work for existing STVIs, just not on Placeshifters and Extenders.)
  • Dependencies on Java 1.6 have been removed, so you should now be able to run these tools on Java 1.5 as intended (if anybody still cares).
  • GetWidgetFromPath now works properly with root-level hook widgets. It also tolerates ambiguity at intermediate levels of the widget path, and accepts wildcards in place of actual widget names for some path elements.
  • Linux compatibility fixes posted here by stuckless have been incorporated into the mainline source.
  • ProcessImport is now able to create the Global theme implicitly if it doesn't already exist.
  • If you need to run some custom STVImported hook code before the call to ProcessImport, you can do that by putting a "REM ProcessImport" comment at the appropriate point in your prototype STVImported hook (instead of having to load up the STVI after export and move code around manually). If no such comment is found, the call goes at the beginning of the hook as previously.
  • Set as Non-Primary can now be applied to multiple primary references in one go.
  • The Logging menu is now available as advertised.
  • I've also updated the API wrappers to 6.2 and added a few new API extension functions; see the change log in the Javadocs for details.
Let me know of any issues you run into.

Edit: I'd meant to include a sample Studio.hotkeys in the zip, but forgot to do that before uploading it. So I'll just attach one here instead.
Attached Files
File Type: zip Studio.hotkeys.zip (168 Bytes, 300 views)
__________________
-- Greg

Last edited by GKusnick; 12-03-2007 at 07:54 PM. Reason: Add attachment
Reply With Quote
  #100  
Old 12-03-2007, 08:57 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Thanks Greg!

I can't wait to dig into this.

Aloha,
Mike
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


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


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