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 08-04-2009, 11:05 AM
APillowOfClouds APillowOfClouds is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 236
Simple example needed

I have been a programmer for many years and have worked with all sorts of various API's, scripting languages and tools, but I tried my hand at studio last night and for some reason it's just not clicking for me - not saying the docs aren't good, they're just not working for me.

What I could use that I think would get me well on my way is a small stv that has a button to push and when you push it it prints something or pops something up. I'm just not getting the event flow and the sample stv and manual don't seem to have very clear cut language on how to create a button and handle a click, unless I'm just missing it.

Advance request - please don't tell me to RTM I spent last night RTM.

TIA

Rob
Reply With Quote
  #2  
Old 08-04-2009, 11:15 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Did you try the Tutorial STV? I found that pretty good to get started, and then try using the Default or SageMC STV for more advanced stuff..

Thanks,
Jeff
Reply With Quote
  #3  
Old 08-04-2009, 11:19 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by APillowOfClouds View Post
I have been a programmer for many years and have worked with all sorts of various API's, scripting languages and tools, but I tried my hand at studio last night and for some reason it's just not clicking for me - not saying the docs aren't good, they're just not working for me.

What I could use that I think would get me well on my way is a small stv that has a button to push and when you push it it prints something or pops something up. I'm just not getting the event flow and the sample stv and manual don't seem to have very clear cut language on how to create a button and handle a click, unless I'm just missing it.

Advance request - please don't tell me to RTM I spent last night RTM.

TIA

Rob
I will second what jeff said run throught the tuturials they help allot and studio has a learning curve but once you get it down it is pretty nice.
Reply With Quote
  #4  
Old 08-04-2009, 11:21 AM
APillowOfClouds APillowOfClouds is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 236
Quote:
Originally Posted by jphipps View Post
Did you try the Tutorial STV? I found that pretty good to get started, and then try using the Default or SageMC STV for more advanced stuff..

Thanks,
Jeff
Yup, went through some examples in it and also looked through some of the default stv. I guess the heart of what I don't understand is the exact relationship between and appropriate arranging of a button, listener, action and text object - let's say I want to have a single button on the screen, click it and have the action place the current date/time in the text object. When I read the manual it sounds like the button should be a child of the listener but that's not an allowed relationship, and when I make the listener a child of the button or both of them the child of a panel it doesn't seem to do anything. The only thing I could get working was an action with a textbox as a child to print the time with no button. I looked at the example where they have a button that toggles full screen but it wasn't obvious to me how to generalize that to my example.


Again, not to be belligerent but just for clarity, I have read the manual and gone through the tutorial.

Last edited by APillowOfClouds; 08-04-2009 at 11:23 AM.
Reply With Quote
  #5  
Old 08-04-2009, 11:27 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
Usually a button is an "item" widget, and the children will either display the text/image within the size of the Item, and for the action, you can just put an "action" widget under a "item" widget that will be executed when it is selected, or you can use a "listener" widget using the various options, such as "select" and have the action widgets under the listener that will be executed unpon selection...

for example:

-Item Widget
>>> - Text Widtet ( Display the text on button )
>>> - Listener("Select") widget
>>>>>> - Action widget ( code that will be executed )

How that makes sense...

Last edited by jphipps; 08-04-2009 at 11:31 AM.
Reply With Quote
  #6  
Old 08-04-2009, 11:41 AM
jaminben jaminben is offline
Sage Icon
 
Join Date: Sep 2007
Location: Norwich, UK
Posts: 1,754
Send a message via MSN to jaminben
Another way to create a button using properties is shown in my attached example. There's quite a few different ways to create buttons but it really depends on what you want the button to do and if you want to permantly affect a screen item or not.

Cheers

Ben
Attached Files
File Type: zip A test button.zip (930 Bytes, 158 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 08-04-2009, 11:58 AM
APillowOfClouds APillowOfClouds is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 236
Quote:
Originally Posted by jphipps View Post
Usually a button is an "item" widget, and the children will either display the text/image within the size of the Item, and for the action, you can just put an "action" widget under a "item" widget that will be executed when it is selected, or you can use a "listener" widget using the various options, such as "select" and have the action widgets under the listener that will be executed unpon selection...

for example:

-Item Widget
>>> - Text Widtet ( Display the text on button )
>>> - Listener("Select") widget
>>>>>> - Action widget ( code that will be executed )

How that makes sense...
Thanks for the example. Does selection = click/enter or will the action be done if I just tab to the button?
Reply With Quote
  #8  
Old 08-04-2009, 12:00 PM
APillowOfClouds APillowOfClouds is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 236
Quote:
Originally Posted by jaminben View Post
Another way to create a button using properties is shown in my attached example. There's quite a few different ways to create buttons but it really depends on what you want the button to do and if you want to permantly affect a screen item or not.

Cheers

Ben
Thank you Ben, I will try your sample file when I get home tonight.
Reply With Quote
  #9  
Old 08-04-2009, 12:04 PM
MeInMaui's Avatar
MeInMaui MeInMaui is offline
SageTVaholic
 
Join Date: Feb 2005
Location: Maui. HI
Posts: 4,203
Quote:
Originally Posted by APillowOfClouds View Post
Thanks for the example. Does selection = click/enter or will the action be done if I just tab to the button?
By default actions are executed when you click or hit Select. You can override the default behavior by placing mouse click and/or Select listeners in the item. This might be useful if you want a click to do one thing and the Select to do something else. You can also add code to a FocusGained and/or FocusLost hook to execute actions when the item receives/loses focus. HTH

Aloha,
Mike
__________________
"Everything doesn't exist. I'm thirsty." ...later... "No, it's real!!! I'm full."
- Nikolaus (4yrs old)

Last edited by MeInMaui; 08-04-2009 at 12:07 PM.
Reply With Quote
  #10  
Old 08-04-2009, 12:42 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Rob,

I feel your pain. I'm just learning Studio and it is a bit "odd". What's worked for me is to find something in the default STV that does what you are trying to do, and then study the code to see how it's done.

If not done already, I'd highly suggest installing Greg's "Tools for Studio users". I have stress-tested the search function and it works quite well

I am also very grateful that there are so many helpful people on these forums. I hope someday I can answer questions instead of asking them.

Tom
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #11  
Old 08-04-2009, 12:54 PM
APillowOfClouds APillowOfClouds is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 236
Quote:
Originally Posted by tmiranda View Post
Rob,

I feel your pain. I'm just learning Studio and it is a bit "odd". What's worked for me is to find something in the default STV that does what you are trying to do, and then study the code to see how it's done.

If not done already, I'd highly suggest installing Greg's "Tools for Studio users". I have stress-tested the search function and it works quite well

I am also very grateful that there are so many helpful people on these forums. I hope someday I can answer questions instead of asking them.

Tom
I'll check that out tonight, thanks. I'm hoping I can share my results with all the nice people here - what I want to do is make a tool that lets you choose a source and destination folder and move shows in the database from one to the other - I am about to switch servers and my share names are going to be different. I know there are plenty of FAQ's on how to move shows but they're not always guaranteed - I want something that I know willl work and be instant, or at least instant-ish. I figure if building such a thing is possible there are others that would want to use it too.

Needless to say at the moment I'm planning to build the Hoover Dam but I'm just learning which end of the trowel to use :-D
Reply With Quote
  #12  
Old 08-04-2009, 07:40 PM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
I don't think the studio code will help you much to move them, that code is part of the import process in the internals of Sage. I don't believe you can updated any of that data in the database. The FAQ for the migration has listed a parameter that you set in the properties file that will reconnect the media objects if you move them to a different drive and correct the path without loosing any media information...

Thanks,
Jeff
Reply With Quote
  #13  
Old 08-04-2009, 08:35 PM
APillowOfClouds APillowOfClouds is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 236
Quote:
Originally Posted by jphipps View Post
I don't think the studio code will help you much to move them, that code is part of the import process in the internals of Sage. I don't believe you can updated any of that data in the database. The FAQ for the migration has listed a parameter that you set in the properties file that will reconnect the media objects if you move them to a different drive and correct the path without loosing any media information...

Thanks,
Jeff
The problem with that parameter is that it doesn't always work, and even worse the shows don't seem to show up immediately even when it does work, so you don't really know what has transferred and what hasn't. I am by no means an expert on the API having just started messing with it, but I'm pretty sure I saw some calls to add and remove airings of a show, which would be all I would need. It's a little more complicated because there are multiple files, but if nielm's web api can do it I should be able to I think (hope)

At the very least I'll learn how to write add ons

Tx
Rob
Reply With Quote
  #14  
Old 08-05-2009, 03:57 AM
jphipps jphipps is offline
Sage Expert
 
Join Date: Aug 2006
Location: Maryland
Posts: 512
If you know java, you may be better off using java to write what you are looking for. I usually put the complex logic in java and call it from the STV. There is a pretty good post in the studio forum that has the basics of using java to call the sage api.

Thanks,
Jeff
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
Why can'th this be simple ... NEED HELP !!! robhix SageTV Software 3 12-20-2008 06:11 PM
Simple Question vanchie21 SageTV Software 2 11-14-2008 10:04 PM
Needed: A Good, Simple, MPEG Editor fidget General Discussion 6 06-20-2006 11:46 AM
Simple Sage? galtigor SageTV Customizations 4 09-08-2004 10:59 AM


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


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