Mercurial > hg > piper-cpp
comparison vamp-server/simple-server.cpp @ 185:3eb00e5c76c4
Pull step & block size out into framing struct, return in config
Update the C++ code to separate out the framing parameters (step and
block size) from the configuration structure into their own structure,
as in the latest schema, and to return the accepted framing params in
the configuration response.
This also implies that the plugin stub (which adapts Piper API
back to Vamp) makes a note of the returned values,
making them available via its own getPreferredStep/BlockSize
so that the host can retry the initialise call in the case where it
failed for having the wrong values first time.
author | Chris Cannam <cannam@all-day-breakfast.com> |
---|---|
date | Fri, 03 Feb 2017 16:23:21 +0000 |
parents | 0876b5e67afe |
children | 52322dde68ea |
comparison
equal
deleted
inserted
replaced
184:150cfa0c71e1 | 185:3eb00e5c76c4 |
---|---|
482 auto h = mapper.pluginToHandle(creq.plugin); | 482 auto h = mapper.pluginToHandle(creq.plugin); |
483 if (mapper.isConfigured(h)) { | 483 if (mapper.isConfigured(h)) { |
484 throw runtime_error("plugin has already been configured"); | 484 throw runtime_error("plugin has already been configured"); |
485 } | 485 } |
486 | 486 |
487 if (creq.configuration.framing.stepSize == 0 || | |
488 creq.configuration.framing.blockSize == 0) { | |
489 throw runtime_error("step and block size must be non-zero"); | |
490 } | |
491 | |
487 response.configurationResponse = LoaderRequests().configurePlugin(creq); | 492 response.configurationResponse = LoaderRequests().configurePlugin(creq); |
488 | 493 |
489 if (!response.configurationResponse.outputs.empty()) { | 494 if (!response.configurationResponse.outputs.empty()) { |
490 mapper.markConfigured | 495 mapper.markConfigured |
491 (h, creq.configuration.channelCount, creq.configuration.blockSize); | 496 (h, |
497 creq.configuration.channelCount, | |
498 creq.configuration.framing.blockSize); | |
492 response.success = true; | 499 response.success = true; |
493 } | 500 } |
494 break; | 501 break; |
495 } | 502 } |
496 | 503 |