|
|
@@ -14,6 +14,7 @@ |
|
|
|
#include <sys/param.h> // for MAXPATHLEN |
|
|
|
#include <fcntl.h> |
|
|
|
#include <thread> |
|
|
|
#include <map> |
|
|
|
#include <stdexcept> |
|
|
|
|
|
|
|
#define ZIP_STATIC |
|
|
@@ -516,41 +517,20 @@ Model *getModel(std::string pluginSlug, std::string modelSlug) { |
|
|
|
return model; |
|
|
|
} |
|
|
|
|
|
|
|
std::string getAllowedTag(std::string tag) { |
|
|
|
tag = string::lowercase(tag); |
|
|
|
for (std::string allowedTag : allowedTags) { |
|
|
|
if (tag == string::lowercase(allowedTag)) |
|
|
|
return allowedTag; |
|
|
|
} |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
bool isSlugValid(std::string slug) { |
|
|
|
for (char c : slug) { |
|
|
|
if (!(std::isalnum(c) || c == '-' || c == '_')) |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::list<Plugin*> plugins; |
|
|
|
bool isDownloading = false; |
|
|
|
float downloadProgress = 0.f; |
|
|
|
std::string downloadName; |
|
|
|
std::string loginStatus; |
|
|
|
|
|
|
|
|
|
|
|
/** List of allowed tags in human display form. |
|
|
|
All tags here should be in sentence caps for display consistency. |
|
|
|
However, tags are case-insensitive in plugin metadata. |
|
|
|
*/ |
|
|
|
const std::vector<std::string> allowedTags = { |
|
|
|
"VCA", |
|
|
|
"Arpeggiator", |
|
|
|
"Attenuator", |
|
|
|
"Blank", |
|
|
|
"Attenuator", // With a level knob and not much else. |
|
|
|
"Blank", // No parameters or ports. Serves no purpose except visual. |
|
|
|
"Chorus", |
|
|
|
"Clock Modulator", // Clock dividers, multipliers, etc. |
|
|
|
"Clock", |
|
|
|
"Compressor", |
|
|
|
"Controller", // Use only if the artist "performs" with this module. Knobs are not sufficient. Examples: on-screen keyboard, XY pad. |
|
|
|
"Clock generator", |
|
|
|
"Clock modulator", // Clock dividers, multipliers, etc. |
|
|
|
"Compressor", // With threshold, ratio, knee, etc parameters. |
|
|
|
"Controller", // Use only if the artist "performs" with this module. Simply having knobs is not enough. Examples: on-screen keyboard, XY pad. |
|
|
|
"Delay", |
|
|
|
"Digital", |
|
|
|
"Distortion", |
|
|
@@ -558,46 +538,98 @@ const std::vector<std::string> allowedTags = { |
|
|
|
"Dual", // 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", |
|
|
|
"Effect", |
|
|
|
"Envelope Follower", |
|
|
|
"Envelope Generator", |
|
|
|
"Envelope follower", |
|
|
|
"Envelope generator", |
|
|
|
"Equalizer", |
|
|
|
"External", |
|
|
|
"Filter", |
|
|
|
"Flanger", |
|
|
|
"Function Generator", |
|
|
|
"Function generator", |
|
|
|
"Granular", |
|
|
|
"LFO", |
|
|
|
"Limiter", |
|
|
|
"Logic", |
|
|
|
"Low Pass Gate", |
|
|
|
"Low pass gate", |
|
|
|
"MIDI", |
|
|
|
"Mixer", |
|
|
|
"Multiple", |
|
|
|
"Noise", |
|
|
|
"VCO", |
|
|
|
"Panning", |
|
|
|
"Phaser", |
|
|
|
"Poly", |
|
|
|
"Physical Modeling", |
|
|
|
"Physical modeling", |
|
|
|
"Polyphonic", |
|
|
|
"Quad", // 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", |
|
|
|
"Random", |
|
|
|
"Recording", |
|
|
|
"Reverb", |
|
|
|
"Ring Modulator", |
|
|
|
"Sample and Hold", |
|
|
|
"Ring modulator", |
|
|
|
"Sample and hold", |
|
|
|
"Sampler", |
|
|
|
"Sequencer", |
|
|
|
"Slew Limiter", |
|
|
|
"Slew limiter", |
|
|
|
"Switch", |
|
|
|
"Synth Voice", // A synth voice must have an envelope built-in. |
|
|
|
"Synth voice", // A synth voice must have, at the minimum, a built-in oscillator and envelope. |
|
|
|
"Tuner", |
|
|
|
"Utility", // Serves only extremely basic functions, like inverting, max, min, multiplying by 2, etc. |
|
|
|
"VCA", |
|
|
|
"VCF", |
|
|
|
"VCO", |
|
|
|
"Visual", |
|
|
|
"Vocoder", |
|
|
|
"Waveshaper", |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
/** List of common synonyms for allowed tags. |
|
|
|
Aliases and tags must be lowercase. |
|
|
|
*/ |
|
|
|
const std::map<std::string, std::string> tagAliases = { |
|
|
|
{"amplifier", "vca"}, |
|
|
|
{"clock", "clock generator"}, |
|
|
|
{"drums", "drum"}, |
|
|
|
{"eq", "equalizer"}, |
|
|
|
{"filter", "vcf"}, |
|
|
|
{"low frequency oscillator", "lfo"}, |
|
|
|
{"lowpass gate", "low pass gate"}, |
|
|
|
{"oscillator", "vco"}, |
|
|
|
{"percussion", "drum"}, |
|
|
|
{"poly", "polyphonic"}, |
|
|
|
{"s&h", "sample and hold"}, |
|
|
|
{"voltage controlled amplifier", "vca"}, |
|
|
|
{"voltage controlled filter", "vcf"}, |
|
|
|
{"voltage controlled oscillator", "vco"}, |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
std::string getAllowedTag(std::string tag) { |
|
|
|
tag = string::lowercase(tag); |
|
|
|
// Transform aliases |
|
|
|
auto it = tagAliases.find(tag); |
|
|
|
if (it != tagAliases.end()) |
|
|
|
tag = it->second; |
|
|
|
// Find allowed tag |
|
|
|
for (std::string allowedTag : allowedTags) { |
|
|
|
if (tag == string::lowercase(allowedTag)) |
|
|
|
return allowedTag; |
|
|
|
} |
|
|
|
return ""; |
|
|
|
} |
|
|
|
|
|
|
|
bool isSlugValid(std::string slug) { |
|
|
|
for (char c : slug) { |
|
|
|
if (!(std::isalnum(c) || c == '-' || c == '_')) |
|
|
|
return false; |
|
|
|
} |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
std::list<Plugin*> plugins; |
|
|
|
bool isDownloading = false; |
|
|
|
float downloadProgress = 0.f; |
|
|
|
std::string downloadName; |
|
|
|
std::string loginStatus; |
|
|
|
|
|
|
|
|
|
|
|
} // namespace plugin |
|
|
|
} // namespace rack |