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

Method Draw

Source/LoopStorer.cpp:369–395  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void LoopStorer::SampleData::Draw()
370{
371 ofPushMatrix();
372 ofTranslate(5, mLoopStorer->GetRowY(mIndex));
373 ChannelBuffer* buffer = mBuffer;
374 int bufferLength = mBufferLength;
375 bool useLooper = mIsCurrentBuffer && mLoopStorer && mLoopStorer->GetLooper();
376 if (useLooper)
377 {
378 mLoopStorer->GetLooper()->LockBufferMutex();
379 buffer = mLoopStorer->GetLooper()->GetLoopBuffer(bufferLength); //make sure we have the latest and greatest
380 }
381 DrawAudioBuffer(100, 36, buffer, 0, bufferLength, -1);
382 if (useLooper)
383 mLoopStorer->GetLooper()->UnlockBufferMutex();
384 DrawTextNormal(ofToString(mNumBars), 4, 12);
385 if (mLoopStorer->GetQueuedBufferIdx() == mIndex)
386 {
387 ofPushStyle();
388 ofSetColor(255, 100, 0);
389 ofFill();
390 ofRect(107, 24, 8, 8);
391 ofPopStyle();
392 }
393 ofPopMatrix();
394 mSelectCheckbox->Draw();
395}

Callers 1

DrawModuleMethod · 0.45

Calls 15

ofPushMatrixFunction · 0.85
ofTranslateFunction · 0.85
DrawAudioBufferFunction · 0.85
DrawTextNormalFunction · 0.85
ofToStringFunction · 0.85
ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
ofPopMatrixFunction · 0.85
GetLooperMethod · 0.80

Tested by

no test coverage detected