only check subject once per update

This commit is contained in:
onyx-and-iris 2022-08-23 03:58:49 +01:00
parent fa8e9f3e76
commit 7f992a1a87

View File

@ -23,16 +23,13 @@ func (o observer) Deregister() {
func (o observer) OnUpdate(subject string) {
if subject == "pdirty" {
fmt.Println("pdirty!")
}
if subject == "mdirty" {
} else if subject == "mdirty" {
fmt.Println("mdirty!")
}
if subject == "midi" {
} else if subject == "midi" {
var current = o.vm.Midi.Current()
var val = o.vm.Midi.Get(current)
fmt.Printf("Value of midi button %d: %d\n", current, val)
}
if subject == "ldirty" {
} 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(),