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

Method SwapBuffer

Source/LoopStorer.cpp:139–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void LoopStorer::SwapBuffer(int swapToIdx)
140{
141 if (mLooper == nullptr)
142 return;
143
144 mSwapMutex.lock();
145 assert(mSamples[0]->mBuffer != mSamples[1]->mBuffer);
146 //TODO(Ryan) make loopstorer actually use ChannelBuffers
147 //mLooper->SetLoopBuffer(mSamples[swapToIdx]->mBuffer);
148 if (mRewriteToSelection)
149 {
150 mSamples[swapToIdx]->mNumBars = mLooper->GetRecorderNumBars();
151 mLooper->Rewrite();
152 mRewriteToSelection = false;
153 }
154 else
155 {
156 mLooper->SetNumBars(mSamples[swapToIdx]->mNumBars);
157 }
158 mCurrentBufferIdx = swapToIdx;
159 mIsSwapping = true;
160 assert(mSamples[0]->mBuffer != mSamples[1]->mBuffer);
161 mSwapMutex.unlock();
162}
163
164void LoopStorer::DropdownClicked(DropdownList* list)
165{

Callers

nothing calls this directly

Calls 3

GetRecorderNumBarsMethod · 0.80
RewriteMethod · 0.80
SetNumBarsMethod · 0.45

Tested by

no test coverage detected