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

Method DrawModule

Source/NoteHocket.cpp:73–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void NoteHocket::DrawModule()
74{
75 if (Minimized() || IsVisible() == false)
76 return;
77
78 for (int i = 0; i < kMaxDestinations; ++i)
79 {
80 mWeightSlider[i]->SetShowing(i < mNumDestinations);
81 mWeightSlider[i]->Draw();
82 }
83
84 mLengthSlider->SetShowing(mDeterministic);
85 mLengthSlider->Draw();
86 mSeedEntry->SetShowing(mDeterministic);
87 mSeedEntry->Draw();
88 mPrevSeedButton->SetShowing(mDeterministic);
89 mPrevSeedButton->Draw();
90 mReseedButton->SetShowing(mDeterministic);
91 mReseedButton->Draw();
92 mNextSeedButton->SetShowing(mDeterministic);
93 mNextSeedButton->Draw();
94
95 if (mDeterministic)
96 {
97 ofRectangle lengthRect = mLengthSlider->GetRect(true);
98 ofPushStyle();
99 ofSetColor(0, 255, 0);
100 ofFill();
101 float pos = fmod(TheTransport->GetMeasureTime(gTime) * TheTransport->GetTimeSigTop() / mLength, 1);
102 const float kPipSize = 3;
103 float moduleWidth, moduleHeight;
104 GetModuleDimensions(moduleWidth, moduleHeight);
105 ofRect(ofMap(pos, 0, 1, 0, moduleWidth - kPipSize), lengthRect.y - 5, kPipSize, kPipSize);
106 ofPopStyle();
107 }
108}
109
110void NoteHocket::AdjustHeight()
111{

Callers

nothing calls this directly

Calls 11

ofPushStyleFunction · 0.85
ofSetColorFunction · 0.85
ofFillFunction · 0.85
ofRectFunction · 0.85
ofMapFunction · 0.85
ofPopStyleFunction · 0.85
GetMeasureTimeMethod · 0.80
GetTimeSigTopMethod · 0.80
SetShowingMethod · 0.45
DrawMethod · 0.45
GetRectMethod · 0.45

Tested by

no test coverage detected