voicemeeter/examples/observer/observer.go
onyx-and-iris d7be997fae add support for observers.
init/end pooler on login, logout
2022-06-25 20:11:15 +01:00

27 lines
370 B
Go

package main
import (
"fmt"
"time"
"github.com/onyx-and-iris/voicemeeter-api-go/voicemeeter"
)
type observer struct{}
func (o observer) OnUpdate(subject string) {
fmt.Println(subject)
}
func main() {
vmRem := voicemeeter.GetRemote("banana")
vmRem.Login()
o := observer{}
vmRem.Pooler.Publisher.Register(o)
time.Sleep(10 * time.Second)
vmRem.Logout()
}