comparison host/vamp-simple-host.cpp @ 83:94a42248ec33

* don't allow block/step sizes to be undefined
author cannam
date Mon, 24 Sep 2007 14:44:48 +0000
parents 6d16c376fd2f
children af0d86b8b692
comparison
equal deleted inserted replaced
82:c8b48bc6db3d 83:94a42248ec33
196 cerr << "Running plugin: \"" << plugin->getIdentifier() << "\"..." << endl; 196 cerr << "Running plugin: \"" << plugin->getIdentifier() << "\"..." << endl;
197 197
198 int blockSize = plugin->getPreferredBlockSize(); 198 int blockSize = plugin->getPreferredBlockSize();
199 int stepSize = plugin->getPreferredStepSize(); 199 int stepSize = plugin->getPreferredStepSize();
200 200
201 if (blockSize == 0) blockSize = 1024;
202 if (stepSize == 0) {
203 if (plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
204 stepSize = blockSize/2;
205 } else {
206 stepSize = blockSize;
207 }
208 }
209
201 int channels = sfinfo.channels; 210 int channels = sfinfo.channels;
202 211
203 float *filebuf = new float[blockSize * channels]; 212 float *filebuf = new float[blockSize * channels];
204 float **plugbuf = new float*[channels]; 213 float **plugbuf = new float*[channels];
205 for (int c = 0; c < channels; ++c) plugbuf[c] = new float[blockSize + 2]; 214 for (int c = 0; c < channels; ++c) plugbuf[c] = new float[blockSize + 2];