mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-23 21:30:53 +00:00
use log.Fatal during setup procedures.
update readme example
This commit is contained in:
parent
6fabc43998
commit
7a79555cb8
@ -42,21 +42,24 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
)
|
||||
|
||||
func main() {
|
||||
kindId := "banana"
|
||||
vm := voicemeeter.NewRemote(kindId)
|
||||
vm, err := voicemeeter.NewRemote(kindId)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer vm.Logout()
|
||||
|
||||
vm.Login()
|
||||
|
||||
vm.Strip[0].SetLabel("rode podmic")
|
||||
vm.Strip[0].SetMute(true)
|
||||
fmt.Printf("Strip 0 (%s) mute was set to %v\n", vm.Strip[0].GetLabel(), vm.Strip[0].GetMute())
|
||||
|
||||
vm.Logout()
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -2,7 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
@ -49,8 +49,7 @@ func (o observer) OnUpdate(subject string) {
|
||||
func main() {
|
||||
vm, err := voicemeeter.NewRemote("potato")
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer vm.Logout()
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package voicemeeter
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@ -13,8 +13,7 @@ var (
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
vm.Login()
|
||||
|
5
path.go
5
path.go
@ -3,7 +3,7 @@ package voicemeeter
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"log"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
@ -49,8 +49,7 @@ func dllPath() (string, error) {
|
||||
func getDllPath() string {
|
||||
path, err := dllPath()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
log.Fatal(err)
|
||||
}
|
||||
return path
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package voicemeeter_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
@ -15,8 +15,7 @@ var (
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer vm.Logout()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user