use new action map API instead of ActionManager::get_action
[ardour.git] / libs / vamp-plugins / ChromagramPlugin.h
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
2
3 /*
4     QM Vamp Plugin Set
5
6     Centre for Digital Music, Queen Mary, University of London.
7
8     This program is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License as
10     published by the Free Software Foundation; either version 2 of the
11     License, or (at your option) any later version.  See the file
12     COPYING included with this distribution for more information.
13 */
14
15 #ifndef _CHROMAGRAM_PLUGIN_H_
16 #define _CHROMAGRAM_PLUGIN_H_
17
18 #include <vamp-sdk/Plugin.h>
19 #include <dsp/chromagram/Chromagram.h>
20
21 class ChromagramPlugin : public Vamp::Plugin
22 {
23 public:
24     ChromagramPlugin(float inputSampleRate);
25     virtual ~ChromagramPlugin();
26
27     bool initialise(size_t channels, size_t stepSize, size_t blockSize);
28     void reset();
29
30     InputDomain getInputDomain() const { return FrequencyDomain; }
31
32     std::string getIdentifier() const;
33     std::string getName() const;
34     std::string getDescription() const;
35     std::string getMaker() const;
36     int getPluginVersion() const;
37     std::string getCopyright() const;
38
39     ParameterList getParameterDescriptors() const;
40     float getParameter(std::string) const;
41     void setParameter(std::string, float);
42
43     size_t getPreferredStepSize() const;
44     size_t getPreferredBlockSize() const;
45
46     OutputList getOutputDescriptors() const;
47
48     FeatureSet process(const float *const *inputBuffers,
49                        Vamp::RealTime timestamp);
50
51     FeatureSet getRemainingFeatures();
52
53 protected:
54     int m_minMIDIPitch;
55     int m_maxMIDIPitch;
56     float m_tuningFrequency;
57     MathUtilities::NormaliseType m_normalise;
58     int m_bpo;
59
60     void setupConfig();
61
62     ChromaConfig m_config;
63     Chromagram *m_chromagram;
64     mutable size_t m_step;
65     mutable size_t m_block;
66
67     vector<double> m_binsums;
68     size_t m_count;
69 };
70
71
72 #endif