|
@@ -14,6 +14,7 @@ |
|
|
#include <sys/param.h> // for MAXPATHLEN |
|
|
#include <sys/param.h> // for MAXPATHLEN |
|
|
#include <fcntl.h> |
|
|
#include <fcntl.h> |
|
|
#include <thread> |
|
|
#include <thread> |
|
|
|
|
|
#include <map> |
|
|
#include <stdexcept> |
|
|
#include <stdexcept> |
|
|
|
|
|
|
|
|
#define ZIP_STATIC |
|
|
#define ZIP_STATIC |
|
@@ -516,41 +517,20 @@ Model *getModel(std::string pluginSlug, std::string modelSlug) { |
|
|
return model; |
|
|
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 = { |
|
|
const std::vector<std::string> allowedTags = { |
|
|
"VCA", |
|
|
|
|
|
"Arpeggiator", |
|
|
"Arpeggiator", |
|
|
"Attenuator", |
|
|
|
|
|
"Blank", |
|
|
|
|
|
|
|
|
"Attenuator", // With a level knob and not much else. |
|
|
|
|
|
"Blank", // No parameters or ports. Serves no purpose except visual. |
|
|
"Chorus", |
|
|
"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", |
|
|
"Delay", |
|
|
"Digital", |
|
|
"Digital", |
|
|
"Distortion", |
|
|
"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. |
|
|
"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", |
|
|
"Dynamics", |
|
|
"Effect", |
|
|
"Effect", |
|
|
"Envelope Follower", |
|
|
|
|
|
"Envelope Generator", |
|
|
|
|
|
|
|
|
"Envelope follower", |
|
|
|
|
|
"Envelope generator", |
|
|
"Equalizer", |
|
|
"Equalizer", |
|
|
"External", |
|
|
"External", |
|
|
"Filter", |
|
|
|
|
|
"Flanger", |
|
|
"Flanger", |
|
|
"Function Generator", |
|
|
|
|
|
|
|
|
"Function generator", |
|
|
"Granular", |
|
|
"Granular", |
|
|
"LFO", |
|
|
"LFO", |
|
|
"Limiter", |
|
|
"Limiter", |
|
|
"Logic", |
|
|
"Logic", |
|
|
"Low Pass Gate", |
|
|
|
|
|
|
|
|
"Low pass gate", |
|
|
"MIDI", |
|
|
"MIDI", |
|
|
"Mixer", |
|
|
"Mixer", |
|
|
"Multiple", |
|
|
"Multiple", |
|
|
"Noise", |
|
|
"Noise", |
|
|
"VCO", |
|
|
|
|
|
"Panning", |
|
|
"Panning", |
|
|
"Phaser", |
|
|
"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. |
|
|
"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", |
|
|
"Quantizer", |
|
|
"Random", |
|
|
"Random", |
|
|
"Recording", |
|
|
"Recording", |
|
|
"Reverb", |
|
|
"Reverb", |
|
|
"Ring Modulator", |
|
|
|
|
|
"Sample and Hold", |
|
|
|
|
|
|
|
|
"Ring modulator", |
|
|
|
|
|
"Sample and hold", |
|
|
"Sampler", |
|
|
"Sampler", |
|
|
"Sequencer", |
|
|
"Sequencer", |
|
|
"Slew Limiter", |
|
|
|
|
|
|
|
|
"Slew limiter", |
|
|
"Switch", |
|
|
"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", |
|
|
"Tuner", |
|
|
"Utility", // Serves only extremely basic functions, like inverting, max, min, multiplying by 2, etc. |
|
|
"Utility", // Serves only extremely basic functions, like inverting, max, min, multiplying by 2, etc. |
|
|
|
|
|
"VCA", |
|
|
|
|
|
"VCF", |
|
|
|
|
|
"VCO", |
|
|
"Visual", |
|
|
"Visual", |
|
|
"Vocoder", |
|
|
"Vocoder", |
|
|
"Waveshaper", |
|
|
"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 plugin |
|
|
} // namespace rack |
|
|
} // namespace rack |