mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-13 11:43:19 -05:00
drafting
This commit is contained in:
parent
fd5e2c3bb8
commit
b328cc3a07
@ -79,6 +79,7 @@ type (
|
||||
oversampling bool
|
||||
|
||||
specAnSettings SpecAnSettings
|
||||
specAnEnabled bool
|
||||
|
||||
alerts []Alert
|
||||
dialog Dialog
|
||||
@ -402,14 +403,16 @@ func (m *Model) ProcessMsg(msg MsgToModel) {
|
||||
case *sointu.AudioBuffer:
|
||||
m.signalAnalyzer.ProcessAudioBuffer(e)
|
||||
// chain the messages: when we have a new audio buffer, send them to the detector and the spectrum analyzer
|
||||
clone := m.broker.GetAudioBuffer()
|
||||
*clone = append(*clone, *e...)
|
||||
if m.specAnEnabled { // send buffers to spectrum analyzer only if it's enabled
|
||||
clone := m.broker.GetAudioBuffer()
|
||||
*clone = append(*clone, *e...)
|
||||
if !TrySend(m.broker.ToSpecAn, MsgToSpecAn{Data: clone}) {
|
||||
m.broker.PutAudioBuffer(clone)
|
||||
}
|
||||
}
|
||||
if !TrySend(m.broker.ToDetector, MsgToDetector{Data: e}) {
|
||||
m.broker.PutAudioBuffer(e)
|
||||
}
|
||||
if !TrySend(m.broker.ToSpecAn, MsgToSpecAn{Data: clone}) {
|
||||
m.broker.PutAudioBuffer(clone)
|
||||
}
|
||||
case *Spectrum:
|
||||
m.broker.PutSpectrum(m.spectrum)
|
||||
m.spectrum = e
|
||||
|
||||
Reference in New Issue
Block a user