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

Method DrawModule

Source/DrumPlayer.cpp:786–872  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784}
785
786void DrumPlayer::DrawModule()
787{
788 if (Minimized() || IsVisible() == false)
789 return;
790
791 mVolSlider->Draw();
792 mSpeedSlider->Draw();
793 mSpeedRandomizationSlider->Draw();
794 mKitSelector->Draw();
795 mEditCheckbox->Draw();
796 mGridControlTarget->Draw();
797
798 mMonoCheckbox->SetShowing(mEditMode);
799 mAuditionSlider->SetShowing(mEditMode);
800 mShuffleButton->SetShowing(mEditMode);
801
802 if (mEditMode)
803 {
804 ofPushStyle();
805 ofFill();
806 ofSetColor(50, 50, 50, gModuleDrawAlpha);
807 ofRect(300, 5, 145, 360);
808 ofPopStyle();
809
810 mMonoCheckbox->Draw();
811 //mSaveButton->Draw();
812 //mNewKitButton->Draw();
813 //mNewKitNameEntry->Draw();
814 mAuditionSlider->Draw();
815 mShuffleButton->Draw();
816 mQuantizeIntervalSelector->Draw();
817 mNoteRepeatCheckbox->Draw();
818 mFullVelocityCheckbox->Draw();
819 mSingleVoiceCheckbox->Draw();
820
821 ofPushMatrix();
822 ofPushStyle();
823 ofTranslate(5, 70);
824 for (int i = 0; i < 4; ++i)
825 {
826 for (int j = 0; j < 4; ++j)
827 {
828 int sampleIdx = GetAssociatedSampleIndex(i, j);
829
830 ofSetColor(200, 100, 0, gModuleDrawAlpha);
831 ofNoFill();
832 ofRect(i * 70, j * 70, 70, 70);
833
834 float alpha = sqrt(1 - mDrumHits[sampleIdx].GetPlayProgress(gTime));
835 ofSetColor(200, 100, 0, gModuleDrawAlpha * alpha);
836 ofFill();
837 ofRect(i * 70, j * 70, 70, 70);
838
839 if (sampleIdx == mSelectedHitIdx)
840 {
841 ofSetColor(0, 200, 255, gModuleDrawAlpha);
842 ofNoFill();
843 ofRect(i * 70 + 1, j * 70 + 1, 68, 68);

Callers

nothing calls this directly

Calls 15

ofPushStyleFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
ofPushMatrixFunction · 0.85
ofTranslateFunction · 0.85
ofNoFillFunction · 0.85
ofPopMatrixFunction · 0.85
DrawTextNormalFunction · 0.85
ofToStringFunction · 0.85
GetPlayProgressMethod · 0.80

Tested by

no test coverage detected