EXTRON MVC121
playskool1
Posts: 64
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" } } }
0
Comments
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.
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"
}
}
}
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")
}
}
}
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)