|
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 |
#1
|
|||
|
|||
When setting or getting property
Do numbers have to be in quotes like words do?
|
#2
|
||||
|
||||
No. You don't need to put true and false in quotes either.
But, you should be aware that if you are going to any math with a numerical property value, you should multiply it by 1 after getting the property to make sure it gets converted to a number rather than remains as a string. Use: GetProperty("SomePropName",DefaultNum)*1 Because: "12" + 5 != 12 + 5 Edit: for very large numbers, see the tip in the Studio PDF manual, around p. 155. - 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. |
#3
|
|||
|
|||
Okay but that is only if I am doing math correct?
I am setting a transparancy property so I would set it just numbers no quotes. Then when I call for it on the items transparancy =GetProperty("propertyname") correct? |
#4
|
||||
|
||||
I probably should have left out the "math" comment... you are probably safe using it w/o multiplying by 1 (just try it), but I've learned to do that when I want to make sure it is a number so I don't accidentally make a mistake with the value at some future time if I were to modify the code.
And, don't forget that GetProperty("propertyname") needs a default value. - 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. |
#5
|
|||
|
|||
Yeah I got the default value set on the propert value
I don't need to call a default again when calling in the translucent area do I? Thanks for all your help |
#6
|
||||
|
||||
While the *1 hack does work, I prefer something along the lines of java_lang_Integer_parseInt(GetProperty(...)). It's more typing, but it makes the intention crystal clear to anybody reading the code.
__________________
-- Greg |
#7
|
||||
|
||||
GetProperty() require two arguments, so you must pass two arguments on every call.
__________________
-- Greg |
#8
|
|||
|
|||
Talk about throwing allot code at me
By the way the *1 did the trick. |
#9
|
||||
|
||||
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. |
#10
|
||||
|
||||
Another option might be a family of API methods along the lines of GetPropertyAsInt(), GetPropertyAsFloat(), etc. That makes the intention clear with a minimum of extra typing (for us, anyway; not for the person who writes the API docs).
__________________
-- Greg |
#11
|
|||
|
|||
Okay kind of a relates question what about when setting or getting property's for animation such as
CacheFocus or LayerForeGround Do these need quotes. I have tried it both but when I call the property in animation it does work using =GetProperty("propertyname","CacheFocus") But that doesn't seem to work I can tell the propert is getting set from the properties file. thanks |
#12
|
||||
|
||||
Check out the Animation widget property description in the Studio PDF manual, around p. 21.
I'm not sure if it is clear to anyone other than me, but the manual should indicate that if you use a dynamic value for the Animation property, then it means the widget should animate when the expression evaluates as 'true'. So, you can't assign animation layer names that way. What are you trying to accomplish? - 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. |
#13
|
|||
|
|||
Okay good to know. I see what is says on page 21 but it says "more explained on this later"
So I need a true or false expression that is easy enough but I don't fully understand "With dynamic properties, animation will occur whenever the expression after the equal sign" So I am trying to turn CacheFocus on or off based on a property so would the correct coding be CacheFocus = GetProperty ("PropertyName") |
#14
|
||||
|
||||
As I said in my last post: "you can't assign animation layer names that way". You either give the Animation property a layer name or it acts as a property to fire an animation.
I'm not sure I understand why the layer of a widgets needs to change. If you explained what you are trying to do, maybe someone would have a suggestion. You could always use a conditional leading up to the widgets to be shown in different ways. - 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. |
#15
|
|||
|
|||
Quote:
|
#16
|
|||
|
|||
Question about math and integers
I am having an issue. I set a attribute widget to a property with a number
which is 2500 I then call that property later time = GetProperty("property",2500) + 50 but the result I get is 250050 not 2550? * merged; this was discussed above * |
#17
|
|||
|
|||
properties are all strings... you need to do the *1 workaround discussed above.
__________________
Server 2003 r2 32bit, SageTV9 (finally!) 2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast) 2x HD300, 1x SageClient (Win10 Test/Development) Check out TVExplorer |
#18
|
|||
|
|||
Yeah I stupidly didn't think before posting this morning. I used the integer and got it to work
|
#19
|
||||
|
||||
It's not so much that the properties are stored in the file as text. The relevant fact is that GetProperty() is documented as returning a java.lang.String, so any operation performed on that result will be interpreted as a string operation (regardless of what's in the file).
__________________
-- Greg |
#20
|
|||
|
|||
Quote:
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
added property ...... where?? | Stuntman | SageTV Beta Test Software | 0 | 02-01-2008 12:42 AM |
experimental_video_thumbnail_generation property? | popechild | SageTV Software | 7 | 06-29-2006 05:30 PM |
Property setting to reconstruct a graph? | Kirby | Hardware Support | 0 | 06-05-2006 06:05 PM |
What is this new property? | mlbdude | SageTV Beta Test Software | 22 | 04-07-2004 09:23 PM |