.travis.yml: fix environment definition
[vamp-aubio-plugins.git] / plugins / Tempo.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 2006 Chris Cannam.
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 _TEMPO_PLUGIN_H_
27 #define _TEMPO_PLUGIN_H_
28
29 #include <vamp-sdk/Plugin.h>
30 #include <aubio/aubio.h>
31
32 #include "Types.h"
33
34 class Tempo : public Vamp::Plugin
35 {
36 public:
37     Tempo(float inputSampleRate);
38     virtual ~Tempo();
39
40     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
41     void reset();
42
43     InputDomain getInputDomain() const { return TimeDomain; }
44
45     std::string getIdentifier() const;
46     std::string getName() const;
47     std::string getDescription() const;
48     std::string getMaker() const;
49     int getPluginVersion() const;
50     std::string getCopyright() const;
51
52     ParameterList getParameterDescriptors() const;
53     float getParameter(std::string) const;
54     void setParameter(std::string, float);
55
56     size_t getPreferredStepSize() const;
57     size_t getPreferredBlockSize() const;
58
59     OutputList getOutputDescriptors() const;
60
61     FeatureSet process(const float *const *inputBuffers, Vamp::RealTime timestamp);
62
63     FeatureSet getRemainingFeatures();
64
65 protected:
66     fvec_t *m_ibuf;
67     fvec_t *m_beat;
68     smpl_t m_bpm;
69     OnsetType m_onsettype;
70     aubio_tempo_t *m_tempo;
71     float m_threshold;
72     float m_silence;
73     size_t m_stepSize;
74     size_t m_blockSize;
75     Vamp::RealTime m_delay;
76     Vamp::RealTime m_lastBeat;
77 };
78
79
80 #endif