change mute button to mute all output, volume buttons control desktop volume

This commit is contained in:
David Daily 2020-05-20 14:14:48 -05:00
parent 1dbef5671d
commit a6bd9c5d14
1 changed files with 49 additions and 19 deletions

68
VB.ahk
View File

@ -255,9 +255,11 @@ midiCCin:
adjustToggle("Recorder.Record", val) adjustToggle("Recorder.Record", val)
Return Return
Default: Default:
Gosub, SendCC
Return Return
} }
Default: Default:
Gosub, SendCC
Return Return
} }
Return Return
@ -281,29 +283,57 @@ dial_to_pan(val)
Volume_Mute:: Volume_Mute::
b0M := Round(readParam("Bus[0].Mute")) ; Speakers b0M := Round(readParam("Bus[0].Mute")) ; Speakers
b1M := Round(readParam("Bus[1].Mute")) ; Headphones b1M := Round(readParam("Bus[1].Mute")) ; Headphones
cM := b0M + b1M b2M := Round(readParam("Bus[2].Mute")) ; Work Laptop Send
b3M := Round(readParam("Bus[3].Mute")) ; Comms Send
if (cM = "2") b4M := Round(readParam("Bus[4].Mute")) ; Recording
cM := b0M + b1M + b2M + b3M + b4M
if (cM = "5")
{ ; Unmute the ones that were unmuted before { ; Unmute the ones that were unmuted before
adjustToggle("Bus[0].Mute", b0Ms) ; Speakers adjustToggle("Bus[0].Mute", b0Ms) ; Speakers
adjustToggle("Bus[1].Mute", b1Ms) ; Headphones adjustToggle("Bus[1].Mute", b1Ms) ; Headphones
adjustToggle("Bus[2].Mute", b2Ms) ; Work Laptop Send
adjustToggle("Bus[3].Mute", b3Ms) ; Comms Send
adjustToggle("Bus[4].Mute", b4Ms) ; Recording
} else { } else {
if !(b0M) ; Speakers adjustToggle("Bus[0].Mute", True) ; Speakers
{ adjustToggle("Bus[1].Mute", True) ; Headphones
b0Ms := True adjustToggle("Bus[2].Mute", True) ; Work Laptop Send
} else { adjustToggle("Bus[3].Mute", True) ; Comms Send
b0Ms := False adjustToggle("Bus[4].Mute", True) ; Recording
} b0Ms := b0M
b1Ms := b1M
if !(b1M) ; Headphones b2Ms := b2M
{ b3Ms := b3M
b1Ms := True b4Ms := b4M
} else { }
b1Ms := False Return
}
; Mute Volume_Up::
adjustToggle("Bus[0].Mute", "0") ; Speakers cM := Round(readParam("Strip[3].Mute"))
adjustToggle("Bus[1].Mute", "0") ; Headphones
if !(cM)
{
cLvl := readParam("Strip[3].Gain")
if (cLvl != "")
{
cLvl += 1
adjustVolLvl("Strip[3].Gain", cLvl)
}
}
Return
Volume_Down::
cM := Round(readParam("Strip[3].Mute"))
if !(cM)
{
cLvl := readParam("Strip[3].Gain")
if (cLvl != "")
{
cLvl -= 1
adjustVolLvl("Strip[3].Gain", cLvl)
}
} }
Return Return