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

Method DrawModule

Source/SeaOfGrain.cpp:159–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void SeaOfGrain::DrawModule()
160{
161 if (Minimized() || IsVisible() == false)
162 return;
163
164 mLoadButton->Draw();
165 mRecordInputCheckbox->Draw();
166 mVolumeSlider->Draw();
167 mDisplayOffsetSlider->Draw();
168 mDisplayLengthSlider->Draw();
169 mKeyboardBasePitchSelector->Draw();
170 mKeyboardNumPitchesSelector->Draw();
171
172 for (int i = 0; i < kNumManualVoices; ++i)
173 {
174 mManualVoices[i].mGainSlider->Draw();
175 mManualVoices[i].mPositionSlider->Draw();
176 mManualVoices[i].mOverlapSlider->Draw();
177 mManualVoices[i].mSpeedSlider->Draw();
178 mManualVoices[i].mLengthMsSlider->Draw();
179 mManualVoices[i].mPosRandomizeSlider->Draw();
180 mManualVoices[i].mSpeedRandomizeSlider->Draw();
181 mManualVoices[i].mSpacingRandomizeSlider->Draw();
182 mManualVoices[i].mOctaveCheckbox->Draw();
183 mManualVoices[i].mWidthSlider->Draw();
184 mManualVoices[i].mPanSlider->Draw();
185 }
186
187 if (mSample || mHasRecordedInput)
188 {
189 ofPushMatrix();
190 ofTranslate(mBufferX, mBufferY);
191 ofPushStyle();
192
193 if (mHasRecordedInput)
194 {
195 mRecordBuffer.Draw(0, 0, mBufferW, mBufferH, mDisplayLength * gSampleRate);
196 }
197 else
198 {
199 mSample->LockDataMutex(true);
200 DrawAudioBuffer(mBufferW, mBufferH, mSample->Data(), mDisplayStartSamples, mDisplayEndSamples, 0);
201 DrawTextNormal(std::string(mSample->Name()), 5, 10);
202 mSample->LockDataMutex(false);
203 }
204
205 ofPushStyle();
206 ofFill();
207 for (int i = 0; i < mKeyboardNumPitches; ++i)
208 {
209 ofSetColor(i % 2 * 200, 200, 0);
210 ofRect(mBufferW * float(i) / mKeyboardNumPitches, mBufferH, mBufferW / mKeyboardNumPitches, 10);
211 }
212 ofPopStyle();
213
214 for (int i = 0; i < kNumMPEVoices; ++i)
215 mMPEVoices[i].Draw(mBufferW, mBufferH);
216 for (int i = 0; i < kNumManualVoices; ++i)

Callers

nothing calls this directly

Calls 14

ofPushMatrixFunction · 0.85
ofTranslateFunction · 0.85
ofPushStyleFunction · 0.85
DrawAudioBufferFunction · 0.85
DrawTextNormalFunction · 0.85
ofFillFunction · 0.85
ofSetColorFunction · 0.85
ofRectFunction · 0.85
ofPopStyleFunction · 0.85
ofPopMatrixFunction · 0.85
LockDataMutexMethod · 0.80
DataMethod · 0.80

Tested by

no test coverage detected