Home AMX User Forum AMXForums Archive Threads Tips and Tricks

Volume Up, Down, Bargraph logic. Hold Event Issues



Please find attached module for Pioneer Receiver SC09. The module works but i want to fine tune the Volume Up, Down and bargraph.

1. Volume up and down should be an increment of 1 and based on how much time the user holds, like for 3 seconds, 5 seconds, the increment will be 3, 5 respectively.

2. Volume feedback should be updated on the bargraph without volume going up and down due to the query command.

Any best practice methods for volume.

Comments

  • the8thstthe8thst Posts: 470
    Make the bargraph display only. Then put two invisible buttons for vol up/down on top of it. This allows the user to press the top half of the bargraph to increment and the bottom have to decrement the volume.
  • ajish.rajuajish.raju Posts: 185
    Here the user wants to emulate like a tv remote for volume up and down. When you press once for up or down, it increments or decrements by 1. But if you hold, then it speeds up or down by 1 but you will reach maximum or minimum volume in 15 seconds or less.

    User also wants to use the bar graph to set to a high or low value without push or hold by setting a value in the bargraph which will be even faster.
  • John NagyJohn Nagy Posts: 1,742
    Faster but dangerous.
    If a stray touch can set the volume to 100%, you are setting the customer up for new speakers and screaming children.
  • ajish.rajuajish.raju Posts: 185
    Thats true but the volume high limit is always set to lower than a speakers capacity.
  • a_riot42a_riot42 Posts: 1,624
    This all sounds like very standard stuff. What specific problem are you running into in implementing that?
    Paul
  • ajish.rajuajish.raju Posts: 185
    Facing the following issues.

    1. I have put a hold of 3,repeat where i increase/decrease the level by 5 respectively. Now what happens is push goes by 1 and it skips due to hold by 3. The objective of hold was to speed up the volume process.

    2. Now based on feedback, i am sending a level command to update the bargraph but there is also a level event also programmed. So volume up will send value for 50 but volume feedback will come for 49 , so level event will set volume back to 49 and so forth.

    I tried a timeline which will be killed in release and created in push but its also not working smooth.
  • ericmedleyericmedley Posts: 4,177
    Make two levels (different ids) on the TP. One for feedback only. The other for changing the level. Make the changing level fader transparent and place it directly over the fader for display.
  • mpullinmpullin Posts: 949
    Don't use a timeline. You should be able to accomplish all of what you're saying in the repeating button hold event.
  • ericmedley wrote: »
    Make two levels (different ids) on the TP. One for feedback only. The other for changing the level. Make the changing level fader transparent and place it directly over the fader for display.

    what he said ^^^
  • travtrav Posts: 188
    For your tap and hold thing......

    Just do the Individual 'TAP' volume on the release event, and disregard the Push, and use a flag in the HOLD

    [PHP]

    BUTTON_EVENT[dvTP,VOL_UP]
    {
    HOLD[3,REPEAT]:
    {
    //SET FLAG TRUE
    // BIG JUMP CODE HERE
    }

    RELEASE:
    {
    IF(!FLAG)
    // Little jump code here
    }
    }

    [/PHP]
  • You could also have a counter in the hold event and some logic that says if the counter is above 5, then the step is 3, and if the counter is above 10, then the step is 5, etc. The counter would be reset in the push event.
  • ajish.rajuajish.raju Posts: 185
    trav wrote: »
    [PHP]

    BUTTON_EVENT[dvTP,VOL_UP]
    {
    HOLD[3,REPEAT]:
    {
    //SET FLAG TRUE
    // BIG JUMP CODE HERE
    }

    RELEASE:
    {
    IF(!FLAG)
    // Little jump code here
    }
    }

    [/PHP]

    Where would you turn the flag to false.

    Since i am trying to run the level event via a comm module using snapi constants. This level event functions as required.
    [PHP]
    LEVEL_EVENT[vdvAVR, VOL_LVL]
    {
    stack_var integer device
    device =get_last(vdvAVR)

    fnSET_VOLUME(device,itoa(level.value))
    }
    [/PHP]
    Now when i get a feedback i am sending a send_level command back to the Vol_LVL snapi constant. When i increase or decrease via the bargraph, the volume functions because i am only sending the level command via the release.
    [PHP]
    release:
    {
    SWITCH(get_last(nChan_BTN))
    {
    case 29:
    {
    send_level vdvDevices , vol_lvl,nLevel[1]
    }

    }

    }
    [/PHP]
    But push or hold is where the bargraph lags due to feedback.
  • ajish.rajuajish.raju Posts: 185
    Thank you all for your comments. I was able to incorporate into my code so that volume functions well to the client's satisfaction. I have attached the working code for your reference.
Sign In or Register to comment.