Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

only hotkeys working with voicemeeter focus are volume up and down and mute #25

Open
NeonLightning opened this issue May 26, 2024 · 2 comments

Comments

@NeonLightning
Copy link

NeonLightning commented May 26, 2024

#Requires AutoHotkey v2
#include VMR.ahk
voicemeeter := VMR().Login()
/*
voicemeeter controls
*/
Volume_Mute::{
    voicemeeter.Strip[6].mute := -1
    voicemeeter.Strip[7].mute := -1
    voicemeeter.Strip[8].mute := -1
    if is_muted := voicemeeter.Strip[6].mute
        DisplayOsd("UnMuted", 1000)
    else
        DisplayOsd("Muted", 1000)
}
F23::{
    if (voicemeeter.Strip[6].A1 == 1) {
        DisplayOsd("Headphones", 1000)
        voicemeeter.Strip[6].A2 := true
        voicemeeter.Strip[7].A2 := true
        voicemeeter.Strip[8].A2 := true
        voicemeeter.Strip[6].A1 := false
        voicemeeter.Strip[7].A1 := false
        voicemeeter.Strip[8].A1 := false
    } else {
        DisplayOsd("Speakers", 1000)
        voicemeeter.Strip[6].A2 := false
        voicemeeter.Strip[7].A2 := false
        voicemeeter.Strip[8].A2 := false
        voicemeeter.Strip[6].A1 := true
        voicemeeter.Strip[7].A1 := true
        voicemeeter.Strip[8].A1 := true
    }
}
F24::{
    if (voicemeeter.Strip[6].A3 == 1) {
        DisplayOsd("TV off", 1000)
        voicemeeter.Strip[6].A3 := false
        voicemeeter.Strip[7].A3 := false
        voicemeeter.Strip[8].A3 := false
    } else {
        DisplayOsd("TV on", 1000)
        voicemeeter.Strip[6].A3 := true
        voicemeeter.Strip[7].A3 := true
        voicemeeter.Strip[8].A3 := true
    }
}
F16 & Volume_Up::{
    voicemeeter.Bus[1].Increment("gain", 1).Then(gain => DisplayBusVol(1, gain))
    voicemeeter.Bus[2].Increment("gain", 1).Then(gain => DisplayBusVol(2, gain))
    voicemeeter.Bus[3].Increment("gain", 1).Then(gain => DisplayBusVol(3, gain))
}
F16 & Volume_Down::{
    voicemeeter.Bus[1].Increment("gain", -1).Then(gain => DisplayBusVol(1, gain))
    voicemeeter.Bus[2].Increment("gain", -1).Then(gain => DisplayBusVol(2, gain))
    voicemeeter.Bus[3].Increment("gain", -1).Then(gain => DisplayBusVol(3, gain))
}
DisplayBusVol(*) {
    SetTimer () => DisplayOsd(
        "Gain: " voicemeeter.Bus[1].gain
        "," voicemeeter.Bus[2].gain
        "," voicemeeter.Bus[3].gain,
        500
    ), -100
}
Volume_Down::{
    voicemeeter.Strip[6].Increment("gain", -1).Then(gain => DisplayVol(6, gain))
    voicemeeter.Strip[7].Increment("gain", -1).Then(gain => DisplayVol(7, gain))
    voicemeeter.Strip[8].Increment("gain", -1).Then(gain => DisplayVol(8, gain))
}
Volume_Up::{
    voicemeeter.Strip[6].Increment("gain", 1).Then(gain => DisplayVol(6, gain))
    voicemeeter.Strip[7].Increment("gain", 1).Then(gain => DisplayVol(7, gain))
    voicemeeter.Strip[8].Increment("gain", 1).Then(gain => DisplayVol(8, gain))
}
DisplayVol(*) {
    SetTimer () => DisplayOsd(
        "Gain: " voicemeeter.Strip[6].gain
        "," voicemeeter.Strip[7].gain
        "," voicemeeter.Strip[8].gain,
        500
    ), -100
}
DisplayOsd(text, timeout) {
        textColor := "d400cd"
        bgColor := "000000"
        g := Gui("+AlwaysOnTop +ToolWindow +E0x20 -Caption -SysMenu -Owner", "OSD")
        g.BackColor := bgColor
        g.SetFont "s16", "fixedsys"
        g.AddText "x10 y10 h40 c" textColor, text
        g.Show "NoActivate x10 y10 h35"
        SetTimer () => g.Destroy(), -Abs(timeout)
}
@NeonLightning NeonLightning changed the title cant get gain on buses to work only hotkeys working with voicemeeter focus is volume up and down May 26, 2024
@NeonLightning NeonLightning changed the title only hotkeys working with voicemeeter focus is volume up and down only hotkeys working with voicemeeter focus are volume up and down and mute May 26, 2024
@SaifAqqad
Copy link
Owner

I just tested your script, and it seems to work ok, I had to change the hotkeys though since I don't have an F23/F24 key on my keyboard

Recording.2024-05-26.225833.mp4

Maybe it's an issue with a conflicting hotkey in another app?

@NeonLightning
Copy link
Author

hrm odd. no i don't have anything else using my extra fkeys. thanks for looking into it though. probably just some wonkey issue with my system.(it's not in a happy state)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants