Mercurial > hg > piper-cpp
comparison vamp-client/CapnpRRClient.h @ 289:26027c3a99a0
Further wiring for ProgramParameters - should now be supported throughout
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Wed, 08 Apr 2020 15:02:24 +0100 |
parents | c9f63ca1914d |
children |
comparison
equal
deleted
inserted
replaced
288:c9f63ca1914d | 289:26027c3a99a0 |
---|---|
186 LoadResponse resp; | 186 LoadResponse resp; |
187 PluginHandleMapper::Handle handle = serverLoad(req.pluginKey, | 187 PluginHandleMapper::Handle handle = serverLoad(req.pluginKey, |
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 resp.programParameters); | |
192 | 193 |
193 Vamp::Plugin *plugin = new PiperVampPlugin(this, | 194 Vamp::Plugin *plugin = new PiperVampPlugin(this, |
194 req.pluginKey, | 195 req.pluginKey, |
195 req.inputSampleRate, | 196 req.inputSampleRate, |
196 req.adapterFlags, | 197 req.adapterFlags, |
337 (void)finish(plugin); // server-side unload | 338 (void)finish(plugin); // server-side unload |
338 } | 339 } |
339 | 340 |
340 PluginStaticData psd; | 341 PluginStaticData psd; |
341 PluginConfiguration defaultConfig; | 342 PluginConfiguration defaultConfig; |
343 PluginProgramParameters programParameters; | |
342 PluginHandleMapper::Handle handle = | 344 PluginHandleMapper::Handle handle = |
343 serverLoad(plugin->getPluginKey(), | 345 serverLoad(plugin->getPluginKey(), |
344 plugin->getInputSampleRate(), | 346 plugin->getInputSampleRate(), |
345 plugin->getAdapterFlags(), | 347 plugin->getAdapterFlags(), |
346 psd, defaultConfig); | 348 psd, |
349 defaultConfig, | |
350 programParameters); | |
347 | 351 |
348 m_mapper.addPlugin(handle, plugin); | 352 m_mapper.addPlugin(handle, plugin); |
349 | 353 |
350 (void)configure(plugin, config); | 354 (void)configure(plugin, config); |
351 } | 355 } |
439 } | 443 } |
440 | 444 |
441 PluginHandleMapper::Handle | 445 PluginHandleMapper::Handle |
442 serverLoad(std::string key, float inputSampleRate, int adapterFlags, | 446 serverLoad(std::string key, float inputSampleRate, int adapterFlags, |
443 PluginStaticData &psd, | 447 PluginStaticData &psd, |
444 PluginConfiguration &defaultConfig) { | 448 PluginConfiguration &defaultConfig, |
449 PluginProgramParameters &programParameters) { | |
445 | 450 |
446 LoadRequest request; | 451 LoadRequest request; |
447 request.pluginKey = key; | 452 request.pluginKey = key; |
448 request.inputSampleRate = inputSampleRate; | 453 request.inputSampleRate = inputSampleRate; |
449 request.adapterFlags = adapterFlags; | 454 request.adapterFlags = adapterFlags; |
463 checkResponseType(reader, piper::RpcResponse::Response::Which::LOAD, id); | 468 checkResponseType(reader, piper::RpcResponse::Response::Which::LOAD, id); |
464 | 469 |
465 const piper::LoadResponse::Reader &lr = reader.getResponse().getLoad(); | 470 const piper::LoadResponse::Reader &lr = reader.getResponse().getLoad(); |
466 VampnProto::readExtractorStaticData(psd, lr.getStaticData()); | 471 VampnProto::readExtractorStaticData(psd, lr.getStaticData()); |
467 VampnProto::readConfiguration(defaultConfig, lr.getDefaultConfiguration()); | 472 VampnProto::readConfiguration(defaultConfig, lr.getDefaultConfiguration()); |
473 for (auto pp: lr.getProgramParameters()) { | |
474 VampnProto::readProgramParameterMap(programParameters, pp); | |
475 } | |
468 return lr.getHandle(); | 476 return lr.getHandle(); |
469 }; | 477 }; |
470 | 478 |
471 private: | 479 private: |
472 LogCallback *m_logger; | 480 LogCallback *m_logger; |