comparison runner/FeatureExtractionManager.cpp @ 8:f98b58fb294f

* Set block & step sizes if not properly specified
author Chris Cannam
date Fri, 12 Dec 2008 14:29:42 +0000
parents b6431f86f307
children 12f250173bf2
comparison
equal deleted inserted replaced
7:3bd7b07c0891 8:f98b58fb294f
17 17
18 #include <vamp-hostsdk/PluginChannelAdapter.h> 18 #include <vamp-hostsdk/PluginChannelAdapter.h>
19 #include <vamp-hostsdk/PluginBufferingAdapter.h> 19 #include <vamp-hostsdk/PluginBufferingAdapter.h>
20 #include <vamp-hostsdk/PluginInputDomainAdapter.h> 20 #include <vamp-hostsdk/PluginInputDomainAdapter.h>
21 #include <vamp-hostsdk/PluginSummarisingAdapter.h> 21 #include <vamp-hostsdk/PluginSummarisingAdapter.h>
22 #include <vamp-hostsdk/PluginWrapper.h>
22 #include <vamp-hostsdk/PluginLoader.h> 23 #include <vamp-hostsdk/PluginLoader.h>
23 24
24 #include <iostream> 25 #include <iostream>
25 26
26 using namespace std; 27 using namespace std;
30 using Vamp::HostExt::PluginLoader; 31 using Vamp::HostExt::PluginLoader;
31 using Vamp::HostExt::PluginChannelAdapter; 32 using Vamp::HostExt::PluginChannelAdapter;
32 using Vamp::HostExt::PluginBufferingAdapter; 33 using Vamp::HostExt::PluginBufferingAdapter;
33 using Vamp::HostExt::PluginInputDomainAdapter; 34 using Vamp::HostExt::PluginInputDomainAdapter;
34 using Vamp::HostExt::PluginSummarisingAdapter; 35 using Vamp::HostExt::PluginSummarisingAdapter;
36 using Vamp::HostExt::PluginWrapper;
35 37
36 #include "data/fileio/FileSource.h" 38 #include "data/fileio/FileSource.h"
37 #include "data/fileio/AudioFileReader.h" 39 #include "data/fileio/AudioFileReader.h"
38 #include "data/fileio/AudioFileReaderFactory.h" 40 #include "data/fileio/AudioFileReaderFactory.h"
39 #include "data/fileio/PlaylistFileReader.h" 41 #include "data/fileio/PlaylistFileReader.h"
253 } 255 }
254 256
255 cerr << "NOTE: Loaded and initialised plugin " << plugin 257 cerr << "NOTE: Loaded and initialised plugin " << plugin
256 << " for transform \"" 258 << " for transform \""
257 << transform.getIdentifier().toStdString() << "\"" << endl; 259 << transform.getIdentifier().toStdString() << "\"" << endl;
260
261 } else {
262
263 if (transform.getStepSize() == 0 || transform.getBlockSize() == 0) {
264
265 PluginWrapper *pw = dynamic_cast<PluginWrapper *>(plugin);
266 if (pw) {
267 PluginBufferingAdapter *pba =
268 pw->getWrapper<PluginBufferingAdapter>();
269 if (pba) {
270 size_t actualStepSize = 0;
271 size_t actualBlockSize = 0;
272 pba->getActualStepAndBlockSizes(actualStepSize,
273 actualBlockSize);
274 if (transform.getStepSize() == 0) {
275 transform.setStepSize(actualStepSize);
276 }
277 if (transform.getBlockSize() == 0) {
278 transform.setBlockSize(actualBlockSize);
279 }
280 }
281 }
282 }
258 } 283 }
259 284
260 if (transform.getOutput() == "") { 285 if (transform.getOutput() == "") {
261 transform.setOutput 286 transform.setOutput
262 (plugin->getOutputDescriptors()[0].identifier.c_str()); 287 (plugin->getOutputDescriptors()[0].identifier.c_str());