comparison data/fileio/test/EncodingTest.h @ 1592:f8e3dcbafb4d bqaudiostream

Implement title/maker in wav readers; extra handling of supported-ness for file types
author Chris Cannam
date Mon, 21 Jan 2019 13:16:17 +0000
parents 0773b34d987f
children d3f068153546
comparison
equal deleted inserted replaced
1591:6e68bd92ee21 1592:f8e3dcbafb4d
99 99
100 // Ensure that we can open all the files 100 // Ensure that we can open all the files
101 101
102 QFETCH(QString, audiofile); 102 QFETCH(QString, audiofile);
103 103
104 if (!AudioFileReaderFactory::isSupported(encodingDir + "/" +
105 audiofile)) {
106 #if ( QT_VERSION >= 0x050000 )
107 QSKIP("Known unsupported file, skipping");
108 #else
109 QSKIP("Known unsupported file, skipping", SkipSingle);
110 #endif
111 }
112
104 AudioFileReaderFactory::Parameters params; 113 AudioFileReaderFactory::Parameters params;
105 AudioFileReader *reader = 114 AudioFileReader *reader =
106 AudioFileReaderFactory::createReader 115 AudioFileReaderFactory::createReader
107 (encodingDir + "/" + audiofile, params); 116 (encodingDir + "/" + audiofile, params);
108 117
126 AudioFileReaderFactory::Parameters params; 135 AudioFileReaderFactory::Parameters params;
127 AudioFileReader *reader = 136 AudioFileReader *reader =
128 AudioFileReaderFactory::createReader 137 AudioFileReaderFactory::createReader
129 (encodingDir + "/" + audiofile, params); 138 (encodingDir + "/" + audiofile, params);
130 139
131 QVERIFY(reader != nullptr); 140 if (!reader) {
141 #if ( QT_VERSION >= 0x050000 )
142 QSKIP("Unsupported file, skipping");
143 #else
144 QSKIP("Unsupported file, skipping", SkipSingle);
145 #endif
146 }
132 147
133 QStringList fileAndExt = audiofile.split("."); 148 QStringList fileAndExt = audiofile.split(".");
134 QString file = fileAndExt[0]; 149 QString file = fileAndExt[0];
135 QString extension = fileAndExt[1]; 150 QString extension = fileAndExt[1];
136 151
223 238
224 AudioFileReaderFactory::Parameters params; 239 AudioFileReaderFactory::Parameters params;
225 AudioFileReader *reader = 240 AudioFileReader *reader =
226 AudioFileReaderFactory::createReader 241 AudioFileReaderFactory::createReader
227 (encodingDir + "/" + audiofile, params); 242 (encodingDir + "/" + audiofile, params);
228 QVERIFY(reader != nullptr); 243
244 if (!reader) {
245 #if ( QT_VERSION >= 0x050000 )
246 QSKIP("Unsupported file, skipping");
247 #else
248 QSKIP("Unsupported file, skipping", SkipSingle);
249 #endif
250 }
229 251
230 QString title = reader->getTitle(); 252 QString title = reader->getTitle();
231 QVERIFY(title != QString()); 253 QVERIFY(title != QString());
232 254
233 for (int useTemporary = 0; useTemporary <= 1; ++useTemporary) { 255 for (int useTemporary = 0; useTemporary <= 1; ++useTemporary) {