From 5b3f10c4b8257274532906d5d20ec8c9fd5058d3 Mon Sep 17 00:00:00 2001 From: onyx-and-iris <75868496+onyx-and-iris@users.noreply.github.com> Date: Tue, 4 Oct 2022 20:18:48 +0100 Subject: [PATCH] print bus level values in observer example --- examples/observer/main.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/observer/main.go b/examples/observer/main.go index 7748467..e7eeb79 100644 --- a/examples/observer/main.go +++ b/examples/observer/main.go @@ -42,16 +42,11 @@ func (o observer) OnUpdate(subject string) { var val = o.vm.Midi.Get(current) fmt.Printf("Value of midi button %d: %d\n", current, val) } else if subject == "ldirty" { - fmt.Printf("%v %v %v %v %v %v %v %v\n", - o.vm.Bus[0].Levels().IsDirty(), - o.vm.Bus[1].Levels().IsDirty(), - o.vm.Bus[2].Levels().IsDirty(), - o.vm.Bus[3].Levels().IsDirty(), - o.vm.Bus[4].Levels().IsDirty(), - o.vm.Bus[5].Levels().IsDirty(), - o.vm.Bus[6].Levels().IsDirty(), - o.vm.Bus[7].Levels().IsDirty(), - ) + for _, bus := range o.vm.Bus { + if bus.Levels().IsDirty() { + fmt.Println(bus, bus.Levels().All()) + } + } } }