Mercurial > hg > sonic-annotator
comparison runner/main.cpp @ 116:1c0799754670
Normalise option (yet to be tested)
author | Chris Cannam |
---|---|
date | Fri, 03 Oct 2014 15:42:55 +0100 |
parents | 0c2d8c945bbf |
children | 5be4995f4029 |
comparison
equal
deleted
inserted
replaced
115:95de6db296a1 | 116:1c0799754670 |
---|---|
243 cerr << " -r, --recursive If any of the <audio> arguments is found to be a local" << endl; | 243 cerr << " -r, --recursive If any of the <audio> arguments is found to be a local" << endl; |
244 cerr << " directory, search the tree starting at that directory" << endl; | 244 cerr << " directory, search the tree starting at that directory" << endl; |
245 cerr << " for all supported audio files and take all of those as" << endl; | 245 cerr << " for all supported audio files and take all of those as" << endl; |
246 cerr << " input instead." << endl; | 246 cerr << " input instead." << endl; |
247 cerr << endl; | 247 cerr << endl; |
248 cerr << " -n, --normalise Normalise input audio files to signal absolute max = 1.f." << endl; | |
249 cerr << endl; | |
248 cerr << " -f, --force Continue with subsequent files following an error." << endl; | 250 cerr << " -f, --force Continue with subsequent files following an error." << endl; |
249 cerr << endl; | 251 cerr << endl; |
250 cerr << "Housekeeping options:" << endl; | 252 cerr << "Housekeeping options:" << endl; |
251 cerr << endl; | 253 cerr << endl; |
252 cerr << " -l, --list List all known transform ids to standard output." << endl; | 254 cerr << " -l, --list List all known transform ids to standard output." << endl; |
392 set<string> requestedDefaultTransforms; | 394 set<string> requestedDefaultTransforms; |
393 set<string> requestedSummaryTypes; | 395 set<string> requestedSummaryTypes; |
394 bool force = false; | 396 bool force = false; |
395 bool multiplex = false; | 397 bool multiplex = false; |
396 bool recursive = false; | 398 bool recursive = false; |
399 bool normalise = false; | |
397 bool list = false; | 400 bool list = false; |
398 bool summaryOnly = false; | 401 bool summaryOnly = false; |
399 QString skeletonFor = ""; | 402 QString skeletonFor = ""; |
400 QString myname = args[0]; | 403 QString myname = args[0]; |
401 myname = QFileInfo(myname).baseName(); | 404 myname = QFileInfo(myname).baseName(); |
519 multiplex = true; | 522 multiplex = true; |
520 continue; | 523 continue; |
521 } else if (arg == "-r" || arg == "--recursive") { | 524 } else if (arg == "-r" || arg == "--recursive") { |
522 recursive = true; | 525 recursive = true; |
523 continue; | 526 continue; |
527 } else if (arg == "-n" || arg == "--normalise") { | |
528 normalise = true; | |
529 continue; | |
524 } else if (arg == "-f" || arg == "--force") { | 530 } else if (arg == "-f" || arg == "--force") { |
525 force = true; | 531 force = true; |
526 continue; | 532 continue; |
527 } else if (arg == "-l" || arg == "--list") { | 533 } else if (arg == "-l" || arg == "--list") { |
528 list = true; | 534 list = true; |
605 } | 611 } |
606 settings.endGroup(); | 612 settings.endGroup(); |
607 | 613 |
608 FeatureExtractionManager manager; | 614 FeatureExtractionManager manager; |
609 | 615 |
616 manager.setNormalise(normalise); | |
617 | |
610 if (!requestedSummaryTypes.empty()) { | 618 if (!requestedSummaryTypes.empty()) { |
611 if (!manager.setSummaryTypes(requestedSummaryTypes, | 619 if (!manager.setSummaryTypes(requestedSummaryTypes, |
612 boundaries)) { | 620 boundaries)) { |
613 cerr << myname.toStdString() | 621 cerr << myname.toStdString() |
614 << ": failed to set requested summary types" << endl; | 622 << ": failed to set requested summary types" << endl; |
615 exit(1); | 623 exit(1); |
616 } | 624 } |
617 } | 625 } |
618 | 626 |
619 manager.setSummariesOnly(summaryOnly); | 627 manager.setSummariesOnly(summaryOnly); |
620 | 628 |
621 vector<FeatureWriter *> writers; | 629 vector<FeatureWriter *> writers; |
622 | 630 |
623 for (set<string>::const_iterator i = requestedWriterTags.begin(); | 631 for (set<string>::const_iterator i = requestedWriterTags.begin(); |
624 i != requestedWriterTags.end(); ++i) { | 632 i != requestedWriterTags.end(); ++i) { |
625 | 633 |