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

Method DrawModule

Source/RhythmSequencer.cpp:117–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117void RhythmSequencer::DrawModule()
118{
119 if (Minimized() || IsVisible() == false)
120 return;
121
122 mIntervalSelector->SetShowing(!mHasExternalPulseSource);
123 mIntervalSelector->Draw();
124 mLengthSlider->SetShowing(mLinkLengths);
125 mLengthSlider->Draw();
126 mLinkLengthsCheckbox->Draw();
127 mLengthActionSlider->SetShowing(!mLinkLengths);
128 mLengthActionSlider->Draw();
129 mLengthVelSlider->SetShowing(!mLinkLengths);
130 mLengthVelSlider->Draw();
131 mLengthOctaveSlider->SetShowing(!mLinkLengths);
132 mLengthOctaveSlider->Draw();
133 mLengthDegreeSlider->SetShowing(!mLinkLengths);
134 mLengthDegreeSlider->Draw();
135
136 for (int i = 0; i < kMaxSteps; ++i)
137 {
138 mStepData[i].mActionSelector->Draw();
139 mStepData[i].mVelSlider->Draw();
140 mStepData[i].mOctaveSlider->Draw();
141 mStepData[i].mDegreeSelector->Draw();
142 }
143
144 ofPushStyle();
145 if (mStepData[mArpIndexAction].mAction == StepAction::On)
146 ofSetColor(0, 255, 0, 80);
147 else if (DoesStepHold(mArpIndexAction, 0))
148 ofSetColor(255, 255, 0, 80);
149 else
150 ofSetColor(255, 0, 0, 80);
151 ofFill();
152 if (mArpIndexAction >= 0 && mArpIndexAction < kMaxSteps)
153 ofRect(mStepData[mArpIndexAction].mActionSelector->GetRect(true));
154 if (mArpIndexVel >= 0 && mArpIndexVel < kMaxSteps)
155 ofRect(mStepData[mArpIndexVel].mVelSlider->GetRect(true));
156 if (mArpIndexOctave >= 0 && mArpIndexOctave < kMaxSteps)
157 ofRect(mStepData[mArpIndexOctave].mOctaveSlider->GetRect(true));
158 if (mArpIndexDegree >= 0 && mArpIndexDegree < kMaxSteps)
159 ofRect(mStepData[mArpIndexDegree].mDegreeSelector->GetRect(true));
160
161 ofSetColor(0, 255, 0, 255);
162 for (int i = 0; i < (int)mStepData.size(); ++i)
163 {
164 if (mStepData[i].mAction == StepAction::On && i < mLengthAction)
165 {
166 ofRectangle rect = mStepData[i].mActionSelector->GetRect(true);
167 ofCircle(rect.x - 6, rect.getCenter().y, 3);
168 }
169
170 if (DoesStepHold(i, 0) && i < mLengthAction)
171 {
172 ofRectangle rect = mStepData[i].mActionSelector->GetRect(true);
173 ofLine(rect.x - 6, rect.getCenter().y + 1, rect.x - 6, rect.getCenter().y - 16);
174 }

Callers

nothing calls this directly

Calls 13

ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofCircleFunction · 0.85
ofLineFunction · 0.85
ofPopStyleFunction · 0.85
sizeMethod · 0.80
getCenterMethod · 0.80
getMaxYMethod · 0.80
SetShowingMethod · 0.45
DrawMethod · 0.45

Tested by

no test coverage detected