PDA

View Full Version : Thumbslider events



JBrett
December 2nd, 2008, 11:26 PM
I have a "Slider Thumb Component" that I added an LUA action of "Execute lua code (OnDown)", I need some LUA functionality to set a variable so I know what slider I'm using, etc., that way when the slider is released the right function is performed. However, it doesn't seem that the LUA code I added is actually executed, as the values do not change. If I create a button with the same code, the values change fine, but obviously I don't want to have to push a button first, then manipulate the slider. Is this a known problem, and is there a "good" way around this?

Thanks,
Brett

Rob H
December 3rd, 2008, 03:53 AM
This is known behaviour - not sure if I can easily change that without screwing something else up. However, when you move the slider a NetRemote variable's value will be changed anyway. I'm not clear why you need to know which slider is changing, can you expand on that and maybe we can find a workaround.

BTW this is in the wrong forum as it's a NetRemote issue rather than a Designer one.

JBrett
December 3rd, 2008, 10:24 PM
Rob,
Sorry about the wrong forum, I didn't think it through, as NetRemote Designer was the last thing I was dealing with, do you want me to move this?
As far as what brought the situation up was I was making a single page that controlled all my Receiver Zone volumes through DM. It seemed (although I could be wrong) that only Zone 1 was being controlled, then I found the function ReceiverSetZone, that I could use to set the zone I wanted to control, the idea was to call ReceiverSetZone on MouseDown on the slider, then when the slider was "slid" the DM would set the volume (OnMouseUp) for the correct zone. Admitedly I haven't yet researched enough if there is a better way to control multiple receiver zones on a single page, but when I noticed this behaviour I saw shortcomings of other ideas I had in the future, (i.e., when I click to change the volume on a particular zone, I could highlight and set active the zone on the screen I was manupaling for future controls. If there is a "right" way to manipulate multiple receiver zones through DM on a single page, that work for now, and please let me know, but I can see where I would want this "button" functionality in the future, but don't break anything :) If that is the way it is going to be at least I know, but maybe there could be something in the "actions" pane that indicates this.

Thanks,
Brett

Rob H
December 4th, 2008, 04:27 AM
The usual technique here is to use <> notation ie you have a NetRemote variable that contains the name of the zone - let's say that the variable is called ReceiverZone - you would then create a frame with the name <ReceiverZone>.

In this frame you put all the controls that relate to a zone e.g. a volume slider with the name <^>\Volume (as the slider thumb variable).

When you change the value of the ReceiverZone variable you call NetRemote.Rebind() e.g.


NetRemote.SetVariable('ReceiverZone', [[buffy\Denon2805!Main]])
NetRemote.Rebind()

After this code is executed the frame mentioned above will have the name buffy\Denon2805!Main and the slider thumb will be called buffy\Denon2805!Main\Volume

You will also have to use NetRemote.RegisterVariableWatch to set the slider up for feedback (and also NetRemote.UnregisterVariableWatch or the equivalent to remove any previous variable watch on the old volume control).

I hope this makes sense to you.