comparison rdf/RDFTransformFactory.cpp @ 994:8c9c425b4958

Support plugin version in RDF transforms, and bail out in Sonic Annotator if it doesn't match
author Chris Cannam
date Fri, 10 Oct 2014 15:24:28 +0100
parents a51781b11dd4
children 274c4362bda6
comparison
equal deleted inserted replaced
993:60e2927b1475 994:8c9c425b4958
210 "step_size", 210 "step_size",
211 "block_size", 211 "block_size",
212 "window_type", 212 "window_type",
213 "sample_rate", 213 "sample_rate",
214 "start", 214 "start",
215 "duration" 215 "duration",
216 "plugin_version"
216 }; 217 };
217 218
218 for (int j = 0; j < int(sizeof(optionals)/sizeof(optionals[0])); ++j) { 219 for (int j = 0; j < int(sizeof(optionals)/sizeof(optionals[0])); ++j) {
219 220
220 QString optional = optionals[j]; 221 QString optional = optionals[j];
247 RealTime duration = RealTime::fromXsdDuration(onode.value.toStdString()); 248 RealTime duration = RealTime::fromXsdDuration(onode.value.toStdString());
248 transform.setDuration(duration); 249 transform.setDuration(duration);
249 if (duration == RealTime::zeroTime) { 250 if (duration == RealTime::zeroTime) {
250 cerr << "\nRDFTransformFactory: WARNING: Duration is specified as \"" << onode.value << "\" in RDF file,\n but this evaluates to zero when parsed as an xsd:duration datatype.\n The duration property will therefore be ignored.\n To specify start time and duration use the xsd:duration format,\n for example \"PT2.5S\"^^xsd:duration (for 2.5 seconds).\n\n"; 251 cerr << "\nRDFTransformFactory: WARNING: Duration is specified as \"" << onode.value << "\" in RDF file,\n but this evaluates to zero when parsed as an xsd:duration datatype.\n The duration property will therefore be ignored.\n To specify start time and duration use the xsd:duration format,\n for example \"PT2.5S\"^^xsd:duration (for 2.5 seconds).\n\n";
251 } 252 }
253 } else if (optional == "plugin_version") {
254 transform.setPluginVersion(onode.value);
252 } else { 255 } else {
253 cerr << "RDFTransformFactory: ERROR: Inconsistent optionals lists (unexpected optional \"" << optional << "\"" << endl; 256 cerr << "RDFTransformFactory: ERROR: Inconsistent optionals lists (unexpected optional \"" << optional << "\"" << endl;
254 } 257 }
255 } 258 }
256 259