cannam@57
|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
|
cannam@57
|
2
|
cannam@57
|
3 /*
|
cannam@57
|
4 Vamp
|
cannam@57
|
5
|
cannam@57
|
6 An API for audio analysis and feature extraction plugins.
|
cannam@57
|
7
|
cannam@57
|
8 Centre for Digital Music, Queen Mary, University of London.
|
cannam@57
|
9 Copyright 2006 Chris Cannam.
|
cannam@57
|
10
|
cannam@57
|
11 Permission is hereby granted, free of charge, to any person
|
cannam@57
|
12 obtaining a copy of this software and associated documentation
|
cannam@57
|
13 files (the "Software"), to deal in the Software without
|
cannam@57
|
14 restriction, including without limitation the rights to use, copy,
|
cannam@57
|
15 modify, merge, publish, distribute, sublicense, and/or sell copies
|
cannam@57
|
16 of the Software, and to permit persons to whom the Software is
|
cannam@57
|
17 furnished to do so, subject to the following conditions:
|
cannam@57
|
18
|
cannam@57
|
19 The above copyright notice and this permission notice shall be
|
cannam@57
|
20 included in all copies or substantial portions of the Software.
|
cannam@57
|
21
|
cannam@57
|
22 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
cannam@57
|
23 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
cannam@57
|
24 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
cannam@57
|
25 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
cannam@57
|
26 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
cannam@57
|
27 CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
cannam@57
|
28 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
cannam@57
|
29
|
cannam@57
|
30 Except as contained in this notice, the names of the Centre for
|
cannam@57
|
31 Digital Music; Queen Mary, University of London; and Chris Cannam
|
cannam@57
|
32 shall not be used in advertising or otherwise to promote the sale,
|
cannam@57
|
33 use or other dealings in this Software without prior written
|
cannam@57
|
34 authorization.
|
cannam@57
|
35 */
|
cannam@57
|
36
|
cannam@57
|
37 #include "PluginWrapper.h"
|
cannam@57
|
38
|
cannam@57
|
39 namespace Vamp {
|
cannam@57
|
40
|
cannam@59
|
41 namespace HostExt {
|
cannam@59
|
42
|
cannam@57
|
43 PluginWrapper::PluginWrapper(Plugin *plugin) :
|
cannam@59
|
44 Plugin(0),
|
cannam@59
|
45 m_plugin(plugin)
|
cannam@57
|
46 {
|
cannam@57
|
47 }
|
cannam@57
|
48
|
cannam@57
|
49 PluginWrapper::~PluginWrapper()
|
cannam@57
|
50 {
|
cannam@57
|
51 delete m_plugin;
|
cannam@57
|
52 }
|
cannam@57
|
53
|
cannam@57
|
54 bool
|
cannam@57
|
55 PluginWrapper::initialise(size_t channels, size_t stepSize, size_t blockSize)
|
cannam@57
|
56 {
|
cannam@57
|
57 return m_plugin->initialise(channels, stepSize, blockSize);
|
cannam@57
|
58 }
|
cannam@57
|
59
|
cannam@57
|
60 void
|
cannam@57
|
61 PluginWrapper::reset()
|
cannam@57
|
62 {
|
cannam@57
|
63 m_plugin->reset();
|
cannam@57
|
64 }
|
cannam@57
|
65
|
cannam@57
|
66 Plugin::InputDomain
|
cannam@57
|
67 PluginWrapper::getInputDomain() const
|
cannam@57
|
68 {
|
cannam@57
|
69 return m_plugin->getInputDomain();
|
cannam@57
|
70 }
|
cannam@57
|
71
|
cannam@57
|
72 unsigned int
|
cannam@57
|
73 PluginWrapper::getVampApiVersion() const
|
cannam@57
|
74 {
|
cannam@57
|
75 return m_plugin->getVampApiVersion();
|
cannam@57
|
76 }
|
cannam@57
|
77
|
cannam@57
|
78 std::string
|
cannam@57
|
79 PluginWrapper::getIdentifier() const
|
cannam@57
|
80 {
|
cannam@57
|
81 return m_plugin->getIdentifier();
|
cannam@57
|
82 }
|
cannam@57
|
83
|
cannam@57
|
84 std::string
|
cannam@57
|
85 PluginWrapper::getName() const
|
cannam@57
|
86 {
|
cannam@57
|
87 return m_plugin->getName();
|
cannam@57
|
88 }
|
cannam@57
|
89
|
cannam@57
|
90 std::string
|
cannam@57
|
91 PluginWrapper::getDescription() const
|
cannam@57
|
92 {
|
cannam@57
|
93 return m_plugin->getDescription();
|
cannam@57
|
94 }
|
cannam@57
|
95
|
cannam@57
|
96 std::string
|
cannam@57
|
97 PluginWrapper::getMaker() const
|
cannam@57
|
98 {
|
cannam@57
|
99 return m_plugin->getMaker();
|
cannam@57
|
100 }
|
cannam@57
|
101
|
cannam@57
|
102 int
|
cannam@57
|
103 PluginWrapper::getPluginVersion() const
|
cannam@57
|
104 {
|
cannam@57
|
105 return m_plugin->getPluginVersion();
|
cannam@57
|
106 }
|
cannam@57
|
107
|
cannam@57
|
108 std::string
|
cannam@57
|
109 PluginWrapper::getCopyright() const
|
cannam@57
|
110 {
|
cannam@57
|
111 return m_plugin->getCopyright();
|
cannam@57
|
112 }
|
cannam@57
|
113
|
cannam@57
|
114 PluginBase::ParameterList
|
cannam@57
|
115 PluginWrapper::getParameterDescriptors() const
|
cannam@57
|
116 {
|
cannam@57
|
117 return m_plugin->getParameterDescriptors();
|
cannam@57
|
118 }
|
cannam@57
|
119
|
cannam@57
|
120 float
|
cannam@57
|
121 PluginWrapper::getParameter(std::string parameter) const
|
cannam@57
|
122 {
|
cannam@57
|
123 return m_plugin->getParameter(parameter);
|
cannam@57
|
124 }
|
cannam@57
|
125
|
cannam@57
|
126 void
|
cannam@57
|
127 PluginWrapper::setParameter(std::string parameter, float value)
|
cannam@57
|
128 {
|
cannam@57
|
129 m_plugin->setParameter(parameter, value);
|
cannam@57
|
130 }
|
cannam@57
|
131
|
cannam@57
|
132 PluginBase::ProgramList
|
cannam@57
|
133 PluginWrapper::getPrograms() const
|
cannam@57
|
134 {
|
cannam@57
|
135 return m_plugin->getPrograms();
|
cannam@57
|
136 }
|
cannam@57
|
137
|
cannam@57
|
138 std::string
|
cannam@57
|
139 PluginWrapper::getCurrentProgram() const
|
cannam@57
|
140 {
|
cannam@57
|
141 return m_plugin->getCurrentProgram();
|
cannam@57
|
142 }
|
cannam@57
|
143
|
cannam@57
|
144 void
|
cannam@57
|
145 PluginWrapper::selectProgram(std::string program)
|
cannam@57
|
146 {
|
cannam@57
|
147 m_plugin->selectProgram(program);
|
cannam@57
|
148 }
|
cannam@57
|
149
|
cannam@57
|
150 size_t
|
cannam@57
|
151 PluginWrapper::getPreferredStepSize() const
|
cannam@57
|
152 {
|
cannam@57
|
153 return m_plugin->getPreferredStepSize();
|
cannam@57
|
154 }
|
cannam@57
|
155
|
cannam@57
|
156 size_t
|
cannam@57
|
157 PluginWrapper::getPreferredBlockSize() const
|
cannam@57
|
158 {
|
cannam@57
|
159 return m_plugin->getPreferredBlockSize();
|
cannam@57
|
160 }
|
cannam@57
|
161
|
cannam@57
|
162 size_t
|
cannam@57
|
163 PluginWrapper::getMinChannelCount() const
|
cannam@57
|
164 {
|
cannam@57
|
165 return m_plugin->getMinChannelCount();
|
cannam@57
|
166 }
|
cannam@57
|
167
|
cannam@57
|
168 size_t PluginWrapper::getMaxChannelCount() const
|
cannam@57
|
169 {
|
cannam@57
|
170 return m_plugin->getMaxChannelCount();
|
cannam@57
|
171 }
|
cannam@57
|
172
|
cannam@57
|
173 Plugin::OutputList
|
cannam@57
|
174 PluginWrapper::getOutputDescriptors() const
|
cannam@57
|
175 {
|
cannam@57
|
176 return m_plugin->getOutputDescriptors();
|
cannam@57
|
177 }
|
cannam@57
|
178
|
cannam@57
|
179 Plugin::FeatureSet
|
cannam@57
|
180 PluginWrapper::process(const float *const *inputBuffers, RealTime timestamp)
|
cannam@57
|
181 {
|
cannam@57
|
182 return m_plugin->process(inputBuffers, timestamp);
|
cannam@57
|
183 }
|
cannam@57
|
184
|
cannam@57
|
185 Plugin::FeatureSet
|
cannam@57
|
186 PluginWrapper::getRemainingFeatures()
|
cannam@57
|
187 {
|
cannam@57
|
188 return m_plugin->getRemainingFeatures();
|
cannam@57
|
189 }
|
cannam@57
|
190
|
cannam@57
|
191 }
|
cannam@57
|
192
|
cannam@59
|
193 }
|
cannam@59
|
194
|