diff runner/main.cpp @ 169:859d8ec60e06 jams

Add setNofM logic which the JSON writer can use to write a list when sending multiple files' worth to a single target
author Chris Cannam
date Wed, 15 Oct 2014 16:05:15 +0100
parents b3d73c08b6ce
children 11a9ce2fa331
line wrap: on
line diff
--- a/runner/main.cpp	Wed Oct 15 15:20:16 2014 +0100
+++ b/runner/main.cpp	Wed Oct 15 16:05:15 2014 +0100
@@ -939,17 +939,25 @@
         }
         if (multiplex) {
             try {
+                for (int i = 0; i < (int)writers.size(); ++i) {
+                    writers[i]->setNofM(1, 1);
+                }
                 manager.extractFeaturesMultiplexed(goodSources);
             } catch (const std::exception &e) {
                 cerr << "ERROR: Feature extraction failed: "
                      << e.what() << endl;
             }
         } else {
+            int n = 0;
             for (QStringList::const_iterator i = goodSources.begin();
                  i != goodSources.end(); ++i) {
                 std::cerr << "Extracting features for: \"" << i->toStdString()
                           << "\"" << std::endl;
+                ++n;
                 try {
+                    for (int j = 0; j < (int)writers.size(); ++j) {
+                        writers[j]->setNofM(n, goodSources.size());
+                    }
                     manager.extractFeatures(*i);
                 } catch (const std::exception &e) {
                     cerr << "ERROR: Feature extraction failed for \""