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 05-01-2007, 11:54 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
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
Reply With Quote
  #2  
Old 05-02-2007, 12:11 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
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.
Reply With Quote
  #3  
Old 05-02-2007, 12:43 AM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
Quote:
Originally Posted by Opus4 View Post
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.
Is there a way to remove the cached version of the Menu?

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
Reply With Quote
  #4  
Old 05-02-2007, 01:09 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
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.
Reply With Quote
  #5  
Old 05-02-2007, 01:41 AM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
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
Reply With Quote
  #6  
Old 05-02-2007, 10:20 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
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
Attached Images
File Type: png TextAlign.png (27.7 KB, 318 views)
__________________
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
  #7  
Old 05-03-2007, 12:45 AM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
Quote:
Originally Posted by Opus4 View Post
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.

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
Reply With Quote
  #8  
Old 05-03-2007, 01:07 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by JREkiwi View Post
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.
You think I haven't done that before too? What I do all the time is send the name of an API call as a method to a sort or filter call & forget to put quotes around the function name. Then there's the old programming error of "if var1 = var2", which doesn't quite check for equivalence. And...

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.
Reply With Quote
  #9  
Old 05-03-2007, 02:24 AM
GKusnick's Avatar
GKusnick GKusnick is offline
SageTVaholic
 
Join Date: Dec 2005
Posts: 5,083
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
Reply With Quote
  #10  
Old 05-03-2007, 09:35 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by GKusnick View Post
Just out of curiosity, why is = even necessary?
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.
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
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


All times are GMT -6. The time now is 01:55 AM.


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