Mercurial > hg > svcore
comparison data/fileio/AudioFileReaderFactory.cpp @ 235:84ff7ba52993
more debug
author | Chris Cannam |
---|---|
date | Fri, 16 Feb 2007 15:47:23 +0000 |
parents | 91fdc752e540 |
children | 2b40f83e7627 |
comparison
equal
deleted
inserted
replaced
234:fd331fac5f38 | 235:84ff7ba52993 |
---|---|
18 #include "WavFileReader.h" | 18 #include "WavFileReader.h" |
19 #include "OggVorbisFileReader.h" | 19 #include "OggVorbisFileReader.h" |
20 #include "MP3FileReader.h" | 20 #include "MP3FileReader.h" |
21 | 21 |
22 #include <QString> | 22 #include <QString> |
23 #include <iostream> | |
23 | 24 |
24 QString | 25 QString |
25 AudioFileReaderFactory::getKnownExtensions() | 26 AudioFileReaderFactory::getKnownExtensions() |
26 { | 27 { |
27 std::set<QString> extensions; | 28 std::set<QString> extensions; |
56 reader = new WavFileReader(path); | 57 reader = new WavFileReader(path); |
57 if (reader->isOK()) return reader; | 58 if (reader->isOK()) return reader; |
58 if (reader->getError() != "") err = reader->getError(); | 59 if (reader->getError() != "") err = reader->getError(); |
59 delete reader; | 60 delete reader; |
60 | 61 |
62 if (err != "") { | |
63 std::cerr << "AudioFileReaderFactory: WAV file reader error: \"" | |
64 << err.toStdString() << "\"" << std::endl; | |
65 } | |
66 | |
67 | |
61 #ifdef HAVE_OGGZ | 68 #ifdef HAVE_OGGZ |
62 #ifdef HAVE_FISHSOUND | 69 #ifdef HAVE_FISHSOUND |
63 reader = new OggVorbisFileReader(path, true, | 70 reader = new OggVorbisFileReader(path, true, |
64 OggVorbisFileReader::CacheInTemporaryFile); | 71 OggVorbisFileReader::CacheInTemporaryFile); |
65 if (reader->isOK()) return reader; | 72 if (reader->isOK()) return reader; |
66 if (reader->getError() != "") err = reader->getError(); | 73 if (reader->getError() != "") err = reader->getError(); |
67 delete reader; | 74 delete reader; |
75 | |
76 if (err != "") { | |
77 std::cerr << "AudioFileReaderFactory: Ogg file reader error: \"" | |
78 << err.toStdString() << "\"" << std::endl; | |
79 } | |
80 | |
68 #endif | 81 #endif |
69 #endif | 82 #endif |
70 | 83 |
71 #ifdef HAVE_MAD | 84 #ifdef HAVE_MAD |
72 reader = new MP3FileReader(path, true, | 85 reader = new MP3FileReader(path, true, |
73 MP3FileReader::CacheInTemporaryFile); | 86 MP3FileReader::CacheInTemporaryFile); |
74 if (reader->isOK()) return reader; | 87 if (reader->isOK()) return reader; |
75 if (reader->getError() != "") err = reader->getError(); | 88 if (reader->getError() != "") err = reader->getError(); |
76 delete reader; | 89 delete reader; |
90 | |
91 if (err != "") { | |
92 std::cerr << "AudioFileReaderFactory: mp3 file reader error: \"" | |
93 << err.toStdString() << "\"" << std::endl; | |
94 } | |
95 | |
77 #endif | 96 #endif |
78 | 97 |
79 return 0; | 98 return 0; |
80 } | 99 } |
81 | 100 |