Adjust includes for subrepo aubio
[vamp-aubio-plugins.git] / plugins / Types.cpp
index 6a692b1..c5d9a64 100644 (file)
 
 const char *getAubioNameForOnsetType(OnsetType t)
 {
-    switch (t) {
-    case OnsetEnergy: return "energy";
-    case OnsetSpecDiff: return "specdiff";
-    case OnsetHFC: return "hfc";
-    case OnsetComplex: return "complex";
-    case OnsetPhase: return "phase";
-    case OnsetMKL: return "mkl";
-    case OnsetKL: return "kl";
-    case OnsetSpecFlux: return "specflux";
-    }
+    // In the same order as the enum elements in the header
+    static const char *const names[] = {
+        "energy", "specdiff", "hfc", "complex", "phase", "kl", "mkl", "specflux"
+    };
+    return names[(int)t];
 }
 
 const char *getAubioNameForPitchType(PitchType t)
 {
-    switch (t) {
-    case PitchMComb: return "mcomb";
-    case PitchYinFFT: return "yinfft";
-    case PitchYin: return "yin";
-    case PitchSchmitt: return "schmitt";
-    case PitchFComb: return "fcomb";
-    }
+    // In the same order as the enum elements in the header
+    static const char *const names[] = {
+        "yin", "mcomb", "schmitt", "fcomb", "yinfft"
+    };
+    return names[(int)t];
 }