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 10-31-2006, 03:39 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
Help with accessing Variables and variable Context.

After a bit of a hiatus, and now that the stock Sage library is better, I'm looking back and getting metadata into it. I think I know how I want to do it (that is cleanly integrated with the stock library), but I'm having some troubles early on.

First things first, starting "small" . I'm trying to add a button to the options column to access the metadata import menu. Sounds easy enough. I've renamed the panel, added the item and it shows up. Now the tricky part, I want to pass the contents of the currently displayed/filtered list off to the other library.

From looking at the code, it would appear, "TheVideoList" is the variable I want to send, but AddStaticContext ("MediaFiles", TheVideoList) doesn't send anything. I presume this is because TheVideoList is in a separate context from the Options pannel.

So the question is, how should I go about getting "TheVideoList" off to my menu?
Reply With Quote
  #2  
Old 10-31-2006, 05:11 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
There's a section on variable scoping rules on p. 49 of the (V6) Studio manual. But the short answer is that you need to create an attribute node at some place up the tree that's visible from both contexts. In your case it looks like BrowserPanelArea is the nearest common ancestor of VideoOptionsIconColumn and VideoBrowserPanel.

AddStaticContext is meant for passing variables from one menu to another. If this "other library" you're talking about is on a separate menu, then AddStaticContext is what you want. If it's just another subpanel of the same menu, then you don't need AddStaticContext; you just need to put the attribute high enough up the tree so that it's visible to everyone who needs it.
__________________
-- Greg
Reply With Quote
  #3  
Old 10-31-2006, 06:06 PM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
Quote:
Originally Posted by GKusnick
There's a section on variable scoping rules on p. 49 of the (V6) Studio manual. But the short answer is that you need to create an attribute node at some place up the tree that's visible from both contexts. In your case it looks like BrowserPanelArea is the nearest common ancestor of VideoOptionsIconColumn and VideoBrowserPanel.
Yeah, kinda thought so, was hoping somebody had a better way

Quote:
AddStaticContext is meant for passing variables from one menu to another. If this "other library" you're talking about is on a separate menu, then AddStaticContext is what you want.
Yup, it's another menu.
Reply With Quote
  #4  
Old 10-31-2006, 06:15 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Like Greg said, you could add TheVideoList as an attribute at a higher level. But, it contains valid data for only a couple of the views, so I hope you have your new button available only when those views are active, or else it won't contain anything useful compared to what the screen is listing.

- 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
  #5  
Old 10-31-2006, 07:42 PM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by stanger89
Yeah, kinda thought so, was hoping somebody had a better way
For programming language geeks, declaring variables explicitly in the scope where you want them is the better way. Implicit declarations of the sort allowed by Studio (where you can just assign to a variable name you haven't previously declared anywhere) are frowned on in computer science circles and are generally not permitted in modern programming languages.
__________________
-- Greg
Reply With Quote
  #6  
Old 11-01-2006, 06:53 AM
stanger89's Avatar
stanger89 stanger89 is offline
SageTVaholic
 
Join Date: May 2003
Location: Marion, IA
Posts: 15,188
Let's put it this way, I was trying to minimize the amount of stuff I had to account for in the import. Looks like flacbar's tools will greatly aid in the task, but adding a bunch of stuff to existing menues is not trivial. And that was my goal, to take the existing library and add the stuff I wanted.

That would be pretty easy to do, just for myself, but it's bit more involved when you're trying to map it out for minimal effort to create an STVi from it.
Reply With Quote
  #7  
Old 11-01-2006, 09:38 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Just don't forget that those media browser menus aren't final & there could easily be changes that affect your import. If you do add the attribute at a higher level, watch that future versions of the STV don't add it somewhere too.

- 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


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


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