comparison rdf/generator/vamp-rdf-template-generator.cpp @ 264:91ac8f5e52ea

* don't output bin names if there are none provided
author cannam
date Thu, 20 Nov 2008 17:33:12 +0000
parents 04bf4fd08490
children 93c81a6c917a
comparison
equal deleted inserted replaced
263:4454843ff384 264:91ac8f5e52ea
246 246
247 // FIXME ? Bin names may vary based on plugin setup, so including them here might be misleading... 247 // FIXME ? Bin names may vary based on plugin setup, so including them here might be misleading...
248 if (o.hasFixedBinCount) 248 if (o.hasFixedBinCount)
249 { 249 {
250 res+=" vamp:bin_count "+to_string(o.binCount)+" ;\n"; 250 res+=" vamp:bin_count "+to_string(o.binCount)+" ;\n";
251 res+=" vamp:bin_names ("; 251
252 252 bool haveBinNames = false;
253 unsigned int i; 253 for (int i=0; i < o.binNames.size(); i++) {
254 for (i=0; i+1 < o.binNames.size(); i++) 254 if (o.binNames[i] != "") {
255 res+=" \""+o.binNames[i]+"\""; 255 haveBinNames = true;
256 if (i < o.binNames.size()) 256 break;
257 res+=" \""+o.binNames[i]+"\""; 257 }
258 res+=");\n"; 258 }
259
260 if (haveBinNames) {
261 res+=" vamp:bin_names (";
262
263 unsigned int i;
264 for (i=0; i+1 < o.binNames.size(); i++)
265 res+=" \""+o.binNames[i]+"\"";
266 if (i < o.binNames.size())
267 res+=" \""+o.binNames[i]+"\"";
268 res+=");\n";
269 }
259 } 270 }
260 271
261 res+=" vamp:sample_type vamp:VariableSampleRate ;\n"; 272 res+=" vamp:sample_type vamp:VariableSampleRate ;\n";
262 if (o.sampleRate > 0.0f) 273 if (o.sampleRate > 0.0f)
263 res+=" vamp:sample_rate "+to_string(o.sampleRate)+" ;\n"; 274 res+=" vamp:sample_rate "+to_string(o.sampleRate)+" ;\n";
294 305
295 // FIXME ? Bin names may vary based on plugin setup, so including them here might be misleading... 306 // FIXME ? Bin names may vary based on plugin setup, so including them here might be misleading...
296 if (o.hasFixedBinCount) 307 if (o.hasFixedBinCount)
297 { 308 {
298 res+=" vamp:bin_count "+to_string(o.binCount)+" ;\n"; 309 res+=" vamp:bin_count "+to_string(o.binCount)+" ;\n";
299 res+=" vamp:bin_names ("; 310
300 311 bool haveBinNames = false;
301 unsigned int i; 312 for (int i=0; i < o.binNames.size(); i++) {
302 for (i=0; i+1 < o.binNames.size(); i++) 313 if (o.binNames[i] != "") {
303 res+=" \""+o.binNames[i]+"\""; 314 haveBinNames = true;
304 if (i < o.binNames.size()) 315 break;
305 res+=" \""+o.binNames[i]+"\""; 316 }
306 res+=");\n"; 317 }
318
319 if (haveBinNames) {
320 res+=" vamp:bin_names (";
321
322 unsigned int i;
323 for (i=0; i+1 < o.binNames.size(); i++)
324 res+=" \""+o.binNames[i]+"\"";
325 if (i < o.binNames.size())
326 res+=" \""+o.binNames[i]+"\"";
327 res+=");\n";
328 }
307 } 329 }
308 330
309 else if (o.sampleType == Plugin::OutputDescriptor::FixedSampleRate) 331 else if (o.sampleType == Plugin::OutputDescriptor::FixedSampleRate)
310 { 332 {
311 res+=" vamp:sample_type vamp:FixedSampleRate ;\n"; 333 res+=" vamp:sample_type vamp:FixedSampleRate ;\n";