changeset 22:4ab7c925f7ac sonic-annotator-0.3

* fixes to --force option
author Chris Cannam
date Tue, 07 Jul 2009 10:50:24 +0000
parents 9a4e410bda7a
children 1a9ad8f3a98f
files runner/FeatureExtractionManager.cpp runner/main.cpp
diffstat 2 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/runner/FeatureExtractionManager.cpp	Tue Jul 07 10:34:27 2009 +0000
+++ b/runner/FeatureExtractionManager.cpp	Tue Jul 07 10:50:24 2009 +0000
@@ -577,7 +577,7 @@
         if (progress > pp) extractionProgress.setProgress(progress);
     }
 
-    std::cerr << "FeatureExtractionManager: deleting audio file reader" << std::endl;
+//    std::cerr << "FeatureExtractionManager: deleting audio file reader" << std::endl;
 
     delete reader;
     
--- a/runner/main.cpp	Tue Jul 07 10:34:27 2009 +0000
+++ b/runner/main.cpp	Tue Jul 07 10:50:24 2009 +0000
@@ -725,11 +725,18 @@
         std::cerr << "Extracting features for: \"" << i->toStdString() << "\"" << std::endl;
         try {
             manager.extractFeatures(*i);
-        } catch (std::exception e) {
+        } catch (const std::exception &e) {
             cerr << "ERROR: Failed to process file \"" << i->toStdString()
                  << "\": " << e.what() << endl;
-            if (force) continue;
-            else break;
+            if (force) {
+                // print a note only if we have more files to process
+                QStringList::const_iterator j = i;
+                if (++j != sources.end()) {
+                    cerr << "NOTE: \"--force\" option was provided, continuing (more errors may occur)" << endl;
+                }
+            } else {
+                break;
+            }
         }
     }