Home AMX User Forum AMX General Discussion

Volume bar on offline TP

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.
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

Comments

  • yuriyuri Posts: 861
    the way we do is as follows:

    - 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:
    BUTTON_EVENT[dvTP, 800]
    {
     PUSH:
     {
      ON[nLevelActive]
     }
     RELEASE:
     {
      OFF[nLevelActive]
     }
    }
    

    - now, in your level_event, make a check for nLevelActive
    level_event[dvTP,2] //If the volume bar is touched
    {
     IF(nLevelActive)
     {
    	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
     }
    }
    

    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 :)
  • Use a virtual device and combine the TP & Vol levels with that!
  • viningvining Posts: 4,368
    I always use two levels for bar graphs that are use to set levels as well as display. One a visable bargraph for display and an invisable active bargraph on top of the display bargraph for setting the level. Avoids a looping problem. I don't generally like touching a bargraph to set volume cuz that can be dangerous or at least very annoying when you acidentally touch it at the top which will eventually happen.
  • JeffJeff Posts: 374
    Fortunately I deal only in conference rooms, where theater level sound is never desired, so I can set the max volume in the room to not be deafening, I just make it so that the desired volume is near the top of the bargraph

    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
  • a_riot42a_riot42 Posts: 1,624
    vining wrote:
    I always use two levels for bar graphs that are use to set levels as well as display. One a visable bargraph for display and an invisable active bargraph on top of the display bargraph for setting the level. Avoids a looping problem. I don't generally like touching a bargraph to set volume cuz that can be dangerous or at least very annoying when you acidentally touch it at the top which will eventually happen.


    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
  • yuriyuri Posts: 861
    vining wrote:
    I always use two levels for bar graphs that are use to set levels as well as display. One a visable bargraph for display and an invisable active bargraph on top of the display bargraph for setting the level. Avoids a looping problem. I don't generally like touching a bargraph to set volume cuz that can be dangerous or at least very annoying when you acidentally touch it at the top which will eventually happen.

    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 :)
Sign In or Register to comment.