vamp-aubio.n3: fix mfcc output
[vamp-aubio-plugins.git] / plugins / Types.cpp
index 6a692b1..1af71f9 100644 (file)
@@ -6,11 +6,20 @@
     Centre for Digital Music, Queen Mary, University of London.
     This file copyright 2012 Queen Mary, University of London.
     
-    This program is free software; you can redistribute it and/or
-    modify it under the terms of the GNU General Public License as
-    published by the Free Software Foundation; either version 2 of the
-    License, or (at your option) any later version.  See the file
-    COPYING included with this distribution for more information.
+    This file is part of vamp-aubio-plugins.
+
+    vamp-aubio is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    vamp-aubio is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with aubio.  If not, see <http://www.gnu.org/licenses/>.
 
 */
 
 
 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 *getAubioNameForSpecDescType(SpecDescType t)
+{
+    // In the same order as the enum elements in the header
+    static const char *const names[] = {
+        "specflux", "centroid", "spread", "skewness", "kurtosis", "slope", "decrease", "rolloff"
+    };
+    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];
 }