8 Commits

Author SHA1 Message Date
onyx-and-iris
10d7cea523 Merge branch 'dev' of https://github.com/onyx-and-iris/voicemeeter-api-go into dev 2022-09-22 22:55:24 +01:00
onyx-and-iris
8a9b5f9a97 rename dir structure to match package name
update examples, readme
2022-09-22 22:55:08 +01:00
norm
8a611e39aa change func and var names 2022-09-21 07:30:14 +01:00
norm
ff56dd16f5 upd readme with new default delay 2022-09-19 03:05:02 +01:00
norm
440c3b8eec increae default delay to 20 2022-09-19 03:03:51 +01:00
onyx-and-iris
a5f653f569 add error message if config not found 2022-09-18 20:57:59 +01:00
onyx-and-iris
73893209a1 upd dependency ver 2022-09-18 05:53:08 +01:00
onyx-and-iris
303f1a871c md fix 2022-09-18 05:45:09 +01:00
12 changed files with 34 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
[![Go Reference](https://pkg.go.dev/badge/github.com/onyx-and-iris/voicemeeter-api-go.svg)](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter-api-go)
[![Go Reference](https://pkg.go.dev/badge/github.com/onyx-and-iris/voicemeeter.svg)](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter)
# A Go Wrapper for Voicemeeter API
@@ -23,7 +23,7 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
Install voicemeeter-api-go package from your console to download the latest version.
`go get github.com/onyx-and-iris/voicemeeter-api-go`
`go get github.com/onyx-and-iris/voicemeeter`
or add it to your `go.mod` file.
@@ -38,7 +38,7 @@ import (
"fmt"
"log"
"github.com/onyx-and-iris/voicemeeter-api-go"
"github.com/onyx-and-iris/voicemeeter"
)
func main() {

View File

@@ -4,7 +4,7 @@ go 1.19
require (
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0
)
require golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect

View File

@@ -1,8 +1,8 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg=
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg=
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0 h1:WA1RGrfaWBOavgY2uoJltzy/rAgvs62PM3qzR+5/jt8=
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0 h1:uVeKXG3+dnZUakJNZ0RjYFgVhFCzGPoiNnU32LqGR4Y=
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d h1:/m5NbqQelATgoSPVC2Z23sR4kVNokFwDDyWh/3rGY+I=

View File

@@ -5,7 +5,7 @@ import (
"log"
"github.com/eiannone/keyboard"
"github.com/onyx-and-iris/voicemeeter-api-go"
"github.com/onyx-and-iris/voicemeeter"
)
func main() {

View File

@@ -5,7 +5,7 @@ go 1.18
require (
github.com/BurntSushi/toml v1.2.0
github.com/andreykaipov/goobs v0.10.0
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0
)
require (

View File

@@ -11,8 +11,8 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ=
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0 h1:WA1RGrfaWBOavgY2uoJltzy/rAgvs62PM3qzR+5/jt8=
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0 h1:uVeKXG3+dnZUakJNZ0RjYFgVhFCzGPoiNnU32LqGR4Y=
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d h1:/m5NbqQelATgoSPVC2Z23sR4kVNokFwDDyWh/3rGY+I=

View File

@@ -3,10 +3,10 @@ package main
import (
"fmt"
"log"
"time"
"os"
"time"
"github.com/onyx-and-iris/voicemeeter-api-go"
"github.com/onyx-and-iris/voicemeeter"
"github.com/andreykaipov/goobs"
"github.com/andreykaipov/goobs/api/events"
@@ -107,7 +107,8 @@ func obsConnect() (*goobs.Client, error) {
f := "config.toml"
if _, err := os.Stat(f); err != nil {
f = "./config.toml"
err := fmt.Errorf("unable to locate %s", f)
return nil, err
}
var c config

View File

@@ -5,7 +5,7 @@ import (
"log"
"time"
"github.com/onyx-and-iris/voicemeeter-api-go"
"github.com/onyx-and-iris/voicemeeter"
)
// observer represents a single receiver of updates

View File

@@ -5,8 +5,10 @@ A simple voicemeeter-cli program. Offers ability to toggle, get and set paramete
## Use
Toggle with `!` prefix, get by excluding `=` and set by including `=`. Mix and match arguments.
You may pass an optional flag -kind to set the kind of Voicemeeter. Defaults to banana.
You may pass an optional flag -delay to set a delay on the getters. Defaults to 15ms.
You may pass an optional flag -delay to set a delay on the getters. Defaults to 20ms.
for example:

View File

@@ -6,12 +6,12 @@ import (
"log"
"strings"
"github.com/onyx-and-iris/voicemeeter-api-go"
"github.com/onyx-and-iris/voicemeeter"
)
func main() {
kindId := flag.String("kind", "banana", "kind of voicemeeter")
delay := flag.Int("delay", 15, "delay between commands")
delay := flag.Int("delay", 20, "delay between commands")
flag.Parse()
vm, err := vmConnect(kindId, delay)
@@ -20,7 +20,7 @@ func main() {
}
defer vm.Logout()
err = run_commands(vm)
err = runCommands(vm)
if err != nil {
fmt.Println(err)
}
@@ -40,7 +40,7 @@ func vmConnect(kindId *string, delay *int) (*voicemeeter.Remote, error) {
return vm, nil
}
func run_commands(vm *voicemeeter.Remote) error {
func runCommands(vm *voicemeeter.Remote) error {
for _, arg := range flag.Args() {
if arg[0] == '!' {
val, err := vm.GetFloat(arg[1:])
@@ -59,16 +59,16 @@ func run_commands(vm *voicemeeter.Remote) error {
return err
}
} else {
val_f, err := vm.GetFloat(arg)
valF, err := vm.GetFloat(arg)
if err != nil {
val_s, err := vm.GetString(arg)
valS, err := vm.GetString(arg)
if err != nil {
err = fmt.Errorf("unable to get %s", arg)
return err
}
fmt.Println("Value of", arg, "is:", val_s)
fmt.Println("Value of", arg, "is:", valS)
} else {
fmt.Println("Value of", arg, "is:", val_f)
fmt.Println("Value of", arg, "is:", valF)
}
}
}

8
go.mod
View File

@@ -1,11 +1,9 @@
module github.com/onyx-and-iris/voicemeeter-api-go
module github.com/onyx-and-iris/voicemeeter
go 1.18
retract (
// package files moved into root of repository
[v1.0.0, v1.1.0]
)
// package files moved into root of repository
retract [v1.0.0, v1.1.0]
require (
github.com/stretchr/testify v1.8.0

View File

@@ -4,7 +4,7 @@ import (
"log"
"testing"
"github.com/onyx-and-iris/voicemeeter-api-go"
"github.com/onyx-and-iris/voicemeeter"
)
var (