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

Method DrawModule

Source/ControllingSong.cpp:206–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void ControllingSong::DrawModule()
207{
208 if (Minimized() || IsVisible() == false)
209 return;
210
211 mNextSongButton->Draw();
212 mSongSelector->Draw();
213 mTestBeatOffsetSlider->Draw();
214 mPlayCheckbox->Draw();
215 mShuffleCheckbox->Draw();
216 mPhraseForwardButton->Draw();
217 mPhraseBackButton->Draw();
218 mSpeedSlider->Draw();
219 mMuteCheckbox->Draw();
220 mVolumeSlider->Draw();
221
222 if (mCurrentSongIndex != -1)
223 {
224 ofPushMatrix();
225 ofTranslate(10, 50);
226 if (mCurrentSongIndex != -1)
227 DrawTextNormal(mSongList["songs"][mCurrentSongIndex]["name"].asString(), 0, -10);
228 DrawAudioBuffer(540, 100, mSample.Data(), 0, mSample.LengthInSamples() / mSample.GetSampleRateRatio(), mSample.GetPlayPosition());
229 ofPopMatrix();
230 }
231
232 ofPushStyle();
233 float w, h;
234 GetDimensions(w, h);
235 ofFill();
236 ofSetColor(255, 255, 255, 50);
237 float beatWidth = w / 4;
238 ofRect(int(TheTransport->GetMeasurePos(gTime) * 4) * beatWidth, 0, beatWidth, h);
239 ofPopStyle();
240}
241
242void ControllingSong::DropdownUpdated(DropdownList* list, int oldVal, double time)
243{

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected