diff data/fileio/AudioFileReaderFactory.cpp @ 308:14e0f60435b8

* Make it possible to drop audio files, layer files, session files and images onto SV panes. Need to do a bit more work on where we expect the dropped file to go, particularly in the case of audio files -- at the moment they're always opened in new panes, but it may be better to by default replace whatever is in the target pane.
author Chris Cannam
date Wed, 10 Oct 2007 15:18:02 +0000
parents c022976d18e8
children 3a6725f285d6
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.cpp	Wed Oct 10 10:22:34 2007 +0000
+++ b/data/fileio/AudioFileReaderFactory.cpp	Wed Oct 10 15:18:02 2007 +0000
@@ -147,81 +147,6 @@
         reader = 0;
     }
 
-    reader = new WavFileReader(path);
-
-    if (targetRate != 0 &&
-        reader->isOK() &&
-        reader->getSampleRate() != targetRate) {
-
-        delete reader;
-        reader = new ResamplingWavFileReader
-            (path,
-             ResamplingWavFileReader::ResampleThreaded,
-             ResamplingWavFileReader::CacheInTemporaryFile,
-             targetRate);
-    }
-
-    if (reader->isOK()) return reader;
-
-    if (reader->getError() != "") {
-	std::cerr << "AudioFileReaderFactory: WAV file reader error: \""
-                  << reader->getError().toStdString() << "\"" << std::endl;
-    } else {
-	std::cerr << "AudioFileReaderFactory: WAV file reader failed"
-                  << std::endl;
-    }        
-    delete reader;
-
-#ifdef HAVE_OGGZ
-#ifdef HAVE_FISHSOUND
-    reader = new OggVorbisFileReader
-        (path,
-         OggVorbisFileReader::DecodeThreaded,
-         OggVorbisFileReader::CacheInTemporaryFile);
-    if (reader->isOK()) return reader;
-    if (reader->getError() != "") {
-	std::cerr << "AudioFileReaderFactory: Ogg file reader error: \""
-                  << reader->getError().toStdString() << "\"" << std::endl;
-    } else {
-	std::cerr << "AudioFileReaderFactory: Ogg file reader failed"
-                  << std::endl;
-    }        
-    delete reader;
-#endif
-#endif
- 
-#ifdef HAVE_MAD
-    reader = new MP3FileReader
-        (path,
-         MP3FileReader::DecodeThreaded,
-         MP3FileReader::CacheInTemporaryFile);
-    if (reader->isOK()) return reader;
-    if (reader->getError() != "") {
-	std::cerr << "AudioFileReaderFactory: MP3 file reader error: \""
-                  << reader->getError().toStdString() << "\"" << std::endl;
-    } else {
-	std::cerr << "AudioFileReaderFactory: MP3 file reader failed"
-                  << std::endl;
-    }        
-    delete reader;
-#endif
-
-#ifdef HAVE_QUICKTIME
-    reader = new QuickTimeFileReader
-        (path,
-         QuickTimeFileReader::DecodeThreaded,
-         QuickTimeFileReader::CacheInTemporaryFile);
-    if (reader->isOK()) return reader;
-    if (reader->getError() != "") {
-	std::cerr << "AudioFileReaderFactory: QuickTime file reader error: \""
-                  << reader->getError().toStdString() << "\"" << std::endl;
-    } else {
-	std::cerr << "AudioFileReaderFactory: QuickTime file reader failed"
-                  << std::endl;
-    }        
-    delete reader;
-#endif
-
-    return 0;
+    return reader;
 }