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 04-24-2009, 01:59 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Newbie Studio/programming questions.

I'm very new to Studio and programming in general and would very much like to learn how to use the tools made available for editing SageTV and Sage only, I'm not looking at learning to do any other sort of programming.

The biggest problem I have is understanding the java docs and what each widget requires to work, so for example:

AddStaticContext
public java.lang.Object AddStaticContext(java.lang.String Name,
java.lang.Object Value)

Breaking it down:

Public = ?? (what does this mean)
java.lang.Object = ?? (what object)

java.lang.String Name = ??
java.lang.Object Value = ??

The only way I can currently use it is to copy other peoples code then mess around with it 200 times until it actually does something I want. But by doing this I'm not actually understanding what it is I'm doing or even learning how to use it correctly.

Is there a good guide someone can recommend that will expain what all these different terms mean? Am I setting my sights too high and should I be starting further down the ladder?

Cheers

Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #2  
Old 04-24-2009, 02:05 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
When using an attribute widget I see various methods entered into the value box.

null
""

Attribute = AiringForBackground
Value = AiringForBackground

What do these mean?

null = searches for anything?
"" = ??
When the Attribute and Value are the same = references Objects(?) further up the widget tree and allows the use of the result elsewhere?

Cheers

Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #3  
Old 04-24-2009, 02:10 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
When making my imports I use:

Code:
GRSOptionsPanel != "LayerOne"
What does != mean?

Code:
HasMediaFile() && (DisableVideoPreview != true)
What does && mean and again with the !=

Code:
phoenix_api_IsFanartEnabled() && AiringForBackground != null
What does !=null mean?

How do you know what to put in the () Sometimes I see things entered in between and other times I dont.

Cheers

Ben
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #4  
Old 04-24-2009, 02:15 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by jaminben View Post
AddStaticContext
public java.lang.Object AddStaticContext(java.lang.String Name,
java.lang.Object Value)

Breaking it down:

Public = ?? (what does this mean)
java.lang.Object = ?? (what object)

java.lang.String Name = ??
java.lang.Object Value = ??
The 'Object' you see before the API call name is the return value, if there is one, and it is usually described as part of that call's description. I don't think I ever use the return value from this one, but trying it out in the expression evaluator indicates it simply returns the value you set.

The Name and Value are parameters for that call and are described as part of the details for the call in the docs. "String" and 'Object" are just the variable types it will use; 'Object' can be just about anything.

- 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 04-24-2009, 02:20 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by jaminben View Post
When using an attribute widget I see various methods entered into the value box.

null
""

Attribute = AiringForBackground
Value = AiringForBackground

What do these mean?

null = searches for anything?
"" = ??
When the Attribute and Value are the same = references Objects(?) further up the widget tree and allows the use of the result elsewhere?
You are seeing the initialization of the Attribute (variable name) in the Value field. "" just makes it an empty string; null is, well, null (nothing).

Setting it to its own name retains its last value if it happens to be cached (such as when returning to a menu you used previsouly), or null if it isn't yet set & cached.

- 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
  #6  
Old 04-24-2009, 02:25 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I've just started work on a new import and I'm writting this one from scatch (no hack'n'slash), not a good idea considering my above posts. Anyway the idea is to create a screen which only shows TV recordings where there is more than one file present for that particular show. I see referenced in almost all other screens "Ariring", which when used with:

Code:
phoenix_api_GetFanartBanner(Airing)
          Image Widget
Produces a banner image which is related the highlighted TV show.

I've attached a screenshot of the code I've used to so far create the screen and pick out all these +1 recorded shows. However I cannot get the banner artwork to work using "Airing". The only way that it works for me is to use:

Code:
phoenix_api_GetFanartBanner(GetElement(GetSubgroup(RecordedFiles, GroupedFiles), 0))
How do I intergrate the Airing property(?) so I can do the same thing for backgrounds and other Actions that work via the Airing property?

Cheers

Ben
Attached Images
File Type: jpg Example.jpg (137.2 KB, 162 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #7  
Old 04-24-2009, 02:25 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by jaminben View Post
When making my imports I use:

Code:
GRSOptionsPanel != "LayerOne"
What does != mean?

Code:
HasMediaFile() && (DisableVideoPreview != true)
What does && mean and again with the !=

Code:
phoenix_api_IsFanartEnabled() && AiringForBackground != null
What does !=null mean?

How do you know what to put in the () Sometimes I see things entered in between and other times I dont.
Hmmm... I think you need some sort of introduction to basic programming, at least for Java, but I'm not sure where to point you... maybe someone else does?

You are talking about comparisons, where '==' means "Is equal to?" and '!=' means "is not equal to?", '&&' is "AND". Such comparisons have a precedence order, but parentheses can override that or simply make it clearer which comparisons you want done first... sort of like using them in math, where

5 + (7 * 3) equals 5 + 7 * 3

But
(5 + 7) * 3 does not equal 5 + 7 * 3

- 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
  #8  
Old 04-24-2009, 02:38 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
I had previously had some programming classes in Ada and used that to write a solid state diffusion computational model for my dissertation, so that helped a lot. But to get familiar with Java, I picked up 'Head First Java' at flachbar's recommendation. You may need to find a more basic Intro to Programming book first in some simple language (might as well stick with Java for this). I don't recall how much prior knowledge was assumed for the Head First book.

Aloha,
Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)
Reply With Quote
  #9  
Old 04-24-2009, 02:49 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Thanks Andy, thats given me something to think about, no doubt I'll read your replys a few dozen times tonight

Quote:
Originally Posted by MeInMaui View Post
But to get familiar with Java, I picked up 'Head First Java' at flachbar's recommendation.
This is what I wanted Something I can sit down and read rather than staring at a computer screen. I'll pop off and see if I can get this and this tomorrow.

Any ideas about post No.6?

P.s If you ever need your home rewired then I'm your man, you'll have to pay for the flights though
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders

Last edited by jaminben; 04-24-2009 at 02:53 PM.
Reply With Quote
  #10  
Old 04-24-2009, 03:03 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
RE:Post 6

Airing is just another variable defined in that screen. It could have been name Elephant. As a result of the logic leading up to that point, the Airing variable contains the sage Airing Object for the show of interest. You have to set up all of that logic in your screen.

Aloha,
Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)
Reply With Quote
  #11  
Old 04-24-2009, 03:53 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by MeInMaui View Post
RE:Post 6

Airing is just another variable defined in that screen. It could have been name Elephant. As a result of the logic leading up to that point, the Airing variable contains the sage Airing Object for the show of interest. You have to set up all of that logic in your screen.
So in my example I can pull in the data for the showtitle, should I now add extra Objects like "GetShowEpisode" to build up a library of usable data for that screen? i.e repeat the code changing the "GetShowTitle" code to "GetShowEpisode" so I end up with twice what I had? I have tried this but it didn't work so I guess I already know the answer

I've updated the screenshot highlighting what I used to make the ShowTitle work when highlighting a TV Series.

Also, as I can transfer the ShowTtitle and display it, why when adding:

Code:
phoenix_api_GetFanartBanner(ShowTitle)
                     Image Widget
does a banner not appear? (example 3). I thought it should work as I have the "media.object" using "ShowTitle". Or is using "ShowTitle" not a "media.object"?

Cheers

Ben
Attached Images
File Type: jpg Example 2.jpg (156.7 KB, 148 views)
File Type: jpg Example 3.jpg (143.5 KB, 146 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #12  
Old 04-24-2009, 05:09 PM
Peter_h Peter_h is offline
Sage Fanatic
 
Join Date: May 2008
Location: Kailua, HI
Posts: 798
Quote:
Originally Posted by Opus4 View Post
Hmmm... I think you need some sort of introduction to basic programming, at least for Java, but I'm not sure where to point you... maybe someone else does?

You are talking about comparisons, where '==' means "Is equal to?" and '!=' means "is not equal to?", '&&' is "AND". Such comparisons have a precedence order, but parentheses can override that or simply make it clearer which comparisons you want done first... sort of like using them in math, where

5 + (7 * 3) equals 5 + 7 * 3

But
(5 + 7) * 3 does not equal 5 + 7 * 3

- Andy
Hey Ben,

Regarding this, you might want to take a look at Sage Job Queue. It's another thing to setup but it's based on a very basic programming language structure such as above.

Slugger has done a really good job of making the language easy to understand and his how to's and documentation are fantastic.

Most of the SJQ users have never touched any programming code and are usually up and running with some basic code sets in a half hour or so.

It's a pretty quick way to get your basic programming foundation in order and it's a utility you will probably really like and end up using.
Reply With Quote
  #13  
Old 04-24-2009, 05:36 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
I've never seen this before, it looks very complicated but I'll give it a go tomorrow. The documentation is absolutely great, especially the "Available Tests" and "Example" sections.

Thanks for pointing this one out


Quote:
Originally Posted by Peter_h View Post
Hey Ben,

Regarding this, you might want to take a look at Sage Job Queue. It's another thing to setup but it's based on a very basic programming language structure such as above.

Slugger has done a really good job of making the language easy to understand and his how to's and documentation are fantastic.

Most of the SJQ users have never touched any programming code and are usually up and running with some basic code sets in a half hour or so.

It's a pretty quick way to get your basic programming foundation in order and it's a utility you will probably really like and end up using.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #14  
Old 04-24-2009, 07:30 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by MeInMaui View Post
RE:Post 6

Airing is just another variable defined in that screen. It could have been name Elephant. As a result of the logic leading up to that point, the Airing variable contains the sage Airing Object for the show of interest. You have to set up all of that logic in your screen.
hazaar I did it

It took awhile but I now have the ability to use the Sage API "Show" with Airing i.e GetShowTitle, GetShowYear and best of all phoenix_api_GetFanartBanner(Airing) etc.

I'm still having an issue with only using a "RefreshArea" action but I'm going to take a wild guess and say I need to be using "GetFocusContext()". Any more tips Mike? Your hints always did get the job done in a timely fashion, not too easy but not too hard

I've attached a screenshot of the code.

Cheers

Ben

Edit:

Perhaps I'm trying too hard but I've changed the "RefreshArea" to just "Refresh" and although it does work it becomes slower to navigate. Any pointers on which is the best method to refresh the focused items data/images.

Edit 2:

Just thought I'd say thankyou for all the help I've had tonight, its come in very handy. I've atached another screenshot showing what it looks like now, obviously some of the text is incorrect but it shows the look I'm after. Its 04.15 so time for bed

Thanks again.
Attached Images
File Type: jpg Some Progress.jpg (141.7 KB, 156 views)
File Type: jpg Semi-Final Design.jpg (184.1 KB, 142 views)
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders

Last edited by jaminben; 04-24-2009 at 09:17 PM.
Reply With Quote
  #15  
Old 04-25-2009, 02:24 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
Quote:
Originally Posted by Opus4 View Post
Hmmm... I think you need some sort of introduction to basic programming, at least for Java, but I'm not sure where to point you... maybe someone else does?
Here's where I'd start: Learning the Java Language

Bear in mind that the expressions you see in widget code are not strictly speaking Java, but the general concepts and expression syntax are similar.

You really can't get very far in Studio coding without understanding the fundamentals of programming, i.e. variables, expressions, function calls, and so on. So whether or not you plan to do any programming outside of Studio, you do need to master the basics.
__________________
-- Greg
Reply With Quote
  #16  
Old 04-25-2009, 02:51 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by GKusnick View Post
Here's where I'd start: Learning the Java Language

Bear in mind that the expressions you see in widget code are not strictly speaking Java, but the general concepts and expression syntax are similar.

You really can't get very far in Studio coding without understanding the fundamentals of programming, i.e. variables, expressions, function calls, and so on. So whether or not you plan to do any programming outside of Studio, you do need to master the basics.
Sweet, Thanks Greg. I'll take a look at those tutorials, all info is greatly appriciated. I think once I start to understand the fundamentals making imports should become alot clearer. At the moment its like trying to learn Chinese, hard but not impossible.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #17  
Old 04-25-2009, 08:55 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Glad you figured out your airing issue

I noticed you are not addingstaticcontext

How are you setting your airing and such?

Also you might want to name your refresh sections different from you set variables ie episodecount

As for the refreshing it looks right to me maybe there is an easier way to do it I would like to know as i do the same and call out all of the areas i need refreshed in focus gained.

I had figured out most of what you posted I guess video library was a little more detailed in that area.

I am by now means on expert I use to code in c++ heavily but that was 12 years ago

I code reports daily in Crystal reports which gives me a great understaning of some of the calls but I am still confused at times.
Reply With Quote
  #18  
Old 04-25-2009, 09:16 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Quote:
Originally Posted by PLUCKYHD View Post
I noticed you are not addingstaticcontext
Thats what I'm reading about now but its not making much sense just at the moment. I think this would be the correct way to do it but I'm only guessing.

Quote:
Originally Posted by PLUCKYHD View Post
How are you setting your airing and such?
Using a FocusGained hook and

Code:
Airing = (GetElement(GetSubgroup(RecordedFiles, GroupedFiles), null))
I also placed an Attribute widget in the base of the menu named "Airing" with a value of "null".

Quote:
Originally Posted by PLUCKYHD View Post
Also you might want to name your refresh sections different from you set variables ie episodecount
Why? I only picked that name so I could remember what it was for, I'm not sure if its wrong or right but it does work.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
Reply With Quote
  #19  
Old 04-25-2009, 11:27 AM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
AddStaticContext() is used to pass variables to another menu. So if you wanted to pass the current contents of Airing to another menu, you would call

Code:
AddStaticContext( "Airing" , Airing)
followed by the link to the next menu. This will take the contents of Airing and pass it to the variable named "Airing" in the next menu. This is a case where I'd define an attribute in the next menu with the name and value set to Airing. This will allow it to accept the passed value without resetting it to some particular value. You could also leave Airing undefined in the next menu and rely on the AddStaticContext() call to define it, but I tend to confuse myself if I do that.

Also, I suggest going through all of the Studio tutorials if you haven't done it yet. They are very helpful for getting a handle on the basics.

Aloha,
Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)
Reply With Quote
  #20  
Old 04-25-2009, 01:29 PM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Thanks Mike, that makes sense....sort of I haven't gotten as far as adding the link for the following menu so I'll leave that alone for now.

I've noticed some discrepencies in my code which isn't allowing me to view recorded TV as well as imported TV shows Back to the drawing board I guess.
__________________
Server - Win7 64bit, 2.4Ghz Intel Core 2 Duo, TBS 6284 PCI-E Quad DVB-T2 Tuner, 3 x HD200 & 1 x HD300 extenders
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
Studio and SageMC Questions bama SageMC Custom Interface 4 07-26-2008 01:11 PM
Silly Newbie Question: Starting Studio willetin SageTV Studio 2 01-05-2008 08:21 AM
Studio Newbie Question mightyt SageTV Studio 4 01-30-2006 01:52 AM
Some questions about the upcoming Studio. ToxMox SageTV Customizations 26 06-08-2004 09:00 AM


All times are GMT -6. The time now is 08:07 PM.


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