add shortcut for thumbs up/down in YT music

This commit is contained in:
David Daily 2020-10-14 19:14:37 -05:00
parent d1ec2fed49
commit de33a5956a

64
VB.ahk
View File

@ -1,4 +1,4 @@
#NoEnv
SetWorkingDir, C:\Users\Leand.000\Documents\D3K
#SingleInstance force
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
@ -9,7 +9,6 @@ ListLines Off
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetTitleMatchMode RegEx
StringCaseSense Off
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
OnExit("cleanup_before_exit")
SetFormat, Float, 0.3
@ -70,7 +69,7 @@ midiCCin:
Switch chan
{
Case 1: ; The first fader: Work Laptop Out
Case 1: ; The first fader: Work Laptop Receive
Switch cc
{
Case 0:
@ -92,7 +91,7 @@ midiCCin:
Default:
Return
}
Case 2: ; The second fader: Work Laptop In
Case 2: ; The second fader: Work Laptop Send
Switch cc
{
Case 0:
@ -130,7 +129,7 @@ midiCCin:
Default:
Return
}
Case 4: ; The third fader: Comms In
Case 4: ; The third fader: Comms Send
Switch cc
{
Case 0:
@ -159,7 +158,7 @@ midiCCin:
Default:
Return
}
Case 5: ; The fifth fader: Comms Out
Case 5: ; The fifth fader: Comms Receive
Switch cc
{
Case 0:
@ -204,6 +203,9 @@ midiCCin:
Case 3:
adjustToggle("Bus[1].Mute", val)
Return
Case 4: ; Mute mic input
adjustToggle("Strip[1].Mute", val)
Return
Default:
Return
}
@ -223,9 +225,17 @@ midiCCin:
Case 3:
adjustToggle("Strip[2].Mute", val)
Return
Case 4:
Case 4: ; Send audio to Comms out & record
adjustToggle("Strip[2].B1", val)
adjustToggle("Strip[2].B2", val)
if (val)
{
Send {F22} ; Toggle PTT/Voice Activity
Send {F23 down}
} else {
Send {F23 up}
Send {F22} ; Toggle PTT/Voice Activity
}
Return
Default:
Return
@ -248,20 +258,48 @@ midiCCin:
Case 3: ; Media Play/Pause
Send, {Media_Play_Pause}
Return
Case 4: ; Set button / death sound
if (val)
{
Send {F22} ; Toggle PTT/Voice Activity
Send {F23 down}
;Random, temp, 1, 4
;adjustString("Recorder.Load", "D:\Combine\metropolice\die" . temp . ".wav")
adjustToggle("Recorder.Play", True) ; Temp fix until file loading works
} else {
Send {F23 up}
Send {F22}
adjustToggle("Recorder.Stop", True)
Sleep, 250 ; Makes sure the playback is reset to the beginning, temp until loading files is possible
adjustToggle("Recorder.Stop", True)
}
Return
Case 5: ; <- under Marker / dislike song
if !(val)
{
Send ^+{PgDn}
}
Return
Case 6: ; -> under Marker / like song
if !(val)
{
Send ^+{PgUp}
}
Return
Case 7: ; Rewind
if (val)
{
adjustToggle("Recorder.REW", true)
adjustToggle("Recorder.REW", True)
} else {
adjustToggle("Recorder.Play", true)
adjustToggle("Recorder.Play", True)
}
Return
Case 8: ; Fast Forward
if (val)
{
adjustToggle("Recorder.FF", true)
adjustToggle("Recorder.FF", True)
} else {
adjustToggle("Recorder.Play", true)
adjustToggle("Recorder.Play", True)
}
Return
Case 9:
@ -394,7 +432,7 @@ adjustToggle(func, togg) {
}
adjustString(func, str) {
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", func, "Float", str, "Str")
DllCall(VMR_FUNCTIONS["SetParameterFloat"], "AStr", func, "AStr", str, "Str")
}
@ -414,4 +452,4 @@ cleanup_before_exit(exit_reason, exit_code) {
die(die_string:="UNSPECIFIED FATAL ERROR.", exit_status:=254) {
MsgBox 16, FATAL ERROR, %die_string%
ExitApp exit_status
}
}