comparison 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
comparison
equal deleted inserted replaced
168:3e30dbb68ca2 169:859d8ec60e06
937 goodSources.push_back(source); 937 goodSources.push_back(source);
938 } 938 }
939 } 939 }
940 if (multiplex) { 940 if (multiplex) {
941 try { 941 try {
942 for (int i = 0; i < (int)writers.size(); ++i) {
943 writers[i]->setNofM(1, 1);
944 }
942 manager.extractFeaturesMultiplexed(goodSources); 945 manager.extractFeaturesMultiplexed(goodSources);
943 } catch (const std::exception &e) { 946 } catch (const std::exception &e) {
944 cerr << "ERROR: Feature extraction failed: " 947 cerr << "ERROR: Feature extraction failed: "
945 << e.what() << endl; 948 << e.what() << endl;
946 } 949 }
947 } else { 950 } else {
951 int n = 0;
948 for (QStringList::const_iterator i = goodSources.begin(); 952 for (QStringList::const_iterator i = goodSources.begin();
949 i != goodSources.end(); ++i) { 953 i != goodSources.end(); ++i) {
950 std::cerr << "Extracting features for: \"" << i->toStdString() 954 std::cerr << "Extracting features for: \"" << i->toStdString()
951 << "\"" << std::endl; 955 << "\"" << std::endl;
956 ++n;
952 try { 957 try {
958 for (int j = 0; j < (int)writers.size(); ++j) {
959 writers[j]->setNofM(n, goodSources.size());
960 }
953 manager.extractFeatures(*i); 961 manager.extractFeatures(*i);
954 } catch (const std::exception &e) { 962 } catch (const std::exception &e) {
955 cerr << "ERROR: Feature extraction failed for \"" 963 cerr << "ERROR: Feature extraction failed for \""
956 << i->toStdString() << "\": " << e.what() << endl; 964 << i->toStdString() << "\": " << e.what() << endl;
957 if (force) { 965 if (force) {