MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / Flush

Method Flush

Source/INoteSource.cpp:121–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void NoteOutput::Flush(double time)
122{
123 if (!IsAudioThread())
124 {
125 TheSynth->GetNoteOutputQueue()->QueueFlush(this, time + TheTransport->GetEventLookaheadMs() + gBufferSizeMs); //include event lookahead, and make it 1 buffer later, to make sure notes get cleared
126 return;
127 }
128
129 bool flushed = false;
130
131 for (int i = 0; i < 128; ++i)
132 {
133 if (mNotes[i])
134 {
135 for (auto noteReceiver : mNoteSource->GetPatchCableSource()->GetNoteReceivers())
136 {
137 noteReceiver->PlayNote(time, i, 0);
138 noteReceiver->PlayNote(time + Transport::sEventEarlyMs, i, 0);
139 }
140 flushed = true;
141 mNotes[i] = false;
142 }
143 }
144
145 if (flushed)
146 mNoteSource->GetPatchCableSource()->AddHistoryEvent(time, false);
147}
148
149void INoteSource::PlayNoteOutput(double time, int pitch, int velocity, int voiceIdx, ModulationParameters modulation, bool isFromMainThreadAndScheduled)
150{

Callers 15

CheckboxUpdatedMethod · 0.45
TextEntryCompleteMethod · 0.45
CheckboxUpdatedMethod · 0.45
CheckboxUpdatedMethod · 0.45
CheckboxUpdatedMethod · 0.45
CheckboxUpdatedMethod · 0.45
OnTimeEventMethod · 0.45
CheckboxUpdatedMethod · 0.45
OnTimeEventMethod · 0.45
CheckboxUpdatedMethod · 0.45
IntSliderUpdatedMethod · 0.45
CheckboxUpdatedMethod · 0.45

Calls 7

IsAudioThreadFunction · 0.85
QueueFlushMethod · 0.80
GetNoteOutputQueueMethod · 0.80
GetEventLookaheadMsMethod · 0.80
AddHistoryEventMethod · 0.80
GetPatchCableSourceMethod · 0.45
PlayNoteMethod · 0.45

Tested by 2

SetEnabledMethod · 0.36
CheckboxUpdatedMethod · 0.36