Browse Source

Update to new Rack plugin interface

tags/v0.4.0
Andrew Belt 7 years ago
parent
commit
5582a52fd9
11 changed files with 30 additions and 38 deletions
  1. +6
    -5
      res/VCO.svg
  2. +1
    -1
      src/ADSR.cpp
  3. +1
    -1
      src/Delay.cpp
  4. +13
    -20
      src/Fundamental.cpp
  5. +2
    -4
      src/Fundamental.hpp
  6. +1
    -1
      src/SEQ3.cpp
  7. +2
    -2
      src/Scope.cpp
  8. +1
    -1
      src/VCA.cpp
  9. +1
    -1
      src/VCF.cpp
  10. +1
    -1
      src/VCMixer.cpp
  11. +1
    -1
      src/VCO.cpp

+ 6
- 5
res/VCO.svg View File

@@ -25,9 +25,9 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.4"
inkscape:cx="9.2459846"
inkscape:cy="190.568"
inkscape:zoom="5.6"
inkscape:cx="97.479243"
inkscape:cy="348.565"
inkscape:document-units="mm"
inkscape:current-layer="g13122"
showgrid="false"
@@ -39,7 +39,8 @@
inkscape:window-height="882"
inkscape:window-x="0"
inkscape:window-y="18"
inkscape:window-maximized="0" />
inkscape:window-maximized="0"
inkscape:snap-global="false" />
<metadata
id="metadata4538">
<rdf:RDF>
@@ -48,7 +49,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>


+ 1
- 1
src/ADSR.cpp View File

@@ -98,7 +98,7 @@ ADSRWidget::ADSRWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/ADSR.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/ADSR.svg")));
addChild(panel);
}



+ 1
- 1
src/Delay.cpp View File

@@ -119,7 +119,7 @@ DelayWidget::DelayWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/Delay.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/Delay.svg")));
addChild(panel);
}



+ 13
- 20
src/Fundamental.cpp View File

@@ -1,25 +1,18 @@
#include "Fundamental.hpp"
#include <math.h>
#include "dsp.hpp"


struct FundamentalPlugin : Plugin {
FundamentalPlugin() {
slug = "Fundamental";
name = "Fundamental";
createModel<VCOWidget>(this, "VCO", "VCO");
createModel<VCFWidget>(this, "VCF", "VCF");
createModel<VCAWidget>(this, "VCA", "VCA");
createModel<DelayWidget>(this, "Delay", "Delay");
createModel<ADSRWidget>(this, "ADSR", "ADSR");
createModel<VCMixerWidget>(this, "VCMixer", "VC Mixer");
// createModel<MultWidget>(this, "Mult", "Mult");
createModel<ScopeWidget>(this, "Scope", "Scope");
createModel<SEQ3Widget>(this, "SEQ3", "SEQ-3");
}
};
Plugin *plugin;


Plugin *init() {
return new FundamentalPlugin();
void init(rack::Plugin *p) {
plugin = p;
plugin->slug = "Fundamental";
plugin->name = "Fundamental";
createModel<VCOWidget>(plugin, "VCO", "VCO");
createModel<VCFWidget>(plugin, "VCF", "VCF");
createModel<VCAWidget>(plugin, "VCA", "VCA");
createModel<DelayWidget>(plugin, "Delay", "Delay");
createModel<ADSRWidget>(plugin, "ADSR", "ADSR");
createModel<VCMixerWidget>(plugin, "VCMixer", "VC Mixer");
createModel<ScopeWidget>(plugin, "Scope", "Scope");
createModel<SEQ3Widget>(plugin, "SEQ3", "SEQ-3");
}

+ 2
- 4
src/Fundamental.hpp View File

@@ -4,6 +4,8 @@
using namespace rack;


extern Plugin *plugin;

////////////////////
// module widgets
////////////////////
@@ -32,10 +34,6 @@ struct VCMixerWidget : ModuleWidget {
VCMixerWidget();
};

// struct MultWidget : ModuleWidget {
// MultWidget();
// };

struct ScopeWidget : ModuleWidget {
ScopeWidget();
};


+ 1
- 1
src/SEQ3.cpp View File

@@ -174,7 +174,7 @@ SEQ3Widget::SEQ3Widget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/SEQ3.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/SEQ3.svg")));
addChild(panel);
}



+ 2
- 2
src/Scope.cpp View File

@@ -154,7 +154,7 @@ struct ScopeDisplay : TransparentWidget {
Stats statsX, statsY;

ScopeDisplay() {
font = Font::load("plugins/Fundamental/res/DejaVuSansMono.ttf");
font = Font::load(assetPlugin(plugin, "res/DejaVuSansMono.ttf"));
}

void drawWaveform(NVGcontext *vg, float *values, float gain, float offset) {
@@ -282,7 +282,7 @@ ScopeWidget::ScopeWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/Scope.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/Scope.svg")));
addChild(panel);
}



+ 1
- 1
src/VCA.cpp View File

@@ -57,7 +57,7 @@ VCAWidget::VCAWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/VCA.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/VCA.svg")));
addChild(panel);
}



+ 1
- 1
src/VCF.cpp View File

@@ -150,7 +150,7 @@ VCFWidget::VCFWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/VCF.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/VCF.svg")));
addChild(panel);
}



+ 1
- 1
src/VCMixer.cpp View File

@@ -60,7 +60,7 @@ VCMixerWidget::VCMixerWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/VCMixer.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/VCMixer.svg")));
addChild(panel);
}



+ 1
- 1
src/VCO.cpp View File

@@ -192,7 +192,7 @@ VCOWidget::VCOWidget() {
{
SVGPanel *panel = new SVGPanel();
panel->box.size = box.size;
panel->setBackground(SVG::load("plugins/Fundamental/res/VCO.svg"));
panel->setBackground(SVG::load(assetPlugin(plugin, "res/VCO.svg")));
addChild(panel);
}



Loading…
Cancel
Save