vamp-aubio.n3: update links and download locations, patch from Chris Cannam
[vamp-aubio-plugins.git] / plugins / SpecDesc.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     Copyright (C) 2006-2015 Paul Brossier <piem@aubio.org>
7
8     This file is part of vamp-aubio-plugins.
9
10     vamp-aubio is free software: you can redistribute it and/or modify
11     it under the terms of the GNU General Public License as published by
12     the Free Software Foundation, either version 3 of the License, or
13     (at your option) any later version.
14
15     vamp-aubio is distributed in the hope that it will be useful,
16     but WITHOUT ANY WARRANTY; without even the implied warranty of
17     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18     GNU General Public License for more details.
19
20     You should have received a copy of the GNU General Public License
21     along with aubio.  If not, see <http://www.gnu.org/licenses/>.
22
23 */
24
25 #ifndef _SPECDESC_PLUGIN_H_
26 #define _SPECDESC_PLUGIN_H_
27
28 #include <vamp-sdk/Plugin.h>
29 #include <aubio/aubio.h>
30
31 #include "Types.h"
32
33 class SpecDesc : public Vamp::Plugin
34 {
35 public:
36     SpecDesc(float inputSampleRate);
37     virtual ~SpecDesc();
38
39     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
40     void reset();
41
42     InputDomain getInputDomain() const { return TimeDomain; }
43
44     std::string getIdentifier() const;
45     std::string getName() const;
46     std::string getDescription() const;
47     std::string getMaker() const;
48     int getPluginVersion() const;
49     std::string getCopyright() const;
50
51     ParameterList getParameterDescriptors() const;
52     float getParameter(std::string) const;
53     void setParameter(std::string, float);
54
55     size_t getPreferredStepSize() const;
56     size_t getPreferredBlockSize() const;
57
58     OutputList getOutputDescriptors() const;
59
60     FeatureSet process(const float *const *inputBuffers,
61                        Vamp::RealTime timestamp);
62
63     FeatureSet getRemainingFeatures();
64
65 protected:
66     fvec_t *m_ibuf;
67     aubio_pvoc_t *m_pvoc;
68     cvec_t *m_ispec;
69     aubio_specdesc_t *m_specdesc;
70     fvec_t *m_out;
71     SpecDescType m_specdesctype;
72     size_t m_stepSize;
73     size_t m_blockSize;
74 };
75
76
77 #endif /* _SPECDESC_PLUGIN_H_ */