Deafen and Mute functionality

This commit is contained in:
David Daily 2020-04-25 02:04:59 -05:00
parent 90474792a8
commit 23ad2dc963

72
VB.ahk
View File

@ -132,48 +132,86 @@ Volume_Down::
return return
Volume_Mute:: Volume_Mute::
If GetKeyState("Media_Stop") If GetKeyState("Media_Stop") ; Mutes all output, and Comms as well for good measure. Basically a kill switch
{ {
b0M := Round(readParam("Bus[0]" . ".Mute")) b0M := Round(readParam("Bus[0]" . ".Mute")) ; Speakers
b1M := Round(readParam("Bus[1]" . ".Mute")) b1M := Round(readParam("Bus[1]" . ".Mute")) ; Headphones
cM := b0M + b1M b3M := Round(readParam("Bus[3]" . ".Mute")) ; Comms
cM := b0M + b1M + b3M
if (cM = "2") if (cM = "3")
{ { ; Unmute the ones that were unmuted before
adjustMute("Bus[0]" . ".Mute", b0Ms) adjustMute("Bus[0]" . ".Mute", b0Ms) ; Speakers
adjustMute("Bus[1]" . ".Mute", b1Ms) adjustMute("Bus[1]" . ".Mute", b1Ms) ; Headphones
adjustMute("Bus[1]" . ".Mute", b3Ms) ; Comms
} else { } else {
if !(b0M) if !(b0M) ; Speakers
{ {
b0Ms := True b0Ms := True
} else { } else {
b0Ms := False b0Ms := False
} }
if !(b1M) if !(b1M) ; Headphones
{ {
b1Ms := True b1Ms := True
} else { } else {
b1Ms := False b1Ms := False
} }
adjustMute("Bus[0]" . ".Mute", "0")
adjustMute("Bus[1]" . ".Mute", "0") if !(b3M) ; Comms
{
b3Ms := True
} else {
b3Ms := False
}
; Mute
adjustMute("Bus[0]" . ".Mute", "0") ; Speakers
adjustMute("Bus[1]" . ".Mute", "0") ; Headphones
adjustMute("Bus[1]" . ".Mute", "0") ; Comms
} }
Return Return
} }
cM := Round(readParam("Bus[0]" . ".Mute")) cM := Round(readParam("Bus[0]" . ".Mute")) ; Toggles between the speakers and headphones being muted, normal operation
if (cM) if (cM)
{ {
adjustMute("Bus[0]" . ".Mute", "1") adjustMute("Bus[0]" . ".Mute", "1") ; Speakers
adjustMute("Bus[1]" . ".Mute", "0") adjustMute("Bus[1]" . ".Mute", "0") ; Headphones
} }
if !(cM) if !(cM)
{ {
adjustMute("Bus[0]" . ".Mute", "0") adjustMute("Bus[0]" . ".Mute", "0") ; Speakers
adjustMute("Bus[1]" . ".Mute", "1") adjustMute("Bus[1]" . ".Mute", "1") ; Headphones
} }
return return
!m:: ; Mute: No audio out
b3M := Round(readParam("Bus[3]" . ".Mute")) ; Comms IN
if !(b3M)
{
adjustMute("Bus[3]" . ".Mute", "0")
} else {
adjustMute("Bus[3]" . ".Mute", "1")
}
Send {F23}
Return
!n:: ; Deafen: No audio in or out
b3M := Round(readParam("Bus[3]" . ".Mute")) ; Comms IN
s4M := Round(readParam("Strip[4]" . ".Mute")) ; Comms OUT
If (s4M)
{
adjustMute("Bus[3]" . ".Mute", "1")
adjustMute("Strip[4]" . ".Mute", "1")
} else {
adjustMute("Bus[3]" . ".Mute", "0")
adjustMute("Strip[4]" . ".Mute", "0")
}
Send {F24}
Return
; == Functions == ; == Functions ==
; =============== ; ===============