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

Method BounceRecording

Source/MultitrackRecorder.cpp:414–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

412}
413
414Sample* MultitrackRecorderTrack::BounceRecording()
415{
416 Sample* sample = nullptr;
417 if (mRecordingLength > 0)
418 {
419 sample = new Sample();
420 sample->Create(mRecordingLength);
421 ChannelBuffer* data = sample->Data();
422 int channelCount = mRecordChunks[0]->NumActiveChannels();
423 data->SetNumActiveChannels(channelCount);
424
425 int numChunks = mRecordingLength / kRecordingChunkSize + 1;
426 for (int i = 0; i < numChunks; ++i)
427 {
428 int samplesLeftToRecord = mRecordingLength - i * kRecordingChunkSize;
429 int samplesToCopy;
430 if (samplesLeftToRecord > kRecordingChunkSize)
431 samplesToCopy = kRecordingChunkSize;
432 else
433 samplesToCopy = samplesLeftToRecord;
434 for (int ch = 0; ch < channelCount; ++ch)
435 BufferCopy(data->GetChannel(ch) + i * kRecordingChunkSize, mRecordChunks[i]->GetChannel(ch), samplesToCopy);
436 }
437 }
438
439 return sample;
440}
441
442void MultitrackRecorderTrack::Clear()
443{

Callers 1

ButtonClickedMethod · 0.80

Calls 6

BufferCopyFunction · 0.85
DataMethod · 0.80
NumActiveChannelsMethod · 0.80
SetNumActiveChannelsMethod · 0.80
GetChannelMethod · 0.80
CreateMethod · 0.45

Tested by

no test coverage detected