| 367 | } |
| 368 | |
| 369 | void 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 | } |
no test coverage detected