commit 7d80459c9800ca1452d4a6b46bbc13032d436f85 parent 135f4ec8466a49f764f9a45c5e93472dba2330fd Author: Matt Demanett <matt@demanett.net> Date: Fri, 17 May 2019 23:56:35 -0400 v1: COMPILES. Diffstat:
91 files changed, 333 insertions(+), 270 deletions(-)
diff --git a/src/AD.cpp b/src/AD.cpp @@ -69,7 +69,7 @@ struct ADWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/AD.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/AD.svg"))); addChild(panel); } diff --git a/src/AD.hpp b/src/AD.hpp @@ -48,8 +48,8 @@ struct AD : Module { PulseGenerator _eocPulseGen; bool _on = false; ADSR _envelope; - SlewLimiter _attackSL; - SlewLimiter _decaySL; + bogaudio::dsp::SlewLimiter _attackSL; + bogaudio::dsp::SlewLimiter _decaySL; AD() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { onReset(); diff --git a/src/ADSR.cpp b/src/ADSR.cpp @@ -48,7 +48,7 @@ struct ADSRWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/ADSR.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/ADSR.svg"))); addChild(panel); } diff --git a/src/AMRM.cpp b/src/AMRM.cpp @@ -40,7 +40,7 @@ struct AMRMWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/AMRM.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/AMRM.svg"))); addChild(panel); } diff --git a/src/Additator.cpp b/src/Additator.cpp @@ -154,7 +154,7 @@ struct AdditatorWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Additator.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Additator.svg"))); addChild(panel); } diff --git a/src/Additator.hpp b/src/Additator.hpp @@ -84,13 +84,13 @@ struct Additator : Module { int _activePartials = 1; SineBankOscillator _oscillator; PositiveZeroCrossing _syncTrigger; - SlewLimiter _widthSL; - SlewLimiter _oddSkewSL; - SlewLimiter _evenSkewSL; - SlewLimiter _amplitudeNormalizationSL; - SlewLimiter _decaySL; - SlewLimiter _balanceSL; - SlewLimiter _filterSL; + bogaudio::dsp::SlewLimiter _widthSL; + bogaudio::dsp::SlewLimiter _oddSkewSL; + bogaudio::dsp::SlewLimiter _evenSkewSL; + bogaudio::dsp::SlewLimiter _amplitudeNormalizationSL; + bogaudio::dsp::SlewLimiter _decaySL; + bogaudio::dsp::SlewLimiter _balanceSL; + bogaudio::dsp::SlewLimiter _filterSL; Additator() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) diff --git a/src/AddrSeq.cpp b/src/AddrSeq.cpp @@ -82,7 +82,7 @@ struct AddrSeqWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/AddrSeq.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/AddrSeq.svg"))); addChild(panel); } diff --git a/src/AddrSeq.hpp b/src/AddrSeq.hpp @@ -51,7 +51,7 @@ struct AddrSeq : Module { Trigger _clock; Trigger _reset; - Timer _timer; + bogaudio::dsp::Timer _timer; int _step; bool _selectOnClock = false; int _select = 0; diff --git a/src/Analyzer.cpp b/src/Analyzer.cpp @@ -110,7 +110,7 @@ struct AnalyzerWidget : ModuleWidget { { auto panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Analyzer.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Analyzer.svg"))); addChild(panel); } diff --git a/src/AnalyzerXL.cpp b/src/AnalyzerXL.cpp @@ -248,7 +248,7 @@ struct AnalyzerXLWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/AnalyzerXL.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/AnalyzerXL.svg"))); addChild(panel); } diff --git a/src/Blank3.cpp b/src/Blank3.cpp @@ -25,7 +25,7 @@ struct Blank3Display : OpaqueWidget { Blank3Display(Blank3* module, const char* text) : _module(module) , _text(text) - , _font(Font::load(assetPlugin(pluginInstance, "res/fonts/audiowide.ttf"))) + , _font(Font::load(asset::plugin(pluginInstance, "res/fonts/audiowide.ttf"))) { } @@ -68,7 +68,7 @@ struct Blank3Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Blank3.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Blank3.svg"))); addChild(panel); } diff --git a/src/Blank6.cpp b/src/Blank6.cpp @@ -25,7 +25,7 @@ struct Blank6Display : OpaqueWidget { Blank6Display(Blank6* module, const char* text) : _module(module) , _text(text) - , _font(Font::load(assetPlugin(pluginInstance, "res/fonts/audiowide.ttf"))) + , _font(Font::load(asset::plugin(pluginInstance, "res/fonts/audiowide.ttf"))) { } @@ -68,7 +68,7 @@ struct Blank6Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Blank6.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Blank6.svg"))); addChild(panel); } diff --git a/src/Bool.cpp b/src/Bool.cpp @@ -20,7 +20,7 @@ struct BoolWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Bool.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Bool.svg"))); addChild(panel); } diff --git a/src/CVD.cpp b/src/CVD.cpp @@ -42,7 +42,7 @@ struct CVDWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/CVD.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/CVD.svg"))); addChild(panel); } diff --git a/src/Clpr.cpp b/src/Clpr.cpp @@ -57,7 +57,7 @@ struct ClprWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Clpr.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Clpr.svg"))); addChild(panel); } diff --git a/src/Cmp.cpp b/src/Cmp.cpp @@ -162,7 +162,7 @@ struct CmpWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Cmp.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Cmp.svg"))); addChild(panel); } diff --git a/src/DADSRH.cpp b/src/DADSRH.cpp @@ -10,7 +10,7 @@ struct DADSRHWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/DADSRH.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/DADSRH.svg"))); addChild(panel); } diff --git a/src/DADSRHPlus.cpp b/src/DADSRHPlus.cpp @@ -10,7 +10,7 @@ struct DADSRHPlusWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/DADSRHPlus.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/DADSRHPlus.svg"))); addChild(panel); } diff --git a/src/DGate.cpp b/src/DGate.cpp @@ -79,7 +79,7 @@ struct DGateWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/DGate.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/DGate.svg"))); addChild(panel); } diff --git a/src/Detune.cpp b/src/Detune.cpp @@ -46,7 +46,7 @@ struct DetuneWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Detune.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Detune.svg"))); addChild(panel); } diff --git a/src/EightFO.cpp b/src/EightFO.cpp @@ -157,8 +157,8 @@ struct EightFOWidget : LFOBaseWidget { : LFOBaseWidget( module, new SVGPanel(), - SVG::load(assetPlugin(pluginInstance, "res/EightFO-classic.svg")), - SVG::load(assetPlugin(pluginInstance, "res/EightFO.svg")) + SVG::load(asset::plugin(pluginInstance, "res/EightFO-classic.svg")), + SVG::load(asset::plugin(pluginInstance, "res/EightFO.svg")) ) { box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); _panel->box.size = box.size; diff --git a/src/EightOne.cpp b/src/EightOne.cpp @@ -82,7 +82,7 @@ struct EightOneWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/EightOne.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/EightOne.svg"))); addChild(panel); } diff --git a/src/EightOne.hpp b/src/EightOne.hpp @@ -51,7 +51,7 @@ struct EightOne : Module { Trigger _clock; Trigger _reset; - Timer _timer; + bogaudio::dsp::Timer _timer; int _step; bool _selectOnClock = false; int _select = 0; diff --git a/src/FMOp.cpp b/src/FMOp.cpp @@ -215,7 +215,7 @@ struct FMOpWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/FMOp.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/FMOp.svg"))); addChild(panel); } diff --git a/src/FMOp.hpp b/src/FMOp.hpp @@ -73,10 +73,10 @@ struct FMOp : Module { SineTableOscillator _sineTable; CICDecimator _decimator; Trigger _gateTrigger; - SlewLimiter _feedbackSL; - SlewLimiter _depthSL; - SlewLimiter _levelSL; - SlewLimiter _sustainSL; + bogaudio::dsp::SlewLimiter _feedbackSL; + bogaudio::dsp::SlewLimiter _depthSL; + bogaudio::dsp::SlewLimiter _levelSL; + bogaudio::dsp::SlewLimiter _sustainSL; Amplifier _amplifier; bool _linearLevel = false; diff --git a/src/FlipFlop.cpp b/src/FlipFlop.cpp @@ -68,7 +68,7 @@ struct FlipFlopWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/FlipFlop.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/FlipFlop.svg"))); addChild(panel); } diff --git a/src/Follow.cpp b/src/Follow.cpp @@ -31,7 +31,7 @@ struct FollowWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Follow.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Follow.svg"))); addChild(panel); } diff --git a/src/LFO.cpp b/src/LFO.cpp @@ -108,8 +108,8 @@ struct LFOWidget : LFOBaseWidget { : LFOBaseWidget( module, new SVGPanel(), - SVG::load(assetPlugin(pluginInstance, "res/LFO-classic.svg")), - SVG::load(assetPlugin(pluginInstance, "res/LFO.svg")) + SVG::load(asset::plugin(pluginInstance, "res/LFO-classic.svg")), + SVG::load(asset::plugin(pluginInstance, "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(), - SVG::load(assetPlugin(pluginInstance, "res/LLFO-classic.svg")), - SVG::load(assetPlugin(pluginInstance, "res/LLFO.svg")) + SVG::load(asset::plugin(pluginInstance, "res/LLFO-classic.svg")), + SVG::load(asset::plugin(pluginInstance, "res/LLFO.svg")) ) { box.size = Vec(RACK_GRID_WIDTH * hp, RACK_GRID_HEIGHT); _panel->box.size = box.size; diff --git a/src/Lag.cpp b/src/Lag.cpp @@ -58,7 +58,7 @@ struct LagWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Lag.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Lag.svg"))); addChild(panel); } diff --git a/src/Lmtr.cpp b/src/Lmtr.cpp @@ -73,7 +73,7 @@ struct LmtrWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Lmtr.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Lmtr.svg"))); addChild(panel); } diff --git a/src/Lmtr.hpp b/src/Lmtr.hpp @@ -43,8 +43,8 @@ struct Lmtr : Module { bool _softKnee = true; float _lastEnv = 0.0f; - SlewLimiter _attackSL; - SlewLimiter _releaseSL; + bogaudio::dsp::SlewLimiter _attackSL; + bogaudio::dsp::SlewLimiter _releaseSL; RootMeanSquare _detector; Compressor _compressor; Amplifier _amplifier; diff --git a/src/Manual.cpp b/src/Manual.cpp @@ -38,7 +38,7 @@ struct ManualWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Manual.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Manual.svg"))); addChild(panel); } diff --git a/src/Matrix88.cpp b/src/Matrix88.cpp @@ -21,7 +21,7 @@ struct Matrix88Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Matrix88.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Matrix88.svg"))); addChild(panel); } diff --git a/src/Mix1.cpp b/src/Mix1.cpp @@ -19,7 +19,7 @@ struct Mix1Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Mix1.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Mix1.svg"))); addChild(panel); } diff --git a/src/Mix4.cpp b/src/Mix4.cpp @@ -76,7 +76,7 @@ struct Mix4Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Mix4.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Mix4.svg"))); addChild(panel); } diff --git a/src/Mix4.hpp b/src/Mix4.hpp @@ -61,7 +61,7 @@ struct Mix4 : Module { MixerChannel _channel3; MixerChannel _channel4; Amplifier _amplifier; - SlewLimiter _slewLimiter; + bogaudio::dsp::SlewLimiter _slewLimiter; Saturator _saturator; RootMeanSquare _rms; float _rmsLevel = 0.0f; diff --git a/src/Mix8.cpp b/src/Mix8.cpp @@ -100,7 +100,7 @@ struct Mix8Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Mix8.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Mix8.svg"))); addChild(panel); } diff --git a/src/Mix8.hpp b/src/Mix8.hpp @@ -89,7 +89,7 @@ struct Mix8 : Module { MixerChannel _channel7; MixerChannel _channel8; Amplifier _amplifier; - SlewLimiter _slewLimiter; + bogaudio::dsp::SlewLimiter _slewLimiter; Saturator _saturator; RootMeanSquare _rms; float _rmsLevel = 0.0f; diff --git a/src/Mult.cpp b/src/Mult.cpp @@ -24,7 +24,7 @@ struct MultWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Mult.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Mult.svg"))); addChild(panel); } diff --git a/src/Mute8.cpp b/src/Mute8.cpp @@ -52,7 +52,7 @@ struct Mute8Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Mute8.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Mute8.svg"))); addChild(panel); } diff --git a/src/Mute8.hpp b/src/Mute8.hpp @@ -71,7 +71,7 @@ struct Mute8 : Module { static const float slewTimeMS; Amplifier _amplifiers[8]; - SlewLimiter _slewLimiters[8]; + bogaudio::dsp::SlewLimiter _slewLimiters[8]; Trigger _triggers[8]; Mute8() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { diff --git a/src/Noise.cpp b/src/Noise.cpp @@ -37,7 +37,7 @@ struct NoiseWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Noise.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Noise.svg"))); addChild(panel); } diff --git a/src/Nsgt.cpp b/src/Nsgt.cpp @@ -77,7 +77,7 @@ struct NsgtWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Nsgt.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Nsgt.svg"))); addChild(panel); } diff --git a/src/Nsgt.hpp b/src/Nsgt.hpp @@ -43,8 +43,8 @@ struct Nsgt : Module { bool _softKnee = true; float _lastEnv = 0.0f; - SlewLimiter _attackSL; - SlewLimiter _releaseSL; + bogaudio::dsp::SlewLimiter _attackSL; + bogaudio::dsp::SlewLimiter _releaseSL; RootMeanSquare _detector; NoiseGate _noiseGate; Amplifier _amplifier; diff --git a/src/Offset.cpp b/src/Offset.cpp @@ -33,7 +33,7 @@ struct OffsetWidget : DisableOutputLimitModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Offset.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Offset.svg"))); addChild(panel); } diff --git a/src/OneEight.cpp b/src/OneEight.cpp @@ -81,7 +81,7 @@ struct OneEightWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/OneEight.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/OneEight.svg"))); addChild(panel); } diff --git a/src/OneEight.hpp b/src/OneEight.hpp @@ -51,7 +51,7 @@ struct OneEight : Module { Trigger _clock; Trigger _reset; - Timer _timer; + bogaudio::dsp::Timer _timer; int _step; bool _selectOnClock = false; int _select = 0; diff --git a/src/Pan.cpp b/src/Pan.cpp @@ -41,7 +41,7 @@ struct PanWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Pan.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Pan.svg"))); addChild(panel); } diff --git a/src/Pan.hpp b/src/Pan.hpp @@ -36,8 +36,8 @@ struct Pan : Module { Panner _panner1; Panner _panner2; - SlewLimiter _slew1; - SlewLimiter _slew2; + bogaudio::dsp::SlewLimiter _slew1; + bogaudio::dsp::SlewLimiter _slew2; Saturator _saturatorLeft; Saturator _saturatorRight; diff --git a/src/Pressor.cpp b/src/Pressor.cpp @@ -173,7 +173,7 @@ struct PressorWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Pressor.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Pressor.svg"))); addChild(panel); } diff --git a/src/Pressor.hpp b/src/Pressor.hpp @@ -63,8 +63,8 @@ struct Pressor : Module { float _lastEnv = 0.0f; float _compressionDb = 0.0f; - SlewLimiter _attackSL; - SlewLimiter _releaseSL; + bogaudio::dsp::SlewLimiter _attackSL; + bogaudio::dsp::SlewLimiter _releaseSL; CrossFader _detectorMix; RootMeanSquare _detectorRMS; Compressor _compressor; diff --git a/src/Reftone.cpp b/src/Reftone.cpp @@ -47,7 +47,7 @@ struct ReftoneDisplay : TransparentWidget { ) : _module(module) , _size(size) - , _font(Font::load(assetPlugin(pluginInstance, "res/fonts/inconsolata-bold.ttf"))) + , _font(Font::load(asset::plugin(pluginInstance, "res/fonts/inconsolata-bold.ttf"))) { } @@ -187,7 +187,7 @@ struct ReftoneWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Reftone.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Reftone.svg"))); addChild(panel); } diff --git a/src/SampleHold.cpp b/src/SampleHold.cpp @@ -47,7 +47,7 @@ struct SampleHoldWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/SampleHold.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/SampleHold.svg"))); addChild(panel); } diff --git a/src/Shaper.cpp b/src/Shaper.cpp @@ -10,7 +10,7 @@ struct ShaperWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Shaper.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Shaper.svg"))); addChild(panel); } diff --git a/src/ShaperPlus.cpp b/src/ShaperPlus.cpp @@ -10,7 +10,7 @@ struct ShaperPlusWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/ShaperPlus.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/ShaperPlus.svg"))); addChild(panel); } diff --git a/src/Slew.cpp b/src/Slew.cpp @@ -69,7 +69,7 @@ struct SlewWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Slew.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Slew.svg"))); addChild(panel); } diff --git a/src/Stack.cpp b/src/Stack.cpp @@ -48,7 +48,7 @@ struct StackWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Stack.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Stack.svg"))); addChild(panel); } diff --git a/src/Sums.cpp b/src/Sums.cpp @@ -41,7 +41,7 @@ struct SumsWidget : DisableOutputLimitModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Sums.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Sums.svg"))); addChild(panel); } diff --git a/src/Switch.cpp b/src/Switch.cpp @@ -38,7 +38,7 @@ struct SwitchWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Switch.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Switch.svg"))); addChild(panel); } @@ -77,4 +77,4 @@ struct SwitchWidget : ModuleWidget { } }; -Model* modelSwitch = bogaudio::createModel<Switch, SwitchWidget>("Bogaudio-Switch", "Switch", "signal router", SWITCH_TAG); +Model* modelSwitch = bogaudio::createModel<bogaudio::Switch, SwitchWidget>("Bogaudio-Switch", "Switch", "signal router", SWITCH_TAG); diff --git a/src/Test.cpp b/src/Test.cpp @@ -489,7 +489,7 @@ struct TestWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Test.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Test.svg"))); addChild(panel); } @@ -524,4 +524,4 @@ struct TestWidget : ModuleWidget { } }; -Model* modelTest = Model::create<Test, TestWidget>("Bogaudio", "Bogaudio-Test", "Test"); +Model* modelTest = rack::createModel<Test, TestWidget>("Bogaudio-Test"); diff --git a/src/Test.hpp b/src/Test.hpp @@ -211,7 +211,7 @@ struct Test : Module { SineTableOscillator _sine; TablePhasor _table; #elif SLEW - SlewLimiter _slew; + bogaudio::dsp::SlewLimiter _slew; ShapedSlewLimiter _slew2; #elif RMS RootMeanSquare _rms; diff --git a/src/Test2.cpp b/src/Test2.cpp @@ -111,7 +111,7 @@ struct Test2Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Test2.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Test2.svg"))); addChild(panel); } @@ -156,4 +156,4 @@ struct Test2Widget : ModuleWidget { } }; -Model* modelTest2 = Model::create<Test2, Test2Widget>("Bogaudio", "Bogaudio-Test2", "Test2"); +Model* modelTest2 = rack::createModel<Test2, Test2Widget>("Bogaudio-Test2"); diff --git a/src/UMix.cpp b/src/UMix.cpp @@ -110,7 +110,7 @@ struct UMixWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/UMix.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/UMix.svg"))); addChild(panel); } diff --git a/src/VCA.cpp b/src/VCA.cpp @@ -14,7 +14,7 @@ void VCA::step() { channelStep(inputs[IN2_INPUT], outputs[OUT2_OUTPUT], params[LEVEL2_PARAM], inputs[CV2_INPUT], _amplifier2, _levelSL2, linear); } -void VCA::channelStep(Input& input, Output& output, Param& knob, Input& cv, Amplifier& amplifier, SlewLimiter& levelSL, bool linear) { +void VCA::channelStep(Input& input, Output& output, Param& knob, Input& cv, Amplifier& amplifier, bogaudio::dsp::SlewLimiter& levelSL, bool linear) { if (input.active && output.active) { float level = knob.value; if (cv.active) { @@ -42,7 +42,7 @@ struct VCAWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/VCA.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/VCA.svg"))); addChild(panel); } diff --git a/src/VCA.hpp b/src/VCA.hpp @@ -37,9 +37,9 @@ struct VCA : Module { }; Amplifier _amplifier1; - SlewLimiter _levelSL1; + bogaudio::dsp::SlewLimiter _levelSL1; Amplifier _amplifier2; - SlewLimiter _levelSL2; + bogaudio::dsp::SlewLimiter _levelSL2; VCA() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { onSampleRateChange(); @@ -47,7 +47,7 @@ struct VCA : Module { void onSampleRateChange() override; void step() override; - void channelStep(Input& input, Output& output, Param& knob, Input& cv, Amplifier& amplifier, SlewLimiter& levelSL, bool linear); + void channelStep(Input& input, Output& output, Param& knob, Input& cv, Amplifier& amplifier, bogaudio::dsp::SlewLimiter& levelSL, bool linear); }; } // namespace bogaudio diff --git a/src/VCAmp.cpp b/src/VCAmp.cpp @@ -34,7 +34,7 @@ struct VCAmpWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/VCAmp.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/VCAmp.svg"))); addChild(panel); } diff --git a/src/VCAmp.hpp b/src/VCAmp.hpp @@ -33,7 +33,7 @@ struct VCAmp : Module { const float maxDecibels = 12.0f; const float minDecibels = Amplifier::minDecibels; Amplifier _amplifier; - SlewLimiter _levelSL; + bogaudio::dsp::SlewLimiter _levelSL; Saturator _saturator; RootMeanSquare _rms; float _rmsLevel = 0.0f; diff --git a/src/VCM.cpp b/src/VCM.cpp @@ -47,7 +47,7 @@ struct VCMWidget : DisableOutputLimitModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/VCM.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/VCM.svg"))); addChild(panel); } diff --git a/src/VCO.cpp b/src/VCO.cpp @@ -161,7 +161,7 @@ struct VCOWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/VCO.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/VCO.svg"))); addChild(panel); } diff --git a/src/VCO.hpp b/src/VCO.hpp @@ -67,7 +67,7 @@ struct VCO : Module { float _sawBuffer[oversample]; float _triangleBuffer[oversample]; PositiveZeroCrossing _syncTrigger; - SlewLimiter _squarePulseWidthSL; + bogaudio::dsp::SlewLimiter _squarePulseWidthSL; VCO() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { onReset(); diff --git a/src/VU.cpp b/src/VU.cpp @@ -93,7 +93,7 @@ struct VUWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/VU.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/VU.svg"))); addChild(panel); } diff --git a/src/Walk.cpp b/src/Walk.cpp @@ -54,7 +54,7 @@ struct WalkWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Walk.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Walk.svg"))); addChild(panel); } diff --git a/src/Walk.hpp b/src/Walk.hpp @@ -41,7 +41,7 @@ struct Walk : Module { float _scale = 0.0f; Trigger _jumpTrigger; RandomWalk _walk; - SlewLimiter _slew; + bogaudio::dsp::SlewLimiter _slew; Walk() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { onReset(); diff --git a/src/Walk2.cpp b/src/Walk2.cpp @@ -141,12 +141,12 @@ struct Walk2Display : TransparentWidget { , _drawSize(2 * (_size.x - 2 * _insetAround), 2 * (_size.y - 2 * _insetAround)) , _midX(_insetAround + _drawSize.x/2) , _midY(_insetAround + _drawSize.y/2) - , _font(Font::load(assetPlugin(pluginInstance, "res/fonts/inconsolata.ttf"))) + , _font(Font::load(asset::plugin(pluginInstance, "res/fonts/inconsolata.ttf"))) { } void onButton(const event::Button& e) override { - if (!(if (e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == 0)) { + if (!(e.action == GLFW_PRESS && e.button == GLFW_MOUSE_BUTTON_LEFT && (e.mods & RACK_MOD_MASK) == 0)) { return; } @@ -185,7 +185,7 @@ struct Walk2Display : TransparentWidget { } drawBackground(vg); - float strokeWidth = std::max(1.0f, 3 - gRackScene->zoomWidget->zoom); + float strokeWidth = 2.0f; // FIXME.v1 std::max(1.0f, 3 - gRackScene->zoomWidget->zoom); nvgSave(vg); nvgScissor(vg, _insetAround, _insetAround, _drawSize.x / 2, _drawSize.y / 2); @@ -372,8 +372,8 @@ struct Walk2Display : TransparentWidget { // } int n = _module->historyPoints; - float beginWidth = std::max(1.0f, 4.0f - gRackScene->zoomWidget->zoom); - float endWidth = std::max(0.5f, 2.0f - gRackScene->zoomWidget->zoom); + float beginWidth = 2.0f; // FIXME.v1 std::max(1.0f, 4.0f - gRackScene->zoomWidget->zoom); + float endWidth = 1.0f; // FIXME.v1 std::max(0.5f, 2.0f - gRackScene->zoomWidget->zoom); if (_module->_zoomOut) { beginWidth *= 2.0f; endWidth *= 2.0f; @@ -477,7 +477,7 @@ struct Walk2Widget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/Walk2.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/Walk2.svg"))); addChild(panel); } diff --git a/src/Walk2.hpp b/src/Walk2.hpp @@ -57,7 +57,7 @@ struct Walk2 : Module { float _offsetX = 0.0f, _offsetY = 0.0f; float _scaleX = 0.0f, _scaleY = 0.0f; RandomWalk _walkX, _walkY; - SlewLimiter _slewX, _slewY; + bogaudio::dsp::SlewLimiter _slewX, _slewY; Trigger _jumpTrigger; HistoryBuffer<float> _outsX, _outsY; std::atomic<Vec*> _jumpTo; diff --git a/src/XCO.cpp b/src/XCO.cpp @@ -263,7 +263,7 @@ struct XCOWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/XCO.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/XCO.svg"))); addChild(panel); } diff --git a/src/XCO.hpp b/src/XCO.hpp @@ -107,15 +107,15 @@ struct XCO : Module { float _sineBuffer[oversample]; PositiveZeroCrossing _syncTrigger; - SlewLimiter _fmDepthSL; - SlewLimiter _squarePulseWidthSL; - SlewLimiter _sawSaturationSL; - SlewLimiter _triangleSampleWidthSL; - SlewLimiter _sineFeedbackSL; - SlewLimiter _squareMixSL; - SlewLimiter _sawMixSL; - SlewLimiter _triangleMixSL; - SlewLimiter _sineMixSL; + bogaudio::dsp::SlewLimiter _fmDepthSL; + bogaudio::dsp::SlewLimiter _squarePulseWidthSL; + bogaudio::dsp::SlewLimiter _sawSaturationSL; + bogaudio::dsp::SlewLimiter _triangleSampleWidthSL; + bogaudio::dsp::SlewLimiter _sineFeedbackSL; + bogaudio::dsp::SlewLimiter _squareMixSL; + bogaudio::dsp::SlewLimiter _sawMixSL; + bogaudio::dsp::SlewLimiter _triangleMixSL; + bogaudio::dsp::SlewLimiter _sineMixSL; XCO() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { onReset(); diff --git a/src/XFade.cpp b/src/XFade.cpp @@ -45,7 +45,7 @@ struct XFadeWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/XFade.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/XFade.svg"))); addChild(panel); } diff --git a/src/XFade.hpp b/src/XFade.hpp @@ -37,7 +37,7 @@ struct XFade : Module { bool _linear = false; float _mix = 0.0f; float _curveIn = -1.0f; - SlewLimiter _mixSL; + bogaudio::dsp::SlewLimiter _mixSL; CrossFader _mixer; XFade() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { diff --git a/src/analyzer_base.cpp b/src/analyzer_base.cpp @@ -208,7 +208,7 @@ void AnalyzerCore::stepChannel(int channelIndex, Input& input) { void AnalyzerDisplay::draw(NVGcontext* vg) { drawBackground(vg); - float strokeWidth = std::max(1.0f, 3 - gRackScene->zoomWidget->zoom); + float strokeWidth = 2.0f; // FIXME.v1 std::max(1.0f, 3 - gRackScene->zoomWidget->zoom); _xAxisLogFactor = (_module->_rangeMaxHz - _module->_rangeMinHz) / _module->_rangeMaxHz; _xAxisLogFactor *= 1.0f - baseXAxisLogFactor; _xAxisLogFactor = 1.0f - _xAxisLogFactor; diff --git a/src/analyzer_base.hpp b/src/analyzer_base.hpp @@ -156,7 +156,7 @@ struct AnalyzerDisplay : TransparentWidget { , _size(size) , _graphSize(_size.x - _insetLeft - _insetRight, _size.y - _insetTop - _insetBottom) , _drawInset(drawInset) - , _font(Font::load(assetPlugin(pluginInstance, "res/fonts/inconsolata.ttf"))) + , _font(Font::load(asset::plugin(pluginInstance, "res/fonts/inconsolata.ttf"))) { } diff --git a/src/bogaudio.cpp b/src/bogaudio.cpp @@ -69,10 +69,6 @@ Plugin *pluginInstance; void init(rack::Plugin *p) { pluginInstance = p; - p->slug = TOSTRING(SLUG); - p->version = TOSTRING(VERSION); - p->website = "https://github.com/bogaudio/BogaudioModules"; - p->manual = "https://github.com/bogaudio/BogaudioModules/blob/master/README.md"; p->addModel(modelVCO); p->addModel(modelXCO); diff --git a/src/bogaudio.hpp b/src/bogaudio.hpp @@ -18,3 +18,62 @@ using namespace rack; using namespace bogaudio; extern Plugin *pluginInstance; + +// FIXME.v1: remove this +enum ModelTag { + NO_TAG, // Don't use this in `Model::create(...)`. Instead, just omit the tags entirely. + AMPLIFIER_TAG, + ARPEGGIATOR_TAG, + ATTENUATOR_TAG, + BLANK_TAG, + CHORUS_TAG, + CLOCK_MODULATOR_TAG, // Clock dividers, multipliers, etc. + CLOCK_TAG, + COMPRESSOR_TAG, + CONTROLLER_TAG, // Use only if the artist "performs" with this module. Knobs are not sufficient. Examples: on-screen keyboard, XY pad. + DELAY_TAG, + DIGITAL_TAG, + DISTORTION_TAG, + DRUM_TAG, + DUAL_TAG, // The core functionality times two. If multiple channels are a requirement for the module to exist (ring modulator, mixer, etc), it is not a Dual module. + DYNAMICS_TAG, + EFFECT_TAG, + ENVELOPE_FOLLOWER_TAG, + ENVELOPE_GENERATOR_TAG, + EQUALIZER_TAG, + EXTERNAL_TAG, + FILTER_TAG, + FLANGER_TAG, + FUNCTION_GENERATOR_TAG, + GRANULAR_TAG, + LFO_TAG, + LIMITER_TAG, + LOGIC_TAG, + LOW_PASS_GATE_TAG, + MIDI_TAG, + MIXER_TAG, + MULTIPLE_TAG, + NOISE_TAG, + OSCILLATOR_TAG, + PANNING_TAG, + PHASER_TAG, + PHYSICAL_MODELING_TAG, + QUAD_TAG, // The core functionality times four. If multiple channels are a requirement for the module to exist (ring modulator, mixer, etc), it is not a Quad module. + QUANTIZER_TAG, + RANDOM_TAG, + RECORDING_TAG, + REVERB_TAG, + RING_MODULATOR_TAG, + SAMPLE_AND_HOLD_TAG, + SAMPLER_TAG, + SEQUENCER_TAG, + SLEW_LIMITER_TAG, + SWITCH_TAG, + SYNTH_VOICE_TAG, // A synth voice must have an envelope built-in. + TUNER_TAG, + UTILITY_TAG, // Serves only extremely basic functions, like inverting, max, min, multiplying by 2, etc. + VISUAL_TAG, + VOCODER_TAG, + WAVESHAPER_TAG, + NUM_TAGS +}; diff --git a/src/lfo_base.hpp b/src/lfo_base.hpp @@ -81,19 +81,21 @@ struct LFOBaseWidget : ModuleWidget, PitchModeListener { void setSVG() { if (_module->isCompliantPitchMode()) { _panel->setBackground(_compliantSVG); - if (_frequencyKnob) { - _frequencyKnob->minValue = -5.0f; - _frequencyKnob->maxValue = 8.0f; - _frequencyKnob->dirty = true; - } + // FXIME.v1 + // 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; - } + // FXIME.v1 + // if (_frequencyKnob) { + // _frequencyKnob->minValue = -8.0f; + // _frequencyKnob->maxValue = 5.0f; + // _frequencyKnob->dirty = true; + // } } _panel->dirty = true; } diff --git a/src/mixer.cpp b/src/mixer.cpp @@ -56,11 +56,11 @@ SoloMuteButton::SoloMuteButton() { _svgWidget = new SVGWidget(); addChild(_svgWidget); - auto svg = SVG::load(assetPlugin(pluginInstance, "res/button_18px_0.svg")); + auto svg = SVG::load(asset::plugin(pluginInstance, "res/button_18px_0.svg")); _frames.push_back(svg); - _frames.push_back(SVG::load(assetPlugin(pluginInstance, "res/button_18px_1_orange.svg"))); - _frames.push_back(SVG::load(assetPlugin(pluginInstance, "res/button_18px_1_green.svg"))); - _frames.push_back(SVG::load(assetPlugin(pluginInstance, "res/button_18px_1_green.svg"))); + _frames.push_back(SVG::load(asset::plugin(pluginInstance, "res/button_18px_1_orange.svg"))); + _frames.push_back(SVG::load(asset::plugin(pluginInstance, "res/button_18px_1_green.svg"))); + _frames.push_back(SVG::load(asset::plugin(pluginInstance, "res/button_18px_1_green.svg"))); _svgWidget->setSVG(svg); box.size = _svgWidget->box.size; @@ -70,33 +70,35 @@ SoloMuteButton::SoloMuteButton() { } void SoloMuteButton::step() { - FramebufferWidget::step(); + // FIXME.v1 FramebufferWidget::step(); } void SoloMuteButton::onButton(const event::Button& e) { // FIXME.v1 - if (!(if (e.action == GLFW_PRESS /*&& e.button == GLFW_MOUSE_BUTTON_LEFT*/ && (e.mods & RACK_MOD_MASK) == 0)) { + if (!(e.action == GLFW_PRESS /*&& e.button == GLFW_MOUSE_BUTTON_LEFT*/ && (e.mods & RACK_MOD_MASK) == 0)) { return; } - if (value >= 2.0f) { - setValue(value - 2.0f); - } - else if (e.button == 1) { // right click - setValue(value + 2.0f); - } - else { - setValue(value > 0.5f ? 0.0f : 1.0f); - } - - e.consumed = true; - e.target = this; + // FIXME.v1 + // if (value >= 2.0f) { + // setValue(value - 2.0f); + // } + // else if (e.button == 1) { // right click + // setValue(value + 2.0f); + // } + // else { + // setValue(value > 0.5f ? 0.0f : 1.0f); + // } + // + // e.consumed = true; + // e.target = this; } void SoloMuteButton::onChange(const event::Change& e) { - assert(_frames.size() == 4); - assert(value >= 0.0f && value <= 3.0f); - _svgWidget->setSVG(_frames[(int)value]); - dirty = true; + // FIXME.v1 + // assert(_frames.size() == 4); + // assert(value >= 0.0f && value <= 3.0f); + // _svgWidget->setSVG(_frames[(int)value]); + // dirty = true; ParamWidget::onChange(e); } diff --git a/src/mixer.hpp b/src/mixer.hpp @@ -15,8 +15,8 @@ struct MixerChannel { Amplifier _amplifier; Panner _panner; - SlewLimiter _levelSL; - SlewLimiter _panSL; + bogaudio::dsp::SlewLimiter _levelSL; + bogaudio::dsp::SlewLimiter _panSL; RootMeanSquare _rms; Param& _levelParam; @@ -60,12 +60,12 @@ struct MixerChannel { struct MuteButton : ToggleButton { MuteButton() { - addFrame(SVG::load(assetPlugin(pluginInstance, "res/button_18px_0.svg"))); - addFrame(SVG::load(assetPlugin(pluginInstance, "res/button_18px_1_orange.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/button_18px_0.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/button_18px_1_orange.svg"))); } }; -struct SoloMuteButton : ParamWidget, FramebufferWidget { +struct SoloMuteButton : ParamWidget /*FIXME.v1 , FramebufferWidget*/ { std::vector<std::shared_ptr<SVG>> _frames; SVGWidget* _svgWidget; // deleted elsewhere. CircularShadow* shadow = NULL; diff --git a/src/rack_overrides.hpp b/src/rack_overrides.hpp @@ -18,27 +18,28 @@ struct Trigger : SchmittTrigger { } bool process(float in) { - switch (state) { - case LOW: - if (in >= _highThreshold) { - state = HIGH; - return true; - } - break; - case HIGH: - if (in <= _lowThreshold) { - state = LOW; - } - break; - default: - if (in >= _highThreshold) { - state = HIGH; - } - else if (in <= _lowThreshold) { - state = LOW; - } - break; - } + // FIXME.v1 + // switch (state) { + // case LOW: + // if (in >= _highThreshold) { + // state = HIGH; + // return true; + // } + // break; + // case HIGH: + // if (in <= _lowThreshold) { + // state = LOW; + // } + // break; + // default: + // if (in >= _highThreshold) { + // state = HIGH; + // } + // else if (in <= _lowThreshold) { + // state = LOW; + // } + // break; + // } return false; } }; diff --git a/src/template_panels.cpp b/src/template_panels.cpp @@ -8,7 +8,7 @@ struct ThreeHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/ThreeHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/ThreeHP.svg"))); addChild(panel); } @@ -17,7 +17,7 @@ struct ThreeHPWidget : ModuleWidget { } }; -Model* modelThreeHP = Model::create<Module, ThreeHPWidget>("Bogaudio", "Bogaudio-ThreeHP", "3HP"); +Model* modelThreeHP = rack::createModel<Module, ThreeHPWidget>("Bogaudio-ThreeHP"); struct SixHPWidget : ModuleWidget { @@ -27,7 +27,7 @@ struct SixHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/SixHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/SixHP.svg"))); addChild(panel); } @@ -36,7 +36,7 @@ struct SixHPWidget : ModuleWidget { } }; -Model* modelSixHP = Model::create<Module, SixHPWidget>("Bogaudio", "Bogaudio-SixHP", "6HP"); +Model* modelSixHP = rack::createModel<Module, SixHPWidget>("Bogaudio-SixHP"); struct EightHPWidget : ModuleWidget { @@ -46,7 +46,7 @@ struct EightHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/EightHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/EightHP.svg"))); addChild(panel); } @@ -55,7 +55,7 @@ struct EightHPWidget : ModuleWidget { } }; -Model* modelEightHP = Model::create<Module, EightHPWidget>("Bogaudio", "Bogaudio-EightHP", "8HP"); +Model* modelEightHP = rack::createModel<Module, EightHPWidget>("Bogaudio-EightHP"); struct TenHPWidget : ModuleWidget { @@ -65,7 +65,7 @@ struct TenHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/TenHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/TenHP.svg"))); addChild(panel); } @@ -76,7 +76,7 @@ struct TenHPWidget : ModuleWidget { } }; -Model* modelTenHP = Model::create<Module, TenHPWidget>("Bogaudio", "Bogaudio-TenHP", "10HP"); +Model* modelTenHP = rack::createModel<Module, TenHPWidget>("Bogaudio-TenHP"); struct TwelveHPWidget : ModuleWidget { @@ -86,7 +86,7 @@ struct TwelveHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/TwelveHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/TwelveHP.svg"))); addChild(panel); } @@ -97,7 +97,7 @@ struct TwelveHPWidget : ModuleWidget { } }; -Model* modelTwelveHP = Model::create<Module, TwelveHPWidget>("Bogaudio", "Bogaudio-TwelveHP", "12HP"); +Model* modelTwelveHP = rack::createModel<Module, TwelveHPWidget>("Bogaudio-TwelveHP"); struct ThirteenHPWidget : ModuleWidget { ThirteenHPWidget(Module* module) : ModuleWidget(module) { @@ -106,7 +106,7 @@ struct ThirteenHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/ThirteenHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/ThirteenHP.svg"))); addChild(panel); } @@ -117,7 +117,7 @@ struct ThirteenHPWidget : ModuleWidget { } }; -Model* modelThirteenHP = Model::create<Module, ThirteenHPWidget>("Bogaudio", "Bogaudio-ThirteenHP", "13HP"); +Model* modelThirteenHP = rack::createModel<Module, ThirteenHPWidget>("Bogaudio-ThirteenHP"); struct FifteenHPWidget : ModuleWidget { @@ -127,7 +127,7 @@ struct FifteenHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/FifteenHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/FifteenHP.svg"))); addChild(panel); } @@ -138,7 +138,7 @@ struct FifteenHPWidget : ModuleWidget { } }; -Model* modelFifteenHP = Model::create<Module, FifteenHPWidget>("Bogaudio", "Bogaudio-FifteenHP", "15HP"); +Model* modelFifteenHP = rack::createModel<Module, FifteenHPWidget>("Bogaudio-FifteenHP"); struct EighteenHPWidget : ModuleWidget { @@ -148,7 +148,7 @@ struct EighteenHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/EighteenHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/EighteenHP.svg"))); addChild(panel); } @@ -159,7 +159,7 @@ struct EighteenHPWidget : ModuleWidget { } }; -Model* modelEighteenHP = Model::create<Module, EighteenHPWidget>("Bogaudio", "Bogaudio-EighteenHP", "18HP"); +Model* modelEighteenHP = rack::createModel<Module, EighteenHPWidget>("Bogaudio-EighteenHP"); struct TwentyHPWidget : ModuleWidget { @@ -169,7 +169,7 @@ struct TwentyHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/TwentyHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/TwentyHP.svg"))); addChild(panel); } @@ -180,7 +180,7 @@ struct TwentyHPWidget : ModuleWidget { } }; -Model* modelTwentyHP = Model::create<Module, TwentyHPWidget>("Bogaudio", "Bogaudio-TwentyHP", "20HP"); +Model* modelTwentyHP = rack::createModel<Module, TwentyHPWidget>("Bogaudio-TwentyHP"); struct TwentyTwoHPWidget : ModuleWidget { @@ -190,7 +190,7 @@ struct TwentyTwoHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/TwentyTwoHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/TwentyTwoHP.svg"))); addChild(panel); } @@ -201,7 +201,7 @@ struct TwentyTwoHPWidget : ModuleWidget { } }; -Model* modelTwentyTwoHP = Model::create<Module, TwentyTwoHPWidget>("Bogaudio", "Bogaudio-TwentyTwoHP", "22HP"); +Model* modelTwentyTwoHP = rack::createModel<Module, TwentyTwoHPWidget>("Bogaudio-TwentyTwoHP"); struct TwentyFiveHPWidget : ModuleWidget { @@ -211,7 +211,7 @@ struct TwentyFiveHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/TwentyFiveHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/TwentyFiveHP.svg"))); addChild(panel); } @@ -222,7 +222,7 @@ struct TwentyFiveHPWidget : ModuleWidget { } }; -Model* modelTwentyFiveHP = Model::create<Module, TwentyFiveHPWidget>("Bogaudio", "Bogaudio-TwentyFiveHP", "25HP"); +Model* modelTwentyFiveHP = rack::createModel<Module, TwentyFiveHPWidget>("Bogaudio-TwentyFiveHP"); struct ThirtyHPWidget : ModuleWidget { @@ -232,7 +232,7 @@ struct ThirtyHPWidget : ModuleWidget { { SVGPanel *panel = new SVGPanel(); panel->box.size = box.size; - panel->setBackground(SVG::load(assetPlugin(pluginInstance, "res/ThirtyHP.svg"))); + panel->setBackground(SVG::load(asset::plugin(pluginInstance, "res/ThirtyHP.svg"))); addChild(panel); } @@ -243,4 +243,4 @@ struct ThirtyHPWidget : ModuleWidget { } }; -Model* modelThirtyHP = Model::create<Module, ThirtyHPWidget>("Bogaudio", "Bogaudio-ThirtyHP", "30HP"); +Model* modelThirtyHP = rack::createModel<Module, ThirtyHPWidget>("Bogaudio-ThirtyHP"); diff --git a/src/widgets.cpp b/src/widgets.cpp @@ -6,14 +6,14 @@ using namespace bogaudio; using namespace bogaudio::dsp; Button18::Button18() { - addFrame(SVG::load(assetPlugin(pluginInstance, "res/button_18px_0.svg"))); - addFrame(SVG::load(assetPlugin(pluginInstance, "res/button_18px_1.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/button_18px_0.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/button_18px_1.svg"))); box.size = Vec(18, 18); } BGKnob::BGKnob(const char* svg, int dim) { - setSVG(SVG::load(assetPlugin(pluginInstance, svg))); + setSVG(SVG::load(asset::plugin(pluginInstance, svg))); box.size = Vec(dim, dim); shadow->blurRadius = 2.0; // k->shadow->opacity = 0.15; @@ -53,7 +53,7 @@ Knob68::Knob68() : BGKnob("res/knob_68px.svg", 68) { Port24::Port24() { - setSVG(SVG::load(assetPlugin(pluginInstance, "res/port.svg"))); + setSVG(SVG::load(asset::plugin(pluginInstance, "res/port.svg"))); box.size = Vec(24, 24); shadow->blurRadius = 1.0; shadow->box.pos = Vec(0.0, 1.5); @@ -74,8 +74,8 @@ SliderSwitch::SliderSwitch() { SliderSwitch2State14::SliderSwitch2State14() { - addFrame(SVG::load(assetPlugin(pluginInstance, "res/slider_switch_2_14px_0.svg"))); - addFrame(SVG::load(assetPlugin(pluginInstance, "res/slider_switch_2_14px_1.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/slider_switch_2_14px_0.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/slider_switch_2_14px_1.svg"))); shadow->box.size = Vec(14.0, 24.0); shadow->blurRadius = 1.0; shadow->box.pos = Vec(0.0, 7.0); @@ -89,9 +89,9 @@ StatefulButton::StatefulButton(const char* offSVGPath, const char* onSVGPath) { _svgWidget = new SVGWidget(); addChild(_svgWidget); - auto svg = SVG::load(assetPlugin(pluginInstance, offSVGPath)); + auto svg = SVG::load(asset::plugin(pluginInstance, offSVGPath)); _frames.push_back(svg); - _frames.push_back(SVG::load(assetPlugin(pluginInstance, onSVGPath))); + _frames.push_back(SVG::load(asset::plugin(pluginInstance, onSVGPath))); _svgWidget->setSVG(svg); box.size = _svgWidget->box.size; @@ -101,24 +101,25 @@ StatefulButton::StatefulButton(const char* offSVGPath, const char* onSVGPath) { } void StatefulButton::step() { - FramebufferWidget::step(); + // FIXME.v1 FramebufferWidget::step(); } void StatefulButton::onDragStart(const event::DragStart& e) { _svgWidget->setSVG(_frames[1]); - dirty = true; - - if (value >= maxValue) { - setValue(minValue); - } - else { - setValue(value + 1.0); - } -} - -void StatefulButton::onDragEnd(const event::End& e) { + // FIXME.v1 + // dirty = true; + // + // if (value >= maxValue) { + // setValue(minValue); + // } + // else { + // setValue(value + 1.0); + // } +} + +void StatefulButton::onDragEnd(const event::DragEnd& e) { _svgWidget->setSVG(_frames[0]); - dirty = true; + // FIXME.v1 dirty = true; } @@ -131,8 +132,8 @@ StatefulButton18::StatefulButton18() : StatefulButton("res/button_18px_0.svg", " ToggleButton18::ToggleButton18() { - addFrame(SVG::load(assetPlugin(pluginInstance, "res/button_18px_0.svg"))); - addFrame(SVG::load(assetPlugin(pluginInstance, "res/button_18px_1.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/button_18px_0.svg"))); + addFrame(SVG::load(asset::plugin(pluginInstance, "res/button_18px_1.svg"))); } @@ -150,49 +151,49 @@ NVGcolor bogaudio::decibelsToColor(float db) { } -void VUSlider::draw(NVGcontext* vg) { - nvgSave(vg); +void VUSlider::draw(const DrawArgs& args) { + nvgSave(args.vg); { - nvgBeginPath(vg); - nvgRoundedRect(vg, 6, 3, 6, box.size.y - 6, 2); - nvgFillColor(vg, nvgRGBA(0x22, 0x22, 0x22, 0xff)); - nvgFill(vg); - nvgStrokeColor(vg, nvgRGBA(0x88, 0x88, 0x88, 0xff)); - nvgStroke(vg); + nvgBeginPath(args.vg); + nvgRoundedRect(args.vg, 6, 3, 6, box.size.y - 6, 2); + nvgFillColor(args.vg, nvgRGBA(0x22, 0x22, 0x22, 0xff)); + nvgFill(args.vg); + nvgStrokeColor(args.vg, nvgRGBA(0x88, 0x88, 0x88, 0xff)); + nvgStroke(args.vg); } - nvgRestore(vg); + nvgRestore(args.vg); - nvgSave(vg); + nvgSave(args.vg); { - nvgTranslate(vg, 0, (box.size.y - 13.0f) * (1.0f - value)); - nvgBeginPath(vg); - nvgRoundedRect(vg, 0, 0, 18, 13, 1.5); - nvgFillColor(vg, nvgRGBA(0x77, 0x77, 0x77, 0xff)); - nvgFill(vg); - - nvgBeginPath(vg); - nvgRect(vg, 0, 2, 18, 9); - nvgFillColor(vg, nvgRGBA(0x44, 0x44, 0x44, 0xff)); - nvgFill(vg); - - nvgBeginPath(vg); - nvgRect(vg, 0, 6, 18, 1); - nvgFillColor(vg, nvgRGBA(0xfa, 0xfa, 0xfa, 0xff)); - nvgFill(vg); - - nvgBeginPath(vg); - nvgRoundedRect(vg, 2, 4, 14, 5, 1.0); - nvgFillColor(vg, nvgRGBA(0xaa, 0xaa, 0xaa, 0xff)); - nvgFill(vg); + // FIXME.v1 nvgTranslate(args.vg, 0, (box.size.y - 13.0f) * (1.0f - value)); + nvgBeginPath(args.vg); + nvgRoundedRect(args.vg, 0, 0, 18, 13, 1.5); + nvgFillColor(args.vg, nvgRGBA(0x77, 0x77, 0x77, 0xff)); + nvgFill(args.vg); + + nvgBeginPath(args.vg); + nvgRect(args.vg, 0, 2, 18, 9); + nvgFillColor(args.vg, nvgRGBA(0x44, 0x44, 0x44, 0xff)); + nvgFill(args.vg); + + nvgBeginPath(args.vg); + nvgRect(args.vg, 0, 6, 18, 1); + nvgFillColor(args.vg, nvgRGBA(0xfa, 0xfa, 0xfa, 0xff)); + nvgFill(args.vg); + + nvgBeginPath(args.vg); + nvgRoundedRect(args.vg, 2, 4, 14, 5, 1.0); + nvgFillColor(args.vg, nvgRGBA(0xaa, 0xaa, 0xaa, 0xff)); + nvgFill(args.vg); float db = _vuLevel ? *_vuLevel : 0.0f; if (db > 0.0f) { db = amplitudeToDecibels(db); - nvgBeginPath(vg); - nvgRoundedRect(vg, 2, 4, 14, 5, 1.0); - nvgFillColor(vg, decibelsToColor(db)); - nvgFill(vg); + nvgBeginPath(args.vg); + nvgRoundedRect(args.vg, 2, 4, 14, 5, 1.0); + nvgFillColor(args.vg, decibelsToColor(db)); + nvgFill(args.vg); } } - nvgRestore(vg); + nvgRestore(args.vg); } diff --git a/src/widgets.hpp b/src/widgets.hpp @@ -6,7 +6,9 @@ extern Plugin *pluginInstance; namespace bogaudio { -struct Button18 : SVGSwitch, MomentarySwitch { +// FIXME.v1: all of this. + +struct Button18 : SVGSwitch /*, MomentarySwitch*/ { Button18(); }; @@ -50,7 +52,7 @@ struct BlankPort24 : Port24 { BlankPort24(); }; -struct SliderSwitch : SVGSwitch, ToggleSwitch { +struct SliderSwitch : SVGSwitch /*, ToggleSwitch*/ { CircularShadow* shadow = NULL; SliderSwitch(); }; @@ -59,7 +61,7 @@ struct SliderSwitch2State14 : SliderSwitch { SliderSwitch2State14(); }; -struct StatefulButton : ParamWidget, FramebufferWidget { +struct StatefulButton : ParamWidget /*, FramebufferWidget*/ { std::vector<std::shared_ptr<SVG>> _frames; SVGWidget* _svgWidget; // deleted elsewhere. CircularShadow* shadow = NULL; @@ -78,7 +80,7 @@ struct StatefulButton18 : StatefulButton { StatefulButton18(); }; -struct ToggleButton : SVGSwitch, ToggleSwitch { +struct ToggleButton : SVGSwitch /*, ToggleSwitch*/ { }; struct ToggleButton18 : ToggleButton { @@ -98,7 +100,7 @@ struct VUSlider : Knob { void setVULevel(float* vuLevel) { _vuLevel = vuLevel; } - void draw(NVGcontext* vg) override; + void draw(const DrawArgs& args) override; }; struct VUSlider151 : VUSlider {