mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-22 04:40:53 +00:00
refactor hotkeys example.
This commit is contained in:
parent
a87c11099c
commit
1284c92680
@ -10,18 +10,13 @@ import (
|
||||
|
||||
func main() {
|
||||
if err := keyboard.Open(); err != nil {
|
||||
panic(err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer func() {
|
||||
_ = keyboard.Close()
|
||||
}()
|
||||
|
||||
vm, err := voicemeeter.NewRemote("potato", 0)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = vm.Login()
|
||||
vm, err := vmConnect()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@ -55,3 +50,17 @@ Loop:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func vmConnect() (*voicemeeter.Remote, error) {
|
||||
vm, err := voicemeeter.NewRemote("potato", 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = vm.Login()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return vm, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user