plugins/Onset.cpp: improve parameters handling, use same defaults as aubioonset
[vamp-aubio-plugins.git] / plugins / Types.h
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
2
3 /*
4     Vamp feature extraction plugins using Paul Brossier's Aubio library.
5
6     Centre for Digital Music, Queen Mary, University of London.
7     This file copyright 2012 Queen Mary, University of London.
8
9     This file is part of vamp-aubio-plugins.
10
11     vamp-aubio is free software: you can redistribute it and/or modify
12     it under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
15
16     vamp-aubio is distributed in the hope that it will be useful,
17     but WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19     GNU General Public License for more details.
20
21     You should have received a copy of the GNU General Public License
22     along with aubio.  If not, see <http://www.gnu.org/licenses/>.
23
24 */
25
26 #ifndef _ONSET_TYPE_H_
27 #define _ONSET_TYPE_H_
28
29 /** silence unused parameter warning by adding an attribute */
30 #if defined(__GNUC__)
31 #define UNUSED __attribute__((unused))
32 #else
33 #define UNUSED
34 #endif
35
36 // Note: the enum values in this header are ordered to match the Vamp
37 // plugin parameter values in earlier versions of this plugin set, to
38 // avoid breaking stored parameter settings that use the parameter's
39 // numerical value. Any additional values must be added after all
40 // existing ones.
41
42 enum OnsetType {
43     OnsetEnergy,
44     OnsetSpecDiff,
45     OnsetHFC,
46     OnsetComplex,
47     OnsetPhase,
48     OnsetKL,
49     OnsetMKL,
50     OnsetSpecFlux, // new in 0.4!
51     OnsetDefault   // new in 0.5
52 };
53
54 extern const char *getAubioNameForOnsetType(OnsetType t);
55
56 enum SpecDescType {
57     SpecDescFlux,
58     SpecDescCentroid,
59     SpecDescSpread,
60     SpecDescSkeweness,
61     SpecDescKurtosis,
62     SpecDescSlope,
63     SpecDescDecrease,
64     SpecDescRolloff
65 };
66
67 extern const char *getAubioNameForSpecDescType(SpecDescType t);
68
69 enum PitchType {
70     PitchYin,
71     PitchMComb,
72     PitchSchmitt,
73     PitchFComb,
74     PitchYinFFT
75 };
76
77 extern const char *getAubioNameForPitchType(PitchType t);
78
79 #endif
80