comparison data/fileio/AudioFileReaderFactory.cpp @ 392:183ee2a55fc7

* More work to abstract out interactive components used in the data library, so that it does not need to depend on QtGui.
author Chris Cannam
date Fri, 14 Mar 2008 17:14:21 +0000
parents e6d11871e4c9
children 5746c559af15
comparison
equal deleted inserted replaced
391:5858cc462d0a 392:183ee2a55fc7
52 52
53 return rv; 53 return rv;
54 } 54 }
55 55
56 AudioFileReader * 56 AudioFileReader *
57 AudioFileReaderFactory::createReader(FileSource source, size_t targetRate) 57 AudioFileReaderFactory::createReader(FileSource source, size_t targetRate,
58 ProgressReporter *reporter)
58 { 59 {
59 return create(source, targetRate, false); 60 return create(source, targetRate, false, reporter);
60 } 61 }
61 62
62 AudioFileReader * 63 AudioFileReader *
63 AudioFileReaderFactory::createThreadingReader(FileSource source, size_t targetRate) 64 AudioFileReaderFactory::createThreadingReader(FileSource source, size_t targetRate,
65 ProgressReporter *reporter)
64 { 66 {
65 return create(source, targetRate, true); 67 return create(source, targetRate, true, reporter);
66 } 68 }
67 69
68 AudioFileReader * 70 AudioFileReader *
69 AudioFileReaderFactory::create(FileSource source, size_t targetRate, bool threading) 71 AudioFileReaderFactory::create(FileSource source, size_t targetRate, bool threading,
72 ProgressReporter *reporter)
70 { 73 {
71 QString err; 74 QString err;
72 75
73 // std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\"): Requested rate: " << targetRate << std::endl; 76 // std::cerr << "AudioFileReaderFactory::createReader(\"" << source.getLocation().toStdString() << "\"): Requested rate: " << targetRate << std::endl;
74 77
97 (source, 100 (source,
98 threading ? 101 threading ?
99 ResamplingWavFileReader::ResampleThreaded : 102 ResamplingWavFileReader::ResampleThreaded :
100 ResamplingWavFileReader::ResampleAtOnce, 103 ResamplingWavFileReader::ResampleAtOnce,
101 ResamplingWavFileReader::CacheInTemporaryFile, 104 ResamplingWavFileReader::CacheInTemporaryFile,
102 targetRate); 105 targetRate,
106 reporter);
103 } 107 }
104 } 108 }
105 109
106 #ifdef HAVE_OGGZ 110 #ifdef HAVE_OGGZ
107 #ifdef HAVE_FISHSOUND 111 #ifdef HAVE_FISHSOUND
111 (source, 115 (source,
112 threading ? 116 threading ?
113 OggVorbisFileReader::DecodeThreaded : 117 OggVorbisFileReader::DecodeThreaded :
114 OggVorbisFileReader::DecodeAtOnce, 118 OggVorbisFileReader::DecodeAtOnce,
115 OggVorbisFileReader::CacheInTemporaryFile, 119 OggVorbisFileReader::CacheInTemporaryFile,
116 targetRate); 120 targetRate,
121 reporter);
117 } 122 }
118 } 123 }
119 #endif 124 #endif
120 #endif 125 #endif
121 126
126 (source, 131 (source,
127 threading ? 132 threading ?
128 MP3FileReader::DecodeThreaded : 133 MP3FileReader::DecodeThreaded :
129 MP3FileReader::DecodeAtOnce, 134 MP3FileReader::DecodeAtOnce,
130 MP3FileReader::CacheInTemporaryFile, 135 MP3FileReader::CacheInTemporaryFile,
131 targetRate); 136 targetRate,
137 reporter);
132 } 138 }
133 } 139 }
134 #endif 140 #endif
135 141
136 #ifdef HAVE_QUICKTIME 142 #ifdef HAVE_QUICKTIME
140 (source, 146 (source,
141 threading ? 147 threading ?
142 QuickTimeFileReader::DecodeThreaded : 148 QuickTimeFileReader::DecodeThreaded :
143 QuickTimeFileReader::DecodeAtOnce, 149 QuickTimeFileReader::DecodeAtOnce,
144 QuickTimeFileReader::CacheInTemporaryFile, 150 QuickTimeFileReader::CacheInTemporaryFile,
145 targetRate); 151 targetRate,
152 reporter);
146 } 153 }
147 } 154 }
148 #endif 155 #endif
149 156
150 if (reader) { 157 if (reader) {