Update config file, clean up code quite a bit

This commit is contained in:
David Daily 2020-05-12 22:59:34 -05:00
parent 89be8ada50
commit 605f57448a
3 changed files with 46 additions and 47 deletions

93
VB.ahk
View File

@ -75,19 +75,19 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Strip[0]" . ".Gain", Lvl) adjustVolLvl("Strip[0].Gain", Lvl)
Return Return
Case 1: Case 1:
Lvl := dial_to_pan(val) Lvl := dial_to_pan(val)
adjustVolLvl("Strip[0]" . ".Pan_x", Lvl) adjustVolLvl("Strip[0].Pan_x", Lvl)
Case 2: Case 2:
adjustToggle("Strip[0]" . ".Solo", val) adjustToggle("Strip[0].Solo", val)
Return Return
Case 3: Case 3:
adjustToggle("Strip[0]" . ".Mute", val) adjustToggle("Strip[0].Mute", val)
Return Return
Case 4: Case 4:
adjustToggle("Strip[0]" . ".B2", val) adjustToggle("Strip[0].B2", val)
Return Return
Default: Default:
Return Return
@ -97,10 +97,10 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Bus[2]" . ".Gain", Lvl) adjustVolLvl("Bus[2].Gain", Lvl)
Return Return
Case 3: Case 3:
adjustToggle("Bus[2]" . ".Mute", val) adjustToggle("Bus[2].Mute", val)
Return Return
Default: Default:
Return Return
@ -110,19 +110,19 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Strip[3]" . ".Gain", Lvl) adjustVolLvl("Strip[3].Gain", Lvl)
Return Return
Case 1: Case 1:
Lvl := dial_to_pan(val) Lvl := dial_to_pan(val)
adjustVolLvl("Strip[3]" . ".Pan_x", Lvl) adjustVolLvl("Strip[3].Pan_x", Lvl)
Case 2: Case 2:
adjustToggle("Strip[3]" . ".Solo", val) adjustToggle("Strip[3].Solo", val)
Return Return
Case 3: Case 3:
adjustToggle("Strip[3]" . ".Mute", val) adjustToggle("Strip[3].Mute", val)
Return Return
Case 4: Case 4:
adjustToggle("Strip[3]" . ".B2", val) adjustToggle("Strip[3].B2", val)
Return Return
Default: Default:
Return Return
@ -132,10 +132,10 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Bus[3]" . ".Gain", Lvl) adjustVolLvl("Bus[3].Gain", Lvl)
Return Return
Case 3: Case 3:
adjustToggle("Bus[3]" . ".Mute", val) adjustToggle("Bus[3].Mute", val)
Return Return
Default: Default:
Return Return
@ -145,19 +145,19 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Strip[4]" . ".Gain", Lvl) adjustVolLvl("Strip[4].Gain", Lvl)
Return Return
Case 1: Case 1:
Lvl := dial_to_pan(val) Lvl := dial_to_pan(val)
adjustVolLvl("Strip[4]" . ".Pan_x", Lvl) adjustVolLvl("Strip[4].Pan_x", Lvl)
Case 2: Case 2:
adjustToggle("Strip[4]" . ".Solo", val) adjustToggle("Strip[4].Solo", val)
Return Return
Case 3: Case 3:
adjustToggle("Strip[4]" . ".Mute", val) adjustToggle("Strip[4].Mute", val)
Return Return
Case 4: Case 4:
adjustToggle("Strip[4]" . ".B2", val) adjustToggle("Strip[4].B2", val)
Return Return
Default: Default:
Return Return
@ -167,10 +167,10 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Bus[0]" . ".Gain", Lvl) adjustVolLvl("Bus[0].Gain", Lvl)
Return Return
Case 3: Case 3:
adjustToggle("Bus[0]" . ".Mute", val) adjustToggle("Bus[0].Mute", val)
Return Return
Default: Default:
Return Return
@ -180,10 +180,10 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Bus[1]" . ".Gain", Lvl) adjustVolLvl("Bus[1].Gain", Lvl)
Return Return
Case 3: Case 3:
adjustToggle("Bus[1]" . ".Mute", val) adjustToggle("Bus[1].Mute", val)
Return Return
Default: Default:
Return Return
@ -193,20 +193,20 @@ midiCCin:
{ {
Case 0: Case 0:
Lvl := fader_to_fader(val) Lvl := fader_to_fader(val)
adjustVolLvl("Strip[2]" . ".Gain", Lvl) adjustVolLvl("Strip[2].Gain", Lvl)
Return Return
Case 1: Case 1:
Lvl := dial_to_pan(val) Lvl := dial_to_pan(val)
adjustVolLvl("Strip[2]" . ".Pan_x", Lvl) adjustVolLvl("Strip[2].Pan_x", Lvl)
Case 2: Case 2:
adjustToggle("Strip[2]" . ".Solo", val) adjustToggle("Strip[2].Solo", val)
Return Return
Case 3: Case 3:
adjustToggle("Strip[2]" . ".Mute", val) adjustToggle("Strip[2].Mute", val)
Return Return
Case 4: Case 4:
adjustToggle("Strip[2]" . ".B1", val) adjustToggle("Strip[2].B1", val)
adjustToggle("Strip[2]" . ".B2", val) adjustToggle("Strip[2].B2", val)
Return Return
Default: Default:
Return Return
@ -215,19 +215,19 @@ midiCCin:
Switch cc Switch cc
{ {
Case 7: ; Rewind Case 7: ; Rewind
adjustToggle("Recorder" . ".REW", val) adjustToggle("Recorder.REW", val)
Return Return
Case 8: ; Fast Forward Case 8: ; Fast Forward
adjustToggle("Recorder" . ".FF", val) adjustToggle("Recorder.FF", val)
Return Return
Case 9: Case 9:
adjustToggle("Recorder" . ".Stop", val) adjustToggle("Recorder.Stop", val)
Return Return
Case 10: Case 10:
adjustToggle("Recorder" . ".Play", val) adjustToggle("Recorder.Play", val)
Return Return
Case 11: Case 11:
adjustToggle("Recorder" . ".Record", val) adjustToggle("Recorder.Record", val)
Return Return
Default: Default:
Return Return
@ -254,14 +254,14 @@ 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 cM := b0M + b1M
if (cM = "2") if (cM = "2")
{ ; 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
} else { } else {
if !(b0M) ; Speakers if !(b0M) ; Speakers
{ {
@ -277,8 +277,8 @@ Volume_Mute::
b1Ms := False b1Ms := False
} }
; Mute ; Mute
adjustToggle("Bus[0]" . ".Mute", "0") ; Speakers adjustToggle("Bus[0].Mute", "0") ; Speakers
adjustToggle("Bus[1]" . ".Mute", "0") ; Headphones adjustToggle("Bus[1].Mute", "0") ; Headphones
} }
Return Return
@ -315,12 +315,12 @@ adjustVolLvl(loc, tVol) {
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", loc, "Float", tVol, "Int") DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", loc, "Float", tVol, "Int")
} }
adjustToggle(loc, tM) { adjustToggle(func, togg) {
if (tM = 0) DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", func, "Float", togg, "Int")
tM := 1 }
else
tM := 0 adjustString(func, str) {
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", loc, "Float", tM, "Int") DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", func, "Float", str, "Str")
} }
@ -341,4 +341,3 @@ die(die_string:="UNSPECIFIED FATAL ERROR.", exit_status:=254) {
MsgBox 16, FATAL ERROR, %die_string% MsgBox 16, FATAL ERROR, %die_string%
ExitApp exit_status ExitApp exit_status
} }

BIN
default.nktrl2_data Normal file

Binary file not shown.

Binary file not shown.