| 196 | } |
| 197 | |
| 198 | bool FloatSliderLFOControl::DrawToPush2Screen() |
| 199 | { |
| 200 | FloatSlider* slider = GetOwner(); |
| 201 | if (slider) |
| 202 | { |
| 203 | ofRectangle rect(30, -12, 100, 11); |
| 204 | ofSetColor(100, 100, 100); |
| 205 | ofRect(rect); |
| 206 | |
| 207 | float screenPos = rect.x + 1 + (rect.width - 2) * slider->ValToPos(slider->GetValue(), true); |
| 208 | float lfomax = ofClamp(GetMax(), slider->GetMin(), slider->GetMax()); |
| 209 | float screenPosMax = rect.x + 1 + (rect.width - 2) * slider->ValToPos(lfomax, true); |
| 210 | float lfomin = ofClamp(GetMin(), slider->GetMin(), slider->GetMax()); |
| 211 | float screenPosMin = rect.x + 1 + (rect.width - 2) * slider->ValToPos(lfomin, true); |
| 212 | |
| 213 | ofPushStyle(); |
| 214 | ofSetColor(0, 200, 0); |
| 215 | ofFill(); |
| 216 | if (fabs(screenPos - screenPosMin) > 1) |
| 217 | ofRect(screenPosMin, rect.y, screenPos - screenPosMin, rect.height, 1); //lfo bar |
| 218 | ofPopStyle(); |
| 219 | |
| 220 | ofPushStyle(); |
| 221 | ofSetColor(0, 255, 0); |
| 222 | ofSetLineWidth(2); |
| 223 | ofLine(screenPosMin, rect.y + 1, screenPosMin, rect.getMaxY() - 1); //min bar |
| 224 | ofLine(screenPosMax, rect.y + 1, screenPosMax, rect.getMaxY() - 1); //max bar |
| 225 | ofPopStyle(); |
| 226 | } |
| 227 | return false; |
| 228 | } |
| 229 | |
| 230 | void FloatSliderLFOControl::SetLFOEnabled(bool enabled) |
| 231 | { |
nothing calls this directly
no test coverage detected