Volume bar on offline TP
Jeff
Posts: 374
I"m controlling volume in a room using an AMX Vol Card. I have two volume buttons on my touchpanel, one of them is invisible and the other has the graphic of the volume slider moving.
I can't remember exactly why I ended up doing things this way but I remember there being issues with me being unable to control it like I wanted with just one active button.
The problem here is that every time the panel goes offline, it sends a level event for dvTP,2 where level.value is 0. This basically means that if the panel goes offline for any reason, the volume in the room is suddenly 0. I'd like to find a way to avoid that. I can probably create a clunky workround by every 5 seconds storing the level to another variable (nVolumeBackup) and the in the offline event of dvTP setting nVolume to nVolumeBackup and sending nVolume to the VolCard again, but I was wondering if anyone had run into this before and come up with something a little more elegant.
Thanks for your help
J
level_event[dvTP,2] //If the volume bar is touched { nVolume=level.value //Store the volume send_level dvVolume,1,nVolume //Send the level to the Volume card send_level dvTP,1,nVolume //Send the level to the level display }
I can't remember exactly why I ended up doing things this way but I remember there being issues with me being unable to control it like I wanted with just one active button.
The problem here is that every time the panel goes offline, it sends a level event for dvTP,2 where level.value is 0. This basically means that if the panel goes offline for any reason, the volume in the room is suddenly 0. I'd like to find a way to avoid that. I can probably create a clunky workround by every 5 seconds storing the level to another variable (nVolumeBackup) and the in the offline event of dvTP setting nVolume to nVolumeBackup and sending nVolume to the VolCard again, but I was wondering if anyone had run into this before and come up with something a little more elegant.
Thanks for your help
J
0
Comments
- create a channel number for your sliders (example: 800)
- create a button_event in your volume module/include/whatever on channel 800
- on pushing the slider, set a variable to ON[], when releasing the slider, set it to OFF[]
like this:
- now, in your level_event, make a check for nLevelActive
it now only send volume when slider is actually pressed, and not when panel goes offline.
Don't forget to send volume back to panel when it comes online
I knew there was a reason i did the invisible graph, just couldn't remember why Great idea on the button, thats what I'll do
J
I always set the level function to drag so that it won't jump to a high or low volume when someone accidentally touches the bargraph since they actually have to drag it, and so the users finger doesn't block the volume feedback that is centered in the bargraph. I also don't change the volume until the user has released the bargraph button, whereupon I send a discrete volume command. This way slower devices don't constantly try and ramp their volume depending on where the user has the bargraph (no device I have found does this well), but it still gives the illusion that it is 'active' if you know what I mean.
Paul
if you set the ramp time (i think) to more than 1 second, that problem is solved too. If you set it to 10 seconds and touch the bargraph at the top, it will take 10 seconds for it too reach maximum