MCPcopy Create free account
hub / github.com/VCVRack/Rack / CableOpacityQuantity

Class CableOpacityQuantity

src/app/MenuBar.cpp:221–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219
220
221struct CableOpacityQuantity : Quantity {
222 void setValue(float value) override {
223 settings::cableOpacity = math::clamp(value, getMinValue(), getMaxValue());
224 }
225 float getValue() override {
226 return settings::cableOpacity;
227 }
228 float getDefaultValue() override {
229 return 0.5;
230 }
231 float getDisplayValue() override {
232 return getValue() * 100;
233 }
234 void setDisplayValue(float displayValue) override {
235 setValue(displayValue / 100);
236 }
237 std::string getLabel() override {
238 return string::translate("MenuBar.view.cableOpacity");
239 }
240 std::string getUnit() override {
241 return "%";
242 }
243};
244struct CableOpacitySlider : ui::Slider {
245 CableOpacitySlider() {
246 quantity = new CableOpacityQuantity;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected