computerscare-vcv-modules

computerscare modules for VCV Rack
Log | Files | Refs

commit f25b1fda8bf4c82a319ec1b5c6e87f97ba4368bc
parent e480a573d18b1a718a99028cebac6be84b5f3353
Author: Adam M <aemalone@gmail.com>
Date:   Tue, 12 Feb 2019 12:13:10 -0600

updating to v1 api

Diffstat:
MMakefile | 11++---------
Msrc/Computerscare.cpp | 16+++++++---------
Msrc/Computerscare.hpp | 23++++++++++++-----------
Msrc/ComputerscareIso.cpp | 31+++++++++++++++++++------------
4 files changed, 40 insertions(+), 41 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,14 +1,6 @@ # If RACK_DIR is not defined when calling the Makefile, default to two directories above RACK_DIR ?= ../.. -# Must follow the format in the Naming section of -# https://vcvrack.com/manual/PluginDevelopmentTutorial.html -SLUG = computerscare - -# Must follow the format in the Versioning section of -# https://vcvrack.com/manual/PluginDevelopmentTutorial.html -VERSION = 0.6.6 - # FLAGS will be passed to both the C and C++ compiler FLAGS += CFLAGS += @@ -19,7 +11,8 @@ CXXFLAGS += LDFLAGS += # Add .cpp and .c files to the build -SOURCES += $(wildcard src/*.cpp) +#SOURCES += $(wildcard src/*.cpp) +SOURCES += $(wildcard src/ComputerscareIso.cpp) # Add files to the ZIP package when running `make dist` # The compiled plugin is automatically added. diff --git a/src/Computerscare.cpp b/src/Computerscare.cpp @@ -1,17 +1,15 @@ #include "Computerscare.hpp" -Plugin *plugin; +Plugin *computerscarePluginInstance; void init(Plugin *p) { - plugin = p; - p->slug = TOSTRING(SLUG); - p->version = TOSTRING(VERSION); + computerscarePluginInstance = p; - p->addModel(modelComputerscareDebug); - p->addModel(modelComputerscarePatchSequencer); - p->addModel(modelComputerscareLaundrySoup); - p->addModel(modelComputerscareILoveCookies); - p->addModel(modelComputerscareOhPeas); + //p->addModel(modelComputerscareDebug); + //p->addModel(modelComputerscarePatchSequencer); + //p->addModel(modelComputerscareLaundrySoup); + //p->addModel(modelComputerscareILoveCookies); + //p->addModel(modelComputerscareOhPeas); p->addModel(modelComputerscareIso); } diff --git a/src/Computerscare.hpp b/src/Computerscare.hpp @@ -4,9 +4,9 @@ using namespace rack; // Forward-declare the Plugin, defined in Template.cpp -extern Plugin *plugin; +extern Plugin *computerscarePluginInstance; -#ifndef COLOR_MAGENTA +/*#ifndef COLOR_MAGENTA #define COLOR_MAGENTA nvgRGB(240, 50, 230) #endif #ifndef COLOR_LIME @@ -23,18 +23,19 @@ static const NVGcolor COLOR_COMPUTERSCARE_YELLOW = nvgRGB(0xE4, 0xC4, 0x21); static const NVGcolor COLOR_COMPUTERSCARE_BLUE = nvgRGB(0x24, 0x44, 0xC1); static const NVGcolor COLOR_COMPUTERSCARE_PINK = nvgRGB(0xAA, 0x18, 0x31); static const NVGcolor COLOR_COMPUTERSCARE_TRANSPARENT = nvgRGBA(0x00, 0x00,0x00,0x00); - +*/ // Forward-declare each Model, defined in each module source file -extern Model *modelComputerscareDebug; -extern Model *modelComputerscarePatchSequencer; -extern Model *modelComputerscareLaundrySoup; -extern Model *modelComputerscareILoveCookies; -extern Model *modelComputerscareOhPeas; +//extern Model *modelComputerscareDebug; +//extern Model *modelComputerscarePatchSequencer; +//extern Model *modelComputerscareLaundrySoup; +//extern Model *modelComputerscareILoveCookies; +//extern Model *modelComputerscareOhPeas; extern Model *modelComputerscareIso; -struct ComputerscareSVGPanel; -struct ComputerscareSVGPanel : FramebufferWidget { +//struct ComputerscareSVGPanel; + +/*struct ComputerscareSVGPanel : FramebufferWidget { void step() override; void setBackground(std::shared_ptr<SVG> svg); }; @@ -233,4 +234,4 @@ struct SmallLetterDisplay : TransparentWidget { nvgTextBox(vg, textPos.x, textPos.y,80,value.c_str(), NULL); } -}; +};*/ diff --git a/src/ComputerscareIso.cpp b/src/ComputerscareIso.cpp @@ -1,8 +1,4 @@ #include "Computerscare.hpp" -#include "dtpulse.hpp" -#include "dsp/digital.hpp" -#include "window.hpp" -#include "dsp/filter.hpp" #include <string> #include <sstream> @@ -31,24 +27,33 @@ struct ComputerscareIso : Module { }; - ComputerscareIso() : Module(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS) { + ComputerscareIso() { + + config(NUM_PARAMS, NUM_INPUTS, NUM_OUTPUTS, NUM_LIGHTS); printf("ujje\n"); } }; struct ComputerscareIsoWidget : ModuleWidget { - float randAmt = 1.f; - ComputerscareIsoWidget(ComputerscareIso *module) : ModuleWidget(module) { - box.size = Vec(15*9, 380); + ComputerscareIsoWidget(ComputerscareIso *module) { + + setModule(module); + setPanel(APP->window->loadSvg(asset::plugin(computerscarePluginInstance, "res/ComputerscareIsoPanel.svg"))); + + + /*box.size = Vec(15*9, 380); { ComputerscareSVGPanel *panel = new ComputerscareSVGPanel(); panel->box.size = box.size; panel->setBackground(SVG::load(assetPlugin(plugin,"res/ComputerscareIsoPanel.svg"))); addChild(panel); } - } - void drawShadow(NVGcontext *vg) { + */ + +} + + /*void drawShadow(NVGcontext *vg) { nvgBeginPath(vg); float r = 20; // Blur radius float c = 20; // Corner radius @@ -58,7 +63,7 @@ struct ComputerscareIsoWidget : ModuleWidget { NVGcolor transparentColor = nvgRGBAf(0, 0, 0, 0); nvgFillPaint(vg, nvgBoxGradient(vg, b.x, b.y, box.size.x - 2*b.x, box.size.y - 2*b.y, c, r, shadowColor, transparentColor)); nvgFill(vg); -} +}*/ }; @@ -67,4 +72,6 @@ struct ComputerscareIsoWidget : ModuleWidget { // author name for categorization per plugin, module slug (should never // change), human-readable module name, and any number of tags // (found in `include/tags.hpp`) separated by commas. -Model *modelComputerscareIso = Model::create<ComputerscareIso, ComputerscareIsoWidget>("computerscare", "computerscare-iso", "Isopig", UTILITY_TAG); + +//Model *modelComputerscareIso = Model::create<ComputerscareIso, ComputerscareIsoWidget>("computerscare", "computerscare-iso", "Isopig", UTILITY_TAG); +Model *modelComputerscareIso = createModel<ComputerscareIso, ComputerscareIsoWidget>("Isopig");