Posts: 752
Threads: 156
Joined: Aug 2006
I'm working on setting up a SqueezeBox UI. I have 4 players around the house. I have setup a GVar to track the current zone. The value of that variable is the same as the text name of the driver for that player. I have used the XLat on the template to map the playlist, playlist items, and volume slider to use the current value of the variable.
This works fine when loading up the template (I set a default value on load), but when I select other zones nothing happens. How do I force the playlist, volume slider, and playlist items vertical lists to update?
Posts: 40,416
Threads: 489
Joined: Aug 2002
Xlat only works when you reload the template. They are not dynamically happening all the time.
Dean Roddey
Explorans limites defectum
Posts: 1,763
Threads: 76
Joined: Jun 2007
If you are on the latest beta and these are field based widgets you can use the LinkToField action to change the field assocation of the widget at runtime. Since the GVar is the name of the driver than it makes it easy to do. Just use LinkToField:

%(GVar:Moniker).FieldName).
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Posts: 752
Threads: 156
Joined: Aug 2006
Dean Roddey Wrote:Xlat only works when you reload the template. They are not dynamically happening all the time.
How are the states of buttons on the template maintained? Each time I load it do I need to check a GVar and re-set the button/selector state for each possible zone?
Posts: 40,416
Threads: 489
Joined: Aug 2002
I'm not sure I understand what you are asking?
Dean Roddey
Explorans limites defectum
Posts: 752
Threads: 156
Joined: Aug 2006
I think I figured it out. My problem was that for each source button I had an action setup to change its text to red and the other buttons to black. This allowed me to keep the state of what was selected. To fix that I changed each button to just set the GVar:SelectedZone and then reload the template. I also moved the color setting code to the load event for the template and first set all to black and then have a big if/else/if/else/if/else statement to set the selected button to have red text.
Is there a way to use an XLat to set the Fgn color of a button? Can I have it so GVar:SelectedZone=Foo means that Button1 should have a Fgn1 = Red?
Posts: 40,416
Threads: 489
Joined: Aug 2002
In the latest betas you can have variable based widgets. But text color is not something that's driveable in a dynamic way even wtih field based widgets.
You could make up some images that have the text in each color, then make the buttons be variable based check boxes. That would do it. Set them to have no text, just the true/false images, which are the red/non-red images for true and false. They would then change based on the value of the variable. That would require being on the latest beta version.
Dean Roddey
Explorans limites defectum
Posts: 752
Threads: 156
Joined: Aug 2006
I like that idea. Right now though I just finally got the UI setup and things mostly working. I think I'm going to wait a bit before possibly de-stabilizing things :-)
if my date plans fall apart that may be as early as Friday :oops: