comparison vamp-hostsdk/PluginInputDomainAdapter.cpp @ 57:09a1aac6c362 host-factory-stuff

* add wrapper base * make loader able to look up categories
author cannam
date Wed, 09 May 2007 15:21:37 +0000
parents 4ab6224110ef
children
comparison
equal deleted inserted replaced
56:4ab6224110ef 57:09a1aac6c362
39 #include <cmath> 39 #include <cmath>
40 40
41 namespace Vamp { 41 namespace Vamp {
42 42
43 PluginInputDomainAdapter::PluginInputDomainAdapter(Plugin *plugin) : 43 PluginInputDomainAdapter::PluginInputDomainAdapter(Plugin *plugin) :
44 Plugin(0), 44 PluginWrapper(plugin),
45 m_plugin(plugin),
46 m_channels(0), 45 m_channels(0),
47 m_blockSize(0), 46 m_blockSize(0),
48 m_freqbuf(0) 47 m_freqbuf(0)
49 { 48 {
50 } 49 }
51 50
52 PluginInputDomainAdapter::~PluginInputDomainAdapter() 51 PluginInputDomainAdapter::~PluginInputDomainAdapter()
53 { 52 {
54 delete m_plugin;
55 } 53 }
56 54
57 bool 55 bool
58 PluginInputDomainAdapter::initialise(size_t channels, size_t stepSize, size_t blockSize) 56 PluginInputDomainAdapter::initialise(size_t channels, size_t stepSize, size_t blockSize)
59 { 57 {
85 } 83 }
86 84
87 return m_plugin->initialise(channels, stepSize, blockSize); 85 return m_plugin->initialise(channels, stepSize, blockSize);
88 } 86 }
89 87
90 void 88 Plugin::InputDomain
91 PluginInputDomainAdapter::reset() 89 PluginInputDomainAdapter::getInputDomain() const
92 { 90 {
93 m_plugin->reset(); 91 return TimeDomain;
94 }
95
96 unsigned int
97 PluginInputDomainAdapter::getVampApiVersion() const
98 {
99 return m_plugin->getVampApiVersion();
100 }
101
102 std::string
103 PluginInputDomainAdapter::getIdentifier() const
104 {
105 return m_plugin->getIdentifier();
106 }
107
108 std::string
109 PluginInputDomainAdapter::getName() const
110 {
111 return m_plugin->getName();
112 }
113
114 std::string
115 PluginInputDomainAdapter::getDescription() const
116 {
117 return m_plugin->getDescription();
118 }
119
120 std::string
121 PluginInputDomainAdapter::getMaker() const
122 {
123 return m_plugin->getMaker();
124 }
125
126 int
127 PluginInputDomainAdapter::getPluginVersion() const
128 {
129 return m_plugin->getPluginVersion();
130 }
131
132 std::string
133 PluginInputDomainAdapter::getCopyright() const
134 {
135 return m_plugin->getCopyright();
136 }
137
138 PluginBase::ParameterList
139 PluginInputDomainAdapter::getParameterDescriptors() const
140 {
141 return m_plugin->getParameterDescriptors();
142 }
143
144 float
145 PluginInputDomainAdapter::getParameter(std::string parameter) const
146 {
147 return m_plugin->getParameter(parameter);
148 }
149
150 void
151 PluginInputDomainAdapter::setParameter(std::string parameter, float value)
152 {
153 m_plugin->setParameter(parameter, value);
154 }
155
156 PluginBase::ProgramList
157 PluginInputDomainAdapter::getPrograms() const
158 {
159 return m_plugin->getPrograms();
160 }
161
162 std::string
163 PluginInputDomainAdapter::getCurrentProgram() const
164 {
165 return m_plugin->getCurrentProgram();
166 }
167
168 void
169 PluginInputDomainAdapter::selectProgram(std::string program)
170 {
171 m_plugin->selectProgram(program);
172 } 92 }
173 93
174 size_t 94 size_t
175 PluginInputDomainAdapter::getPreferredStepSize() const 95 PluginInputDomainAdapter::getPreferredStepSize() const
176 { 96 {
191 if (block == 0 && (m_plugin->getInputDomain() == FrequencyDomain)) { 111 if (block == 0 && (m_plugin->getInputDomain() == FrequencyDomain)) {
192 block = 1024; 112 block = 1024;
193 } 113 }
194 114
195 return block; 115 return block;
196 }
197
198 size_t
199 PluginInputDomainAdapter::getMinChannelCount() const
200 {
201 return m_plugin->getMinChannelCount();
202 }
203
204 size_t PluginInputDomainAdapter::getMaxChannelCount() const
205 {
206 return m_plugin->getMaxChannelCount();
207 }
208
209 Plugin::OutputList
210 PluginInputDomainAdapter::getOutputDescriptors() const
211 {
212 return m_plugin->getOutputDescriptors();
213 } 116 }
214 117
215 Plugin::FeatureSet 118 Plugin::FeatureSet
216 PluginInputDomainAdapter::process(const float *const *inputBuffers, RealTime timestamp) 119 PluginInputDomainAdapter::process(const float *const *inputBuffers, RealTime timestamp)
217 { 120 {
245 148
246 //!!! do we want to adjust the timestamp or anything so as to 149 //!!! do we want to adjust the timestamp or anything so as to
247 // effectively centre the frame? 150 // effectively centre the frame?
248 151
249 return m_plugin->process(m_freqbuf, timestamp); 152 return m_plugin->process(m_freqbuf, timestamp);
250 }
251
252 Plugin::FeatureSet
253 PluginInputDomainAdapter::getRemainingFeatures()
254 {
255 return m_plugin->getRemainingFeatures();
256 } 153 }
257 154
258 void 155 void
259 PluginInputDomainAdapter::fft(unsigned int n, bool inverse, 156 PluginInputDomainAdapter::fft(unsigned int n, bool inverse,
260 double *ri, double *ii, double *ro, double *io) 157 double *ri, double *ii, double *ro, double *io)