Chris@31
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
Chris@31
|
2 /*
|
Chris@31
|
3 Vamp Test Plugin
|
Chris@31
|
4 Copyright (c) 2013-2016 Queen Mary, University of London
|
Chris@0
|
5
|
Chris@31
|
6 Permission is hereby granted, free of charge, to any person
|
Chris@31
|
7 obtaining a copy of this software and associated documentation
|
Chris@31
|
8 files (the "Software"), to deal in the Software without
|
Chris@31
|
9 restriction, including without limitation the rights to use, copy,
|
Chris@31
|
10 modify, merge, publish, distribute, sublicense, and/or sell copies
|
Chris@31
|
11 of the Software, and to permit persons to whom the Software is
|
Chris@31
|
12 furnished to do so, subject to the following conditions:
|
Chris@31
|
13
|
Chris@31
|
14 The above copyright notice and this permission notice shall be
|
Chris@31
|
15 included in all copies or substantial portions of the Software.
|
Chris@31
|
16
|
Chris@31
|
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
Chris@31
|
18 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
Chris@31
|
19 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
Chris@31
|
20 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
Chris@31
|
21 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
Chris@31
|
22 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
Chris@31
|
23 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
Chris@31
|
24
|
Chris@31
|
25 Except as contained in this notice, the names of the Centre for
|
Chris@31
|
26 Digital Music and Queen Mary, University of London shall not be
|
Chris@31
|
27 used in advertising or otherwise to promote the sale, use or other
|
Chris@31
|
28 dealings in this Software without prior written authorization.
|
Chris@31
|
29 */
|
Chris@31
|
30
|
Chris@31
|
31 #ifndef VAMP_TEST_PLUGIN_H
|
Chris@31
|
32 #define VAMP_TEST_PLUGIN_H
|
Chris@0
|
33
|
Chris@0
|
34 #include <vamp-sdk/Plugin.h>
|
Chris@0
|
35
|
Chris@0
|
36 using std::string;
|
Chris@0
|
37
|
Chris@0
|
38
|
Chris@0
|
39 class VampTestPlugin : public Vamp::Plugin
|
Chris@0
|
40 {
|
Chris@0
|
41 public:
|
Chris@20
|
42 VampTestPlugin(float inputSampleRate, bool freq);
|
Chris@0
|
43 virtual ~VampTestPlugin();
|
Chris@0
|
44
|
Chris@0
|
45 string getIdentifier() const;
|
Chris@0
|
46 string getName() const;
|
Chris@0
|
47 string getDescription() const;
|
Chris@0
|
48 string getMaker() const;
|
Chris@0
|
49 int getPluginVersion() const;
|
Chris@0
|
50 string getCopyright() const;
|
Chris@0
|
51
|
Chris@0
|
52 InputDomain getInputDomain() const;
|
Chris@0
|
53 size_t getPreferredBlockSize() const;
|
Chris@0
|
54 size_t getPreferredStepSize() const;
|
Chris@0
|
55 size_t getMinChannelCount() const;
|
Chris@0
|
56 size_t getMaxChannelCount() const;
|
Chris@0
|
57
|
Chris@0
|
58 ParameterList getParameterDescriptors() const;
|
Chris@0
|
59 float getParameter(string identifier) const;
|
Chris@0
|
60 void setParameter(string identifier, float value);
|
Chris@0
|
61
|
Chris@0
|
62 ProgramList getPrograms() const;
|
Chris@0
|
63 string getCurrentProgram() const;
|
Chris@0
|
64 void selectProgram(string name);
|
Chris@0
|
65
|
Chris@0
|
66 OutputList getOutputDescriptors() const;
|
Chris@0
|
67
|
Chris@0
|
68 bool initialise(size_t channels, size_t stepSize, size_t blockSize);
|
Chris@0
|
69 void reset();
|
Chris@0
|
70
|
Chris@0
|
71 FeatureSet process(const float *const *inputBuffers,
|
Chris@0
|
72 Vamp::RealTime timestamp);
|
Chris@0
|
73
|
Chris@0
|
74 FeatureSet getRemainingFeatures();
|
Chris@0
|
75
|
Chris@0
|
76 protected:
|
Chris@20
|
77 bool m_frequencyDomain;
|
Chris@17
|
78 bool m_produceOutput;
|
Chris@3
|
79 int m_n;
|
Chris@3
|
80 std::vector<Vamp::RealTime> m_instants;
|
Chris@18
|
81 int m_channels;
|
Chris@3
|
82 int m_stepSize;
|
Chris@3
|
83 int m_blockSize;
|
Chris@3
|
84 Vamp::RealTime m_lastTime;
|
Chris@7
|
85 mutable std::map<std::string, int> m_outputNumbers;
|
Chris@5
|
86
|
Chris@5
|
87 FeatureSet featuresFrom(Vamp::RealTime, bool);
|
Chris@0
|
88 };
|
Chris@0
|
89
|
Chris@0
|
90
|
Chris@0
|
91
|
Chris@0
|
92 #endif
|