BogaudioModules

BogaudioModules for VCV Rack
Log | Files | Refs | README | LICENSE

commit bd326bdf641c504fcad6947df4e2ffe3599c45eb
parent caf7e17299f476fb3d8fe476cef5ae2ba490beb6
Author: Matt Demanett <matt@demanett.net>
Date:   Sun, 19 May 2019 01:19:25 -0400

v1: *LFO display fixes.

Diffstat:
Msrc/EightFO.cpp | 4++--
Msrc/LFO.cpp | 4++--
Msrc/LLFO.cpp | 4++--
Msrc/lfo_base.hpp | 50+++++++++++++++++++++++++-------------------------
4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/src/EightFO.cpp b/src/EightFO.cpp @@ -166,8 +166,8 @@ struct EightFOWidget : LFOBaseWidget { : LFOBaseWidget( module, new SVGPanel(), - APP->window->loadSvg(asset::plugin(pluginInstance, "res/EightFO-classic.svg")), - APP->window->loadSvg(asset::plugin(pluginInstance, "res/EightFO.svg")) + "res/EightFO-classic.svg", + "res/EightFO.svg" ) { box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); _panel->box.size = box.size; diff --git a/src/LFO.cpp b/src/LFO.cpp @@ -108,8 +108,8 @@ struct LFOWidget : LFOBaseWidget { : LFOBaseWidget( module, new SVGPanel(), - APP->window->loadSvg(asset::plugin(pluginInstance, "res/LFO-classic.svg")), - APP->window->loadSvg(asset::plugin(pluginInstance, "res/LFO.svg")) + "res/LFO-classic.svg", + "res/LFO.svg" ) { box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); _panel->box.size = box.size; diff --git a/src/LLFO.cpp b/src/LLFO.cpp @@ -85,8 +85,8 @@ struct LLFOWidget : LFOBaseWidget { : LFOBaseWidget( module, new SVGPanel(), - APP->window->loadSvg(asset::plugin(pluginInstance, "res/LLFO-classic.svg")), - APP->window->loadSvg(asset::plugin(pluginInstance, "res/LLFO.svg")) + "res/LLFO-classic.svg", + "res/LLFO.svg" ) { box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); _panel->box.size = box.size; diff --git a/src/lfo_base.hpp b/src/lfo_base.hpp @@ -60,20 +60,20 @@ struct PitchModeMenuItem : MenuItem { struct LFOBaseWidget : ModuleWidget, PitchModeListener { LFOBase* _module; SVGPanel* _panel; - std::shared_ptr<SVG> _classicSVG; - std::shared_ptr<SVG> _compliantSVG; + const char* _classicSVGName; + const char* _compliantSVGName; SVGKnob* _frequencyKnob = NULL; LFOBaseWidget( LFOBase* module, SVGPanel* panel, - std::shared_ptr<SVG> classicSVG, - std::shared_ptr<SVG> compliantSVG + const char* classicSVGName, + const char* compliantSVGName ) : _module(module) , _panel(panel) - , _classicSVG(classicSVG) - , _compliantSVG(compliantSVG) + , _classicSVGName(classicSVGName) + , _compliantSVGName(compliantSVGName) { setModule(module); setSVG(); @@ -84,23 +84,23 @@ struct LFOBaseWidget : ModuleWidget, PitchModeListener { void setSVG() { // FIXME.v1 - // if (_module->isCompliantPitchMode()) { - // _panel->setBackground(_compliantSVG); - // if (_frequencyKnob) { - // _frequencyKnob->minValue = -5.0f; - // _frequencyKnob->maxValue = 8.0f; - // _frequencyKnob->dirty = true; - // } - // } - // else { - // _panel->setBackground(_classicSVG); - // if (_frequencyKnob) { - // _frequencyKnob->minValue = -8.0f; - // _frequencyKnob->maxValue = 5.0f; - // _frequencyKnob->dirty = true; - // } - // } - // _panel->dirty = true; + if (_module && !_module->isCompliantPitchMode()) { + _panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance, _classicSVGName))); + // if (_frequencyKnob) { + // _frequencyKnob->minValue = -8.0f; + // _frequencyKnob->maxValue = 5.0f; + // _frequencyKnob->dirty = true; + // } + } + else { + _panel->setBackground(APP->window->loadSvg(asset::plugin(pluginInstance, _compliantSVGName))); + // if (_frequencyKnob) { + // _frequencyKnob->minValue = -5.0f; + // _frequencyKnob->maxValue = 8.0f; + // _frequencyKnob->dirty = true; + // } + } + _panel->dirty = true; } void pitchModeChanged() override { @@ -111,8 +111,8 @@ struct LFOBaseWidget : ModuleWidget, PitchModeListener { LFOBase* lfo = dynamic_cast<LFOBase*>(module); assert(lfo); menu->addChild(new MenuLabel()); - menu->addChild(new PitchModeMenuItem(lfo, "Standard pitch mode: 0V = C-3 = 2.04HZ", true)); - menu->addChild(new PitchModeMenuItem(lfo, "Classic pitch mode: 0V = C0 = 16.35HZ", false)); + menu->addChild(new PitchModeMenuItem(lfo, "Pitch: 0V = C-3 = 2.04HZ", true)); + menu->addChild(new PitchModeMenuItem(lfo, "Pitch: 0V = C0 = 16.35HZ", false)); } };