#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ClapFeature {
Instrument,
AudioEffect,
NoteDetector,
NoteEffect,
Analyzer,
Synthesizer,
Sampler,
Drum,
DrumMachine,
Filter,
Phaser,
Equalizer,
Deesser,
PhaseVocoder,
Granular,
FrequencyShifter,
PitchShifter,
Distortion,
TransientShaper,
Compressor,
Expander,
Gate,
Limiter,
Flanger,
Chorus,
Delay,
Reverb,
Tremolo,
Glitch,
Utility,
PitchCorrection,
Restoration,
MultiEffects,
Mixing,
Mastering,
Mono,
Stereo,
Surround,
Ambisonic,
Custom(&'static str),
}
impl ClapFeature {
pub fn as_str(&self) -> &'static str {
match self {
ClapFeature::Instrument => "instrument",
ClapFeature::AudioEffect => "audio-effect",
ClapFeature::NoteDetector => "note-detector",
ClapFeature::NoteEffect => "note-effect",
ClapFeature::Analyzer => "analyzer",
ClapFeature::Synthesizer => "synthesizer",
ClapFeature::Sampler => "sampler",
ClapFeature::Drum => "drum",
ClapFeature::DrumMachine => "drum-machine",
ClapFeature::Filter => "filter",
ClapFeature::Phaser => "phaser",
ClapFeature::Equalizer => "equalizer",
ClapFeature::Deesser => "de-esser",
ClapFeature::PhaseVocoder => "phase-vocoder",
ClapFeature::Granular => "granular",
ClapFeature::FrequencyShifter => "frequency-shifter",
ClapFeature::PitchShifter => "pitch-shifter",
ClapFeature::Distortion => "distortion",
ClapFeature::TransientShaper => "transient-shaper",
ClapFeature::Compressor => "compressor",
ClapFeature::Expander => "expander",
ClapFeature::Gate => "gate",
ClapFeature::Limiter => "limiter",
ClapFeature::Flanger => "flanger",
ClapFeature::Chorus => "chorus",
ClapFeature::Delay => "delay",
ClapFeature::Reverb => "reverb",
ClapFeature::Tremolo => "tremolo",
ClapFeature::Glitch => "glitch",
ClapFeature::Utility => "utility",
ClapFeature::PitchCorrection => "pitch-correction",
ClapFeature::Restoration => "restoration",
ClapFeature::MultiEffects => "multi-effects",
ClapFeature::Mixing => "mixing",
ClapFeature::Mastering => "mastering",
ClapFeature::Mono => "mono",
ClapFeature::Stereo => "stereo",
ClapFeature::Surround => "surround",
ClapFeature::Ambisonic => "ambisonic",
ClapFeature::Custom(s) => {
nih_debug_assert!(
s.contains(':') && s.split(':').all(|x| !x.is_empty()),
"'{s}' is not a valid feature, custom features must be namespaced (e.g. \
'nih:{s}')",
s = s
);
s
}
}
}
}