Home AMX User Forum NetLinx Studio

EXTRON MVC121

got my volume to ramp up and down but the mute button does not toggle. once it is pushed it mutes but will not unmute.
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@__PROGRAM_VOL_CONTROL__@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
BUTTON_EVENT[dvTP_202,VolButtons]{
    PUSH:{
	SWITCH(GET_LAST(VolButtons)){
	    CASE 1: SEND_STRING dvMVC,"'+V/v',$0D"
	    CASE 2: SEND_STRING dvMVC,"'-V/v',$0D"
	    CASE 3: SEND_STRING dvMVC,"'3*1!',$0D"
	}
    }
    HOLD[1,REPEAT]:{
	SWITCH(GET_LAST(VolButtons)){
	    CASE 1: SEND_STRING dvMVC,"'+V/v',$0D"
	    CASE 2: SEND_STRING dvMVC,"'-V/v',$0D"
	}
    }
}

Comments

  • SEND_STRING dvMVC,"'3*1!',$0D" //1=ON (unmute)

    SEND_STRING dvMVC,"'3*0!',$0D" //0=OFF (mute)

    SEND_STRING dvMVC,"'3*2!',$0D" //2=mute by contact closure

    i know the protocols go like that.
  • toddttoddt Posts: 28
    That is becasue you have to create a toggle function, right now you are just turning on the mute, but don't have anything that would unmute it.

    You could do it this way.

    Define_Variable
    nMute

    BUTTON_EVENT[dvTP_202,VolButtons]{
    PUSH:{
    SWITCH(GET_LAST(VolButtons)){
    CASE 1: SEND_STRING dvMVC,"'+V/v',$0D"
    CASE 2: SEND_STRING dvMVC,"'-V/v',$0D"
    CASE 3:
    {
    IF(Mute = 0)
    {
    SEND_STRING dvMVC,"'3*1!',$0D"
    Mute = 1
    }
    Else
    {
    SEND_STRING dvMVC,"'3*0!',$0D"
    Mute = 0
    }
    }
    }
    HOLD[1,REPEAT]:{
    SWITCH(GET_LAST(VolButtons)){
    CASE 1: SEND_STRING dvMVC,"'+V/v',$0D"
    CASE 2: SEND_STRING dvMVC,"'-V/v',$0D"
    }
    }
    }
  • Thomas HayesThomas Hayes Posts: 1,164
    Example from Extron crosspoint, looks like you need a tracking varible.

    BUTTON_EVENT[VTP,203]
    {
    PUSH:
    {
    IF(AUD_MUTE=0)
    {
    SEND_STRING SWT,SWT_AUDIO_MUTE
    AUD_MUTE=1
    [VTP,203]=AUD_MUTE
    SEND_LEVEL VTP, 1, 0
    }
    ELSE
    {
    SEND_STRING SWT,SWT_AUDIO_UNMUTE
    AUD_MUTE=0
    [VTP,203]=AUD_MUTE
    SEND_LEVEL VTP , 1, ATOI("MM_SWT")
    }
    }
    }
  • enelsonenelson Posts: 5
    Yet another approach

    Define_Variable
    mute

    BUTTON_EVENT[dvTP_202,VolButtons]
    {
    PUSH:
    {
    SWITCH(GET_LAST(VolButtons))
    {
    CASE 1: SEND_STRING dvMVC,"'+V/v',$0D"
    CASE 2: SEND_STRING dvMVC,"'-V/v',$0D"
    CASE 3:
    {
    mute=!mute // toggle the mute variable
    SEND_STRING dvMVC,"'3*',mute,'!',$0D" // build the string with the mute value
    }
    }
    }
    HOLD[1,REPEAT]:
    {
    SWITCH(GET_LAST(VolButtons))
    {
    CASE 1: SEND_STRING dvMVC,"'+V/v',$0D"
    CASE 2: SEND_STRING dvMVC,"'-V/v',$0D"
    }
    }
    }

    // in your mainline
    [dvtp_202,mute_button number]=(mute=1)
Sign In or Register to comment.