mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-15 17:40:51 +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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
|
|
||||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
kindId := "banana"
|
kindId := "banana"
|
||||||
vm := voicemeeter.NewRemote(kindId)
|
vm, err := voicemeeter.NewRemote(kindId)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
defer vm.Logout()
|
||||||
|
|
||||||
vm.Login()
|
vm.Login()
|
||||||
|
|
||||||
vm.Strip[0].SetLabel("rode podmic")
|
vm.Strip[0].SetLabel("rode podmic")
|
||||||
vm.Strip[0].SetMute(true)
|
vm.Strip[0].SetMute(true)
|
||||||
fmt.Printf("Strip 0 (%s) mute was set to %v\n", vm.Strip[0].GetLabel(), vm.Strip[0].GetMute())
|
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 (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"log"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||||
@ -49,8 +49,7 @@ func (o observer) OnUpdate(subject string) {
|
|||||||
func main() {
|
func main() {
|
||||||
vm, err := voicemeeter.NewRemote("potato")
|
vm, err := voicemeeter.NewRemote("potato")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
log.Fatal(err)
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
defer vm.Logout()
|
defer vm.Logout()
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package voicemeeter
|
package voicemeeter
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -13,8 +13,7 @@ var (
|
|||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
log.Fatal(err)
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vm.Login()
|
vm.Login()
|
||||||
|
5
path.go
5
path.go
@ -3,7 +3,7 @@ package voicemeeter
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
@ -49,8 +49,7 @@ func dllPath() (string, error) {
|
|||||||
func getDllPath() string {
|
func getDllPath() string {
|
||||||
path, err := dllPath()
|
path, err := dllPath()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
log.Fatal(err)
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package voicemeeter_test
|
package voicemeeter_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
@ -15,8 +15,7 @@ var (
|
|||||||
|
|
||||||
func TestMain(m *testing.M) {
|
func TestMain(m *testing.M) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
log.Fatal(err)
|
||||||
os.Exit(1)
|
|
||||||
}
|
}
|
||||||
defer vm.Logout()
|
defer vm.Logout()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user