mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-15 17:40:51 +00:00
update docstrings in observer example
This commit is contained in:
parent
195ee326a0
commit
a23a9f8598
@ -20,8 +20,7 @@ func newObserver(vm *voicemeeter.Remote) *observer {
|
|||||||
return &observer{vm, make(chan string)}
|
return &observer{vm, make(chan string)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnUpdate satisfies the observer interface defined in publisher.go
|
// Listen registers the observer channel and listens for udpates.
|
||||||
// for each event type an action is triggered when the event occurs.
|
|
||||||
func (o observer) Listen() {
|
func (o observer) Listen() {
|
||||||
o.vm.Register(o.events)
|
o.vm.Register(o.events)
|
||||||
|
|
||||||
@ -47,6 +46,7 @@ func init() {
|
|||||||
log.SetLevel(log.InfoLevel)
|
log.SetLevel(log.InfoLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// runObserver initiates a single observer and starts its Listen() function.
|
||||||
func runObserver(vm *voicemeeter.Remote) {
|
func runObserver(vm *voicemeeter.Remote) {
|
||||||
o := newObserver(vm)
|
o := newObserver(vm)
|
||||||
go o.Listen()
|
go o.Listen()
|
||||||
@ -67,6 +67,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// vmConnect connects to Voicemeeter potato and logs into the API
|
// vmConnect connects to Voicemeeter potato and logs into the API
|
||||||
|
// it also add ldirty to event updates.
|
||||||
func vmConnect() (*voicemeeter.Remote, error) {
|
func vmConnect() (*voicemeeter.Remote, error) {
|
||||||
vm, err := voicemeeter.NewRemote("basic", 0)
|
vm, err := voicemeeter.NewRemote("basic", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user