Mercurial > hg > svcore
comparison plugin/plugins/SamplePlayer.cpp @ 845:a299c4cec0f8
Likewise, but for toLocal8Bit().data()
author | Chris Cannam |
---|---|
date | Tue, 26 Nov 2013 13:48:13 +0000 |
parents | e802e550a1f2 |
children | 2d53205f70cd |
comparison
equal
deleted
inserted
replaced
844:f5cd33909744 | 845:a299c4cec0f8 |
---|---|
363 | 363 |
364 m_samples.clear(); | 364 m_samples.clear(); |
365 | 365 |
366 #ifdef DEBUG_SAMPLE_PLAYER | 366 #ifdef DEBUG_SAMPLE_PLAYER |
367 SVDEBUG << "SamplePlayer::searchSamples: Directory is \"" | 367 SVDEBUG << "SamplePlayer::searchSamples: Directory is \"" |
368 << m_sampleDir.toLocal8Bit().data() << "\"" << endl; | 368 << m_sampleDir << "\"" << endl; |
369 #endif | 369 #endif |
370 | 370 |
371 QDir dir(m_sampleDir, "*.wav"); | 371 QDir dir(m_sampleDir, "*.wav"); |
372 | 372 |
373 for (unsigned int i = 0; i < dir.count(); ++i) { | 373 for (unsigned int i = 0; i < dir.count(); ++i) { |
374 QFileInfo file(dir.filePath(dir[i])); | 374 QFileInfo file(dir.filePath(dir[i])); |
375 if (file.isReadable()) { | 375 if (file.isReadable()) { |
376 m_samples.push_back(std::pair<QString, QString> | 376 m_samples.push_back(std::pair<QString, QString> |
377 (file.baseName(), file.filePath())); | 377 (file.baseName(), file.filePath())); |
378 #ifdef DEBUG_SAMPLE_PLAYER | 378 #ifdef DEBUG_SAMPLE_PLAYER |
379 cerr << "Found: " << dir[i].toLocal8Bit().data() << endl; | 379 cerr << "Found: " << dir[i] << endl; |
380 #endif | 380 #endif |
381 } | 381 } |
382 } | 382 } |
383 | 383 |
384 m_sampleSearchComplete = true; | 384 m_sampleSearchComplete = true; |
395 | 395 |
396 info.format = 0; | 396 info.format = 0; |
397 file = sf_open(path.toLocal8Bit().data(), SFM_READ, &info); | 397 file = sf_open(path.toLocal8Bit().data(), SFM_READ, &info); |
398 if (!file) { | 398 if (!file) { |
399 cerr << "SamplePlayer::loadSampleData: Failed to open file " | 399 cerr << "SamplePlayer::loadSampleData: Failed to open file " |
400 << path.toLocal8Bit().data() << ": " | 400 << path << ": " |
401 << sf_strerror(file) << endl; | 401 << sf_strerror(file) << endl; |
402 return; | 402 return; |
403 } | 403 } |
404 | 404 |
405 samples = info.frames; | 405 samples = info.frames; |