Created
March 6, 2021 16:02
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#SingleInstance Force | |
ShowNotification(title, text) | |
{ | |
notif_option := 0x24 | 32 | |
TrayTip(text, title, notif_option) | |
} | |
SetMuteAll(state, check) | |
{ | |
for d in ["Jack Mic", "Microphone Array"] | |
{ | |
try | |
{ | |
if (!check || (check && (SoundGetMute("", d) == !state))) | |
{ | |
SoundSetMute(state, "", d) | |
SoundSetMute(state, "1", d) | |
} | |
} | |
} | |
i := 1 | |
while (i++ < 101) | |
{ | |
try | |
{ | |
SoundGetName("", i) | |
} catch { | |
break | |
} | |
try | |
{ | |
if (!check || (check && (SoundGetMute("", i) == !state))) | |
{ | |
; SoundSetMute(state, "", i) | |
SoundSetMute(state, "Capture", i) | |
SoundSetMute(state, "Microphone", i) | |
SoundSetMute(state, "1", i) | |
} | |
} | |
} | |
} | |
Init() | |
{ | |
SetMuteAll(false, false) | |
} | |
ToggleMuteAll(state) | |
{ | |
SetMuteAll(state, true) | |
} | |
ico_off := (57*4) + 2 | |
ico_on := (58*4) + 1 | |
OnExit("Cleanup") | |
Cleanup(a, b) | |
{ | |
global ico_on | |
TraySetIcon("imageres.dll", ico_on) | |
ShowNotification("Toggle Muting Service Exiting", "Unmuting") | |
SetMuteAll(false, false) | |
} | |
TraySetIcon("imageres.dll", ico_on) | |
Init() | |
ShowNotification("Toggle Muting Service Started", "Unmuting") | |
state := true | |
F12:: | |
{ | |
global state | |
global ico_on | |
global ico_off | |
ToggleMuteAll(state) | |
TraySetIcon("imageres.dll", (state ? ico_off : ico_on)) | |
ShowNotification((state ? "Muting" : "Unmuting"), ("Microphone " . (state ? "disabled" : "enabled"))) | |
global state := !state | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment