mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-18 14:13:17 -05:00
fix(tracker): Player routes MIDImsgs so always handled in same block
This commit is contained in:
parent
cc8d737f8a
commit
77b27257fe
@ -32,22 +32,22 @@ type (
|
||||
// case <-time.After(3 * time.Second):
|
||||
// }
|
||||
Broker struct {
|
||||
ToModel chan MsgToModel
|
||||
ToPlayer chan any // TODO: consider using a sum type here, for a bit more type safety. See: https://www.jerf.org/iri/post/2917/
|
||||
ToDetector chan MsgToDetector
|
||||
ToGUI chan any
|
||||
ToSpecAn chan MsgToSpecAn
|
||||
ToMIDIRouter chan any
|
||||
ToModel chan MsgToModel
|
||||
ToPlayer chan any // TODO: consider using a sum type here, for a bit more type safety. See: https://www.jerf.org/iri/post/2917/
|
||||
ToDetector chan MsgToDetector
|
||||
ToGUI chan any
|
||||
ToSpecAn chan MsgToSpecAn
|
||||
ToMIDIHandler chan any
|
||||
|
||||
CloseDetector chan struct{}
|
||||
CloseGUI chan struct{}
|
||||
CloseSpecAn chan struct{}
|
||||
CloseMIDIRouter chan struct{}
|
||||
CloseDetector chan struct{}
|
||||
CloseGUI chan struct{}
|
||||
CloseSpecAn chan struct{}
|
||||
CloseMIDIHandler chan struct{}
|
||||
|
||||
FinishedGUI chan struct{}
|
||||
FinishedDetector chan struct{}
|
||||
FinishedSpecAn chan struct{}
|
||||
FinishedMIDIRouter chan struct{}
|
||||
FinishedGUI chan struct{}
|
||||
FinishedDetector chan struct{}
|
||||
FinishedSpecAn chan struct{}
|
||||
FinishedMIDIHandler chan struct{}
|
||||
|
||||
bufferPool sync.Pool
|
||||
spectrumPool sync.Pool
|
||||
@ -111,22 +111,22 @@ const (
|
||||
|
||||
func NewBroker() *Broker {
|
||||
return &Broker{
|
||||
ToPlayer: make(chan any, 1024),
|
||||
ToModel: make(chan MsgToModel, 1024),
|
||||
ToDetector: make(chan MsgToDetector, 1024),
|
||||
ToGUI: make(chan any, 1024),
|
||||
ToMIDIRouter: make(chan any, 1024),
|
||||
ToSpecAn: make(chan MsgToSpecAn, 1024),
|
||||
CloseDetector: make(chan struct{}, 1),
|
||||
CloseGUI: make(chan struct{}, 1),
|
||||
CloseSpecAn: make(chan struct{}, 1),
|
||||
CloseMIDIRouter: make(chan struct{}, 1),
|
||||
FinishedGUI: make(chan struct{}),
|
||||
FinishedDetector: make(chan struct{}),
|
||||
FinishedSpecAn: make(chan struct{}),
|
||||
FinishedMIDIRouter: make(chan struct{}),
|
||||
bufferPool: sync.Pool{New: func() any { return &sointu.AudioBuffer{} }},
|
||||
spectrumPool: sync.Pool{New: func() any { return &Spectrum{} }},
|
||||
ToPlayer: make(chan any, 1024),
|
||||
ToModel: make(chan MsgToModel, 1024),
|
||||
ToDetector: make(chan MsgToDetector, 1024),
|
||||
ToGUI: make(chan any, 1024),
|
||||
ToMIDIHandler: make(chan any, 1024),
|
||||
ToSpecAn: make(chan MsgToSpecAn, 1024),
|
||||
CloseDetector: make(chan struct{}, 1),
|
||||
CloseGUI: make(chan struct{}, 1),
|
||||
CloseSpecAn: make(chan struct{}, 1),
|
||||
CloseMIDIHandler: make(chan struct{}, 1),
|
||||
FinishedGUI: make(chan struct{}),
|
||||
FinishedDetector: make(chan struct{}),
|
||||
FinishedSpecAn: make(chan struct{}),
|
||||
FinishedMIDIHandler: make(chan struct{}),
|
||||
bufferPool: sync.Pool{New: func() any { return &sointu.AudioBuffer{} }},
|
||||
spectrumPool: sync.Pool{New: func() any { return &Spectrum{} }},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user