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

Method DrawModule

Source/FloatSliderLFOControl.cpp:115–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113FloatSliderLFOControl::~FloatSliderLFOControl() = default;
114
115void FloatSliderLFOControl::DrawModule()
116{
117 /*if (!mPinned)
118 {
119 float w, h;
120 GetDimensions(w, h);
121
122 ofPushStyle();
123 ofSetColor(0, 0, 0);
124 ofFill();
125 ofSetLineWidth(.5f);
126 ofRect(0, 0, w, h);
127 ofNoFill();
128 ofSetColor(255, 255, 255);
129 ofRect(0, 0, w, h);
130 ofPopStyle();
131 }*/
132
133 if (Minimized())
134 return;
135
136 mEnableLFOCheckbox->Draw();
137 mIntervalSelector->Draw();
138 mOscSelector->Draw();
139 mOffsetSlider->Draw();
140 mBiasSlider->Draw();
141 mFreeRateSlider->Draw();
142 mMinSlider->Draw();
143 mMaxSlider->Draw();
144 mSpreadSlider->Draw();
145 mSoftenSlider->Draw();
146 mShuffleSlider->Draw();
147 mLengthSlider->Draw();
148 mLowResModeCheckbox->Draw();
149 if (!mPinned)
150 mPinButton->Draw();
151
152 int x = 5;
153 int y = 20;
154 int height = 35;
155 int width = 90;
156
157 ofSetColor(100, 100, .8f * gModuleDrawAlpha);
158 ofSetLineWidth(.5f);
159 ofRect(x, y, width, height, 0);
160
161 ofSetColor(245, 58, 0, gModuleDrawAlpha);
162 ofSetLineWidth(1);
163
164 ofBeginShape();
165 for (float i = 0; i < width; i += (.25f / gDrawScale))
166 {
167 float phase = i / width;
168 if (mLFO.GetOsc()->GetShuffle() > 0)
169 phase *= 2;
170 if (mLFO.GetOsc()->GetType() != kOsc_Perlin)
171 phase += 1 - mLFOSettings.mLFOOffset;
172 float value = GetLFOValue(0, mLFO.TransformPhase(phase));

Callers

nothing calls this directly

Calls 14

ofSetColorFunction · 0.85
ofSetLineWidthFunction · 0.85
ofRectFunction · 0.85
ofBeginShapeFunction · 0.85
ofVertexFunction · 0.85
ofMapFunction · 0.85
ofEndShapeFunction · 0.85
ofCircleFunction · 0.85
GetShuffleMethod · 0.80
GetOscMethod · 0.80
TransformPhaseMethod · 0.80
CalculatePhaseMethod · 0.80

Tested by

no test coverage detected