|
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 are Text widget properties refreshed?
I though I'd do something simple and make the text alignment in the Captions Playback import user selectable.
Easy, you say and so I thought. The code is in a chain directly off the MediaPlayer OSD Menu and I tried this partial snippet <Action Name="cctext"> <Text Name=""> <TextAlignment>=GetProperty("captions_font_align", 0.0)</TextAlignment> </Text> and it works But when I change the "captions_font_align" property to 1.0 the text still displays as left aligned. The property is getting set, as I can have the value being displayed as part of the text and it is the correct value It definitely picks up the new value on a restart of Sage and I have had it pick up the change rarely without a restart, but can't determine a reproducible sequence of events. So, my question is When are Text widget properties refreshed? and what can I do to get this value to refresh. I've tried using an attributes widget instead, loading in BeforeMenuLoad and having a action widget setting the value in the widget chain. John |
#2
|
||||
|
||||
There are some widget properties which, while capable of being dynamically set, don't update the widget's layout immediately & won't do so until the menu is reloaded from a non-cached version of that menu.
If the text is on a single line, you could try using a Panel as the text widget's parent item, then use the HorizontalAlignment setting to align the text & see if that does what you want. (You may need to set the panel to use Vertical AutoArrange.) If it really needs to be in the text widget: You could send a bug report request to see if the "Text Align" text widget property should be capable of affecting the layout on the next refresh... or, rather, if it could be changed to do so. For now (and if it isn't going to be updated by a simple refresh in a future version), you would have to reload the menu -- this is what I do when I change the number of cols/rows for tables, such as on the Prorgam Guide, media browsers, and any other screens that can be reconfigured. For an example, look at what the BeforeMenuLoad hook does for the Program Guide menu -- it uses AddStaticContext() to send the layout info to the reloaded menu & a new value forces the menu to be recreated instead of loaded from a cached version. - 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
|
||||
|
||||
Quote:
I don't want it to be really dynamic, as in, being able to change it while a video is being played. I'd just like to be able to get the property to "stick" when I change it in the Setup Options. I assume that's not happening because the MediaPlayer OSD Menu is being cached I'll try the panel options and see how they go. John |
#4
|
||||
|
||||
Send the value to the menu via AddStaticContext() every time the menu loads -- fairly easily accomplished by using the BeforeMenuLoad hook: if the static variable isn't already set or isn't set to the correct value, set the static context & load the menu again. Just don't forget to also set any other static context variables that have been sent to the menu, if there are any, or they will get cleared.
- 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
|
||||
|
||||
Thanks Andy,
I've tried the Panel method and sending the value to the menu via AddStaticContext() every time the menu loads, but it's still not getting picked up in the text widget. I had already tried a few variations of that with no success. I'll do a bug report on the "Text Align" text widget property John |
#6
|
||||
|
||||
I'm not sure what your code looks like for using the AddStaticContext() method, but I just tried it and it worked OK for me. There are probably other ways to write the code, but attached is an image of the test menus I used. It worked using the static or local var in the text widget property dialog.
You can also write the code to only use the static context variable w/o any local var, then the BeforeMenuLoad hook would simply check to see if it isn't null. If it is, set the static context & reload the same menu. I'm not entirely certain why I've been writing this type of code using the method in the image... - 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. |
#7
|
||||
|
||||
Quote:
Now that's embarrassing. In all the playing around I was doing, I'd dropped the = when I was changing from =GetProperty("captions_font_align", 0.0) to a variable in the text widget and fixing that got it working. Apologies and thanks for spending the time proving that I hadn't spent enough time checking my code. a few more for good measure John |
#8
|
||||
|
||||
Quote:
Maybe some sort of Studio Lint tool would be useful to find things that are allowable, but not really correct. - 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. |
#9
|
||||
|
||||
Just out of curiosity, why is = even necessary? The intention is perfectly clear without it. Whatever internal processing is triggered by the presence or absence of = could just as easily be triggered by the success or failure or parseInt and/or parseFloat. So requiring = doesn't add any expressive power to the widget language; all it adds is the chance to get it wrong.
__________________
-- Greg |
#10
|
||||
|
||||
I don't know... submit it. Either there is something we aren't thinking of or maybe it will get changed.
- 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. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin | deria | SageTV Customizations | 447 | 12-11-2010 07:38 PM |
Scaling Text widget size within image widget area | Morgan111 | SageTV Studio | 2 | 12-04-2006 02:16 PM |
Text input widget, copy from clipboard | nathanm | SageTV Studio | 2 | 10-27-2006 05:47 AM |
New v6 widget properties: Background Component & Scaling Insets | Opus4 | SageTV Studio | 0 | 10-17-2006 09:09 PM |
UI layout question (variable height text) | dflachbart | SageTV Studio | 5 | 08-26-2006 08:18 AM |