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

Method DrawModule

Source/Looper.cpp:618–727  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

616}
617
618void Looper::DrawModule()
619{
620 if (Minimized() || IsVisible() == false)
621 return;
622
623 ofPushMatrix();
624
625 ofTranslate(kBufferX, kBufferY);
626
627 assert(mLoopLength > 0);
628
629 float displayPos = GetActualLoopPos(0);
630 mBufferMutex.lock();
631 DrawAudioBuffer(kBufferWidth, kBufferHeight, mBuffer, 0, mLoopLength, displayPos, mVol);
632 mBufferMutex.unlock();
633 ofSetColor(255, 255, 0, gModuleDrawAlpha);
634 for (int i = 1; i < mNumBars; ++i)
635 {
636 float x = kBufferWidth / mNumBars * i;
637 ofLine(x, kBufferHeight / 2 - 5, x, kBufferHeight / 2 + 5);
638 }
639 ofSetColor(255, 255, 255, gModuleDrawAlpha);
640
641 ofPopMatrix();
642
643 mClearButton->Draw();
644 mNumBarsSelector->Draw();
645 mVolSlider->Draw();
646 mVolumeBakeButton->Draw();
647 mDecaySlider->Draw();
648 mDoubleSpeedButton->Draw();
649 mHalveSpeedButton->Draw();
650 mExtendButton->Draw();
651 mUndoButton->Draw();
652 mLoopPosOffsetSlider->Draw();
653 mWriteOffsetButton->Draw();
654 mScratchSpeedSlider->Draw();
655 mAllowScratchCheckbox->Draw();
656 mFourTetSlider->Draw();
657 mFourTetSlicesDropdown->Draw();
658 mPitchShiftSlider->Draw();
659 mKeepPitchCheckbox->Draw();
660 mWriteInputCheckbox->Draw();
661 mQueueCaptureButton->Draw();
662 mResampleButton->SetShowing(mBufferTempo != TheTransport->GetTempo());
663 mResampleButton->Draw();
664 if (mCaptureQueued)
665 {
666 ofPushStyle();
667 ofFill();
668 if (mWriteInput)
669 ofSetColor(255, 0, 0, 150);
670 else
671 ofSetColor(255, 100, 0, 100 + 50 * (cosf(TheTransport->GetMeasurePos(gTime) * 4 * FTWO_PI)));
672 ofRect(mQueueCaptureButton->GetRect(true));
673 ofPopStyle();
674 }
675

Callers

nothing calls this directly

Calls 15

ofPushMatrixFunction · 0.85
ofTranslateFunction · 0.85
DrawAudioBufferFunction · 0.85
ofSetColorFunction · 0.85
ofLineFunction · 0.85
ofPopMatrixFunction · 0.85
ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
ofRectangleClass · 0.85
ofSetLineWidthFunction · 0.85

Tested by

no test coverage detected