comparison vamp-client/CapnpRRClient.h @ 214:0906984b9496

Merge pull request #5 from piper-audio/dev/rename-pluginstub Dev/rename pluginstub
author Chris Cannam <cannam@all-day-breakfast.com>
date Thu, 09 Feb 2017 14:41:29 +0000
parents df65480a08de
children 3db4c7998faf
comparison
equal deleted inserted replaced
211:8183c3be5592 214:0906984b9496
36 #ifndef PIPER_CAPNP_CLIENT_H 36 #ifndef PIPER_CAPNP_CLIENT_H
37 #define PIPER_CAPNP_CLIENT_H 37 #define PIPER_CAPNP_CLIENT_H
38 38
39 #include "Loader.h" 39 #include "Loader.h"
40 #include "PluginClient.h" 40 #include "PluginClient.h"
41 #include "PluginStub.h" 41 #include "PiperVampPlugin.h"
42 #include "SynchronousTransport.h" 42 #include "SynchronousTransport.h"
43 43
44 #include "vamp-support/AssignedPluginHandleMapper.h" 44 #include "vamp-support/AssignedPluginHandleMapper.h"
45 #include "vamp-capnp/VampnProto.h" 45 #include "vamp-capnp/VampnProto.h"
46 46
147 //!!! sort out the api here 147 //!!! sort out the api here
148 148
149 // Loader methods: 149 // Loader methods:
150 150
151 ListResponse 151 ListResponse
152 listPluginData(const ListRequest &req) override { 152 list(const ListRequest &req) override {
153 153
154 LOG_E("CapnpRRClient::listPluginData called"); 154 LOG_E("CapnpRRClient::listPluginData called");
155 155
156 checkServerOK(); 156 checkServerOK();
157 157
175 175
176 return lr; 176 return lr;
177 } 177 }
178 178
179 LoadResponse 179 LoadResponse
180 loadPlugin(const LoadRequest &req) override { 180 load(const LoadRequest &req) override {
181 181
182 LOG_E("CapnpRRClient::loadPlugin called"); 182 LOG_E("CapnpRRClient::loadPlugin called");
183 183
184 checkServerOK(); 184 checkServerOK();
185 185
188 req.inputSampleRate, 188 req.inputSampleRate,
189 req.adapterFlags, 189 req.adapterFlags,
190 resp.staticData, 190 resp.staticData,
191 resp.defaultConfiguration); 191 resp.defaultConfiguration);
192 192
193 Vamp::Plugin *plugin = new PluginStub(this, 193 Vamp::Plugin *plugin = new PiperVampPlugin(this,
194 req.pluginKey, 194 req.pluginKey,
195 req.inputSampleRate, 195 req.inputSampleRate,
196 req.adapterFlags, 196 req.adapterFlags,
197 resp.staticData, 197 resp.staticData,
198 resp.defaultConfiguration); 198 resp.defaultConfiguration);
199 199
200 m_mapper.addPlugin(handle, plugin); 200 m_mapper.addPlugin(handle, plugin);
201 201
202 resp.plugin = plugin; 202 resp.plugin = plugin;
203 203
208 208
209 // PluginClient methods: 209 // PluginClient methods:
210 210
211 virtual 211 virtual
212 ConfigurationResponse 212 ConfigurationResponse
213 configure(PluginStub *plugin, 213 configure(PiperVampPlugin *plugin,
214 PluginConfiguration config) override { 214 PluginConfiguration config) override {
215 215
216 LOG_E("CapnpRRClient::configure called"); 216 LOG_E("CapnpRRClient::configure called");
217 217
218 checkServerOK(); 218 checkServerOK();
245 return cr; 245 return cr;
246 }; 246 };
247 247
248 virtual 248 virtual
249 Vamp::Plugin::FeatureSet 249 Vamp::Plugin::FeatureSet
250 process(PluginStub *plugin, 250 process(PiperVampPlugin *plugin,
251 std::vector<std::vector<float> > inputBuffers, 251 std::vector<std::vector<float> > inputBuffers,
252 Vamp::RealTime timestamp) override { 252 Vamp::RealTime timestamp) override {
253 253
254 LOG_E("CapnpRRClient::process called"); 254 LOG_E("CapnpRRClient::process called");
255 255
282 282
283 return pr.features; 283 return pr.features;
284 } 284 }
285 285
286 virtual Vamp::Plugin::FeatureSet 286 virtual Vamp::Plugin::FeatureSet
287 finish(PluginStub *plugin) override { 287 finish(PiperVampPlugin *plugin) override {
288 288
289 LOG_E("CapnpRRClient::finish called"); 289 LOG_E("CapnpRRClient::finish called");
290 290
291 checkServerOK(); 291 checkServerOK();
292 292
321 321
322 return pr.features; 322 return pr.features;
323 } 323 }
324 324
325 virtual void 325 virtual void
326 reset(PluginStub *plugin, 326 reset(PiperVampPlugin *plugin,
327 PluginConfiguration config) override { 327 PluginConfiguration config) override {
328 328
329 // Reload the plugin on the server side, and configure it as requested 329 // Reload the plugin on the server side, and configure it as requested
330 330
331 log("CapnpRRClient: reset() called, plugin will be closed and reloaded"); 331 log("CapnpRRClient: reset() called, plugin will be closed and reloaded");