diff data/fileio/AudioFileReaderFactory.cpp @ 742:c10cb8782576 coreaudio_tests

Merge from branch "default"
author Chris Cannam
date Sun, 01 Jul 2012 11:53:00 +0100
parents 029dd9e5cc29 1424aa29ae95
children 02390a4c2abe
line wrap: on
line diff
--- a/data/fileio/AudioFileReaderFactory.cpp	Mon Nov 29 12:45:39 2010 +0000
+++ b/data/fileio/AudioFileReaderFactory.cpp	Sun Jul 01 11:53:00 2012 +0100
@@ -77,10 +77,15 @@
 {
     QString err;
 
-    std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\"): Requested rate: " << targetRate << std::endl;
+    SVDEBUG << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\"): Requested rate: " << targetRate << endl;
 
-    if (!source.isOK() || !source.isAvailable()) {
-        std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\": Source unavailable" << std::endl;
+    if (!source.isOK()) {
+        std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\": Failed to retrieve source (transmission error?): " << source.getErrorString() << std::endl;
+        return 0;
+    }
+
+    if (!source.isAvailable()) {
+        SVDEBUG << "AudioFileReaderFactory::createReader(\"" << source.getLocation() << "\": Source not found" << endl;
         return 0;
     }
 
@@ -97,7 +102,7 @@
             reader->isOK() &&
             reader->getSampleRate() != targetRate) {
 
-            std::cerr << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", creating resampling reader" << std::endl;
+            SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", creating resampling reader" << endl;
 
             delete reader;
             reader = new ResamplingWavFileReader
@@ -208,7 +213,7 @@
             reader->isOK() &&
             reader->getSampleRate() != targetRate) {
 
-            std::cerr << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", creating resampling reader" << std::endl;
+            SVDEBUG << "AudioFileReaderFactory::createReader: WAV file rate: " << reader->getSampleRate() << ", creating resampling reader" << endl;
 
             delete reader;
             reader = new ResamplingWavFileReader
@@ -312,10 +317,10 @@
         std::cerr << "AudioFileReaderFactory: Preferred reader for "
                   << "url \"" << source.getLocation().toStdString()
                   << "\" (content type \""
-                  << source.getContentType().toStdString() << "\") failed";
+                  << source.getContentType() << "\") failed";
 
         if (reader->getError() != "") {
-            std::cerr << ": \"" << reader->getError().toStdString() << "\"";
+            std::cerr << ": \"" << reader->getError() << "\"";
         }
         std::cerr << std::endl;
         delete reader;