diff runner/FeatureExtractionManager.cpp @ 112:0c2d8c945bbf multiplex

Merge from default branch
author Chris Cannam
date Thu, 02 Oct 2014 15:23:25 +0100
parents ca565b18ba3e 74f7ad72fee6
children 297f9e415e39
line wrap: on
line diff
--- a/runner/FeatureExtractionManager.cpp	Thu Oct 02 14:54:48 2014 +0100
+++ b/runner/FeatureExtractionManager.cpp	Thu Oct 02 15:23:25 2014 +0100
@@ -41,7 +41,6 @@
 #include "data/fileio/FileSource.h"
 #include "data/fileio/AudioFileReader.h"
 #include "data/fileio/AudioFileReaderFactory.h"
-#include "data/fileio/PlaylistFileReader.h"
 #include "base/TempDirectory.h"
 #include "base/ProgressPrinter.h"
 #include "transform/TransformFactory.h"
@@ -435,29 +434,6 @@
 
 void FeatureExtractionManager::addSource(QString audioSource, bool willMultiplex)
 {
-    if (QFileInfo(audioSource).suffix().toLower() == "m3u") {
-        ProgressPrinter retrievalProgress("Opening playlist file...");
-        FileSource source(audioSource, &retrievalProgress);
-        if (!source.isAvailable()) {
-            cerr << "ERROR: File or URL \"" << audioSource.toStdString()
-                 << "\" could not be located" << endl;
-            throw FileNotFound(audioSource);
-        }
-        source.waitForData();
-        PlaylistFileReader reader(source);
-        if (reader.isOK()) {
-            vector<QString> files = reader.load();
-            for (int i = 0; i < (int)files.size(); ++i) {
-                addSource(files[i], willMultiplex);
-            }
-            return;
-        } else {
-            cerr << "ERROR: Playlist \"" << audioSource.toStdString()
-                 << "\" could not be opened" << endl;
-            throw FileNotFound(audioSource);
-        }
-    }
-
     std::cerr << "Have audio source: \"" << audioSource.toStdString() << "\"" << std::endl;
 
     // We don't actually do anything with it here, unless it's the
@@ -513,39 +489,10 @@
     }
 }
 
-void FeatureExtractionManager::extractFeatures(QString audioSource, bool force)
+void FeatureExtractionManager::extractFeatures(QString audioSource)
 {
     if (m_plugins.empty()) return;
 
-    if (QFileInfo(audioSource).suffix().toLower() == "m3u") {
-        //!!! This shouldn't happen here, it should be done in
-        //!!! main.cpp when assembling the sources list
-        FileSource source(audioSource);
-        PlaylistFileReader reader(source);
-        if (reader.isOK()) {
-            vector<QString> files = reader.load();
-            for (int i = 0; i < (int)files.size(); ++i) {
-                try {
-                    extractFeatures(files[i], force);
-                } catch (const std::exception &e) {
-                    if (!force) throw;
-                    cerr << "ERROR: Feature extraction failed for playlist entry \""
-                         << files[i].toStdString()
-                         << "\": " << e.what() << endl;
-                    // print a note only if we have more files to process
-                    if (++i != (int)files.size()) {
-                        cerr << "NOTE: \"--force\" option was provided, continuing (more errors may occur)" << endl;
-                    }
-                }
-            }
-            return;
-        } else {
-            cerr << "ERROR: Playlist \"" << audioSource.toStdString()
-                 << "\" could not be opened" << endl;
-            throw FileNotFound(audioSource);
-        }
-    }
-
     testOutputFiles(audioSource);
 
     if (m_sampleRate == 0) {