summaryrefslogtreecommitdiff
path: root/pkg/mixer/mixer.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/mixer/mixer.go')
-rw-r--r--pkg/mixer/mixer.go16
1 files changed, 15 insertions, 1 deletions
diff --git a/pkg/mixer/mixer.go b/pkg/mixer/mixer.go
index 8dfda64..fb575d6 100644
--- a/pkg/mixer/mixer.go
+++ b/pkg/mixer/mixer.go
@@ -24,6 +24,7 @@ package mixer
import (
"errors"
+ "log"
"strings"
"github.com/scgolang/midi"
@@ -73,11 +74,24 @@ func NewMixer(c Config) (*Mixer, error) {
return nil, err
}
+ m.DevIn.QueueSize = 100
+ m.DevOut.QueueSize = 100
return m, nil
}
func (m *Mixer) Init() error {
- // TODO: sync state
+ ch, err := m.DevIn.Packets()
+ if err != nil {
+ return err
+ }
+
+ go func() {
+ for {
+ p := <-ch
+ log.Printf("mixer: got packet: '%v'", p)
+ // TODO: send to subscribers
+ }
+ }()
return nil
}