comparison VampTestPlugin.cpp @ 0:21d94fc628c8

Start on plugin that provides test outputs for each supported format
author Chris Cannam
date Thu, 21 Mar 2013 19:22:16 +0000
parents
children 572e2a3f3f11
comparison
equal deleted inserted replaced
-1:000000000000 0:21d94fc628c8
1
2
3 #include "VampTestPlugin.h"
4
5
6 VampTestPlugin::VampTestPlugin(float inputSampleRate) :
7 Plugin(inputSampleRate)
8 // Also be sure to set your plugin parameters (presumably stored
9 // in member variables) to their default values here -- the host
10 // will not do that for you
11 {
12 }
13
14 VampTestPlugin::~VampTestPlugin()
15 {
16 }
17
18 string
19 VampTestPlugin::getIdentifier() const
20 {
21 return "vamp-test-plugin";
22 }
23
24 string
25 VampTestPlugin::getName() const
26 {
27 return "Vamp Test Plugin";
28 }
29
30 string
31 VampTestPlugin::getDescription() const
32 {
33 return "Test plugin for hosts handling various output types";
34 }
35
36 string
37 VampTestPlugin::getMaker() const
38 {
39 return "Chris Cannam";
40 }
41
42 int
43 VampTestPlugin::getPluginVersion() const
44 {
45 return 1;
46 }
47
48 string
49 VampTestPlugin::getCopyright() const
50 {
51 return "BSD";
52 }
53
54 VampTestPlugin::InputDomain
55 VampTestPlugin::getInputDomain() const
56 {
57 return TimeDomain;
58 }
59
60 size_t
61 VampTestPlugin::getPreferredBlockSize() const
62 {
63 return 0;
64 }
65
66 size_t
67 VampTestPlugin::getPreferredStepSize() const
68 {
69 return 0;
70 }
71
72 size_t
73 VampTestPlugin::getMinChannelCount() const
74 {
75 return 1;
76 }
77
78 size_t
79 VampTestPlugin::getMaxChannelCount() const
80 {
81 return 1;
82 }
83
84 VampTestPlugin::ParameterList
85 VampTestPlugin::getParameterDescriptors() const
86 {
87 ParameterList list;
88 return list;
89 }
90
91 float
92 VampTestPlugin::getParameter(string identifier) const
93 {
94 return 0;
95 }
96
97 void
98 VampTestPlugin::setParameter(string identifier, float value)
99 {
100 }
101
102 VampTestPlugin::ProgramList
103 VampTestPlugin::getPrograms() const
104 {
105 ProgramList list;
106 return list;
107 }
108
109 string
110 VampTestPlugin::getCurrentProgram() const
111 {
112 return ""; // no programs
113 }
114
115 void
116 VampTestPlugin::selectProgram(string name)
117 {
118 }
119
120 VampTestPlugin::OutputList
121 VampTestPlugin::getOutputDescriptors() const
122 {
123 OutputList list;
124
125 OutputDescriptor d;
126 d.identifier = "output";
127 d.name = "My Output";
128 d.description = "";
129 d.unit = "";
130 d.hasFixedBinCount = true;
131 d.binCount = 1;
132 d.hasKnownExtents = false;
133 d.isQuantized = false;
134 d.sampleType = OutputDescriptor::OneSamplePerStep;
135 d.hasDuration = false;
136 list.push_back(d);
137
138 return list;
139 }
140
141 bool
142 VampTestPlugin::initialise(size_t channels, size_t stepSize, size_t blockSize)
143 {
144 if (channels < getMinChannelCount() ||
145 channels > getMaxChannelCount()) return false;
146
147 // Real initialisation work goes here!
148
149 return true;
150 }
151
152 void
153 VampTestPlugin::reset()
154 {
155 // Clear buffers, reset stored values, etc
156 }
157
158 VampTestPlugin::FeatureSet
159 VampTestPlugin::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
160 {
161 // Do actual work!
162 return FeatureSet();
163 }
164
165 VampTestPlugin::FeatureSet
166 VampTestPlugin::getRemainingFeatures()
167 {
168 return FeatureSet();
169 }
170