Browse Source

Added Model tags

tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
ec6a7f3ead
4 changed files with 114 additions and 14 deletions
  1. +56
    -3
      include/plugin.hpp
  2. +3
    -2
      include/rack.hpp
  3. +8
    -8
      src/core/core.cpp
  4. +47
    -1
      src/plugin.cpp

+ 56
- 3
include/plugin.hpp View File

@@ -6,6 +6,54 @@
namespace rack { namespace rack {




enum ModelTag {
AMPLIFIER_TAG,
ATTENUATOR_TAG,
BLANK_TAG,
CLOCK_TAG,
CONTROLLER_TAG,
DELAY_TAG,
DIGITAL_TAG,
DISTORTION_TAG,
DRUM_TAG,
DUAL_TAG,
DYNAMICS_TAG,
EFFECT_TAG,
ENVELOPE_FOLLOWER_TAG,
ENVELOPE_GENERATOR_TAG,
EQUALIZER_TAG,
EXTERNAL_TAG,
FILTER_TAG,
FUNCTION_GENERATOR_TAG,
GRANULAR_TAG,
LFO_TAG,
LOGIC_TAG,
LOW_PASS_GATE_TAG,
MIDI_TAG,
MIXER_TAG,
MULTIPLE_TAG,
NOISE_TAG,
OSCILLATOR_TAG,
PANNING_TAG,
QUAD_TAG,
QUANTIZER_TAG,
RANDOM_TAG,
REVERB_TAG,
RING_MODULATOR_TAG,
SAMPLE_AND_HOLD_TAG,
SAMPLER_TAG,
SEQUENCER_TAG,
SLEW_LIMITER_TAG,
SWITCH_TAG,
SYNTH_VOICE_TAG,
TUNER_TAG,
UTILITY_TAG,
VISUAL_TAG,
WAVESHAPER_TAG,
NUM_TAGS
};


struct ModuleWidget; struct ModuleWidget;
struct Model; struct Model;


@@ -40,14 +88,13 @@ struct Model {
std::string manufacturerSlug; std::string manufacturerSlug;
/** Human readable name for the manufacturer, e.g. "Foo Modular" */ /** Human readable name for the manufacturer, e.g. "Foo Modular" */
std::string manufacturerName; std::string manufacturerName;
/** List of tags representing the function(s) of the module */
std::list<ModelTag> tags;


virtual ~Model() {} virtual ~Model() {}
virtual ModuleWidget *createModuleWidget() { return NULL; } virtual ModuleWidget *createModuleWidget() { return NULL; }
}; };


extern std::list<Plugin*> gPlugins;
extern std::string gToken;

void pluginInit(); void pluginInit();
void pluginDestroy(); void pluginDestroy();
void pluginLogIn(std::string email, std::string password); void pluginLogIn(std::string email, std::string password);
@@ -60,6 +107,12 @@ float pluginGetDownloadProgress();
std::string pluginGetDownloadName(); std::string pluginGetDownloadName();
std::string pluginGetLoginStatus(); std::string pluginGetLoginStatus();



extern std::list<Plugin*> gPlugins;
extern std::string gToken;
extern std::string gTagNames[NUM_TAGS];


} // namespace rack } // namespace rack






+ 3
- 2
include/rack.hpp View File

@@ -18,8 +18,8 @@ namespace rack {
//////////////////// ////////////////////




template <class TModuleWidget>
Model *createModel(std::string manufacturerSlug, std::string manufacturerName, std::string slug, std::string name) {
template <class TModuleWidget, typename... Tags>
Model *createModel(std::string manufacturerSlug, std::string manufacturerName, std::string slug, std::string name, Tags... tags) {
struct TModel : Model { struct TModel : Model {
ModuleWidget *createModuleWidget() override { ModuleWidget *createModuleWidget() override {
ModuleWidget *moduleWidget = new TModuleWidget(); ModuleWidget *moduleWidget = new TModuleWidget();
@@ -32,6 +32,7 @@ Model *createModel(std::string manufacturerSlug, std::string manufacturerName, s
model->name = name; model->name = name;
model->manufacturerSlug = manufacturerSlug; model->manufacturerSlug = manufacturerSlug;
model->manufacturerName = manufacturerName; model->manufacturerName = manufacturerName;
model->tags = {tags...};
return model; return model;
} }




+ 8
- 8
src/core/core.cpp View File

@@ -3,15 +3,15 @@


void init(rack::Plugin *p) { void init(rack::Plugin *p) {
p->slug = "Core"; p->slug = "Core";
p->addModel(createModel<AudioInterfaceWidget>("Core", "Core", "AudioInterface", "Audio Interface"));
p->addModel(createModel<MidiToCVWidget>("Core", "Core", "MIDIToCVInterface", "MIDI-to-CV Interface"));
p->addModel(createModel<AudioInterfaceWidget>("Core", "Core", "AudioInterface", "Audio Interface", EXTERNAL_TAG));
p->addModel(createModel<MidiToCVWidget>("Core", "Core", "MIDIToCVInterface", "MIDI-to-CV Interface", MIDI_TAG, EXTERNAL_TAG));


p->addModel(createModel<MIDICCToCVWidget>("Core", "Core", "MIDICCToCVInterface", "MIDI CC-to-CV Interface"));
p->addModel(createModel<MIDIClockToCVWidget>("Core", "Core", "MIDIClockToCVInterface", "MIDI Clock-to-CV Interface"));
p->addModel(createModel<MIDITriggerToCVWidget>("Core", "Core", "MIDITriggerToCVInterface", "MIDI Trigger-to-CV Interface"));
p->addModel(createModel<QuadMidiToCVWidget>("Core", "Core", "QuadMIDIToCVInterface", "Quad MIDI-to-CV Interface"));
p->addModel(createModel<MIDICCToCVWidget>("Core", "Core", "MIDICCToCVInterface", "MIDI CC-to-CV Interface", MIDI_TAG, EXTERNAL_TAG));
p->addModel(createModel<MIDIClockToCVWidget>("Core", "Core", "MIDIClockToCVInterface", "MIDI Clock-to-CV Interface", MIDI_TAG, EXTERNAL_TAG, CLOCK_TAG));
p->addModel(createModel<MIDITriggerToCVWidget>("Core", "Core", "MIDITriggerToCVInterface", "MIDI Trigger-to-CV Interface", MIDI_TAG, EXTERNAL_TAG));
p->addModel(createModel<QuadMidiToCVWidget>("Core", "Core", "QuadMIDIToCVInterface", "Quad MIDI-to-CV Interface", MIDI_TAG, EXTERNAL_TAG, QUAD_TAG));


// p->addModel(createModel<BridgeWidget>("Core", "Core", "Bridge", "Bridge")); // p->addModel(createModel<BridgeWidget>("Core", "Core", "Bridge", "Bridge"));
p->addModel(createModel<BlankWidget>("Core", "Core", "Blank", "Blank"));
p->addModel(createModel<NotesWidget>("Core", "Core", "Notes", "Notes"));
p->addModel(createModel<BlankWidget>("Core", "Core", "Blank", "Blank", BLANK_TAG));
p->addModel(createModel<NotesWidget>("Core", "Core", "Notes", "Notes", BLANK_TAG));
} }

+ 47
- 1
src/plugin.cpp View File

@@ -31,13 +31,59 @@ namespace rack {
std::list<Plugin*> gPlugins; std::list<Plugin*> gPlugins;
std::string gToken; std::string gToken;


std::string gTagNames[NUM_TAGS] = {
"Amplifier/VCA",
"Attenuator",
"Blank",
"Clock",
"Controller",
"Delay",
"Digital",
"Distortion",
"Drum",
"Dual/Stereo",
"Dynamics",
"Effect",
"Envelope Follower",
"Envelope Generator",
"Equalizer",
"External",
"Filter/VCF",
"Function Generator",
"Granular",
"LFO",
"Logic",
"Low Pass Gate",
"MIDI",
"Mixer",
"Multiple",
"Noise",
"Oscillator/VCO",
"Panning",
"Quad",
"Quantizer",
"Random",
"Reverb",
"Ring Modulator",
"Sample and Hold",
"Sampler",
"Sequencer",
"Slew Limiter",
"Switch",
"Synth Voice",
"Tuner",
"Utility",
"Visual",
"Waveshaper",
};


static bool isDownloading = false; static bool isDownloading = false;
static float downloadProgress = 0.0; static float downloadProgress = 0.0;
static std::string downloadName; static std::string downloadName;
static std::string loginStatus; static std::string loginStatus;





Plugin::~Plugin() { Plugin::~Plugin() {
for (Model *model : models) { for (Model *model : models) {
delete model; delete model;


Loading…
Cancel
Save