diff data/fileio/WavFileReader.cpp @ 285:20028c634494

* change some QStrings to std::strings etc
author Chris Cannam
date Thu, 09 Aug 2007 16:29:29 +0000
parents dc46851837d6
children 92e8dbde73cd
line wrap: on
line diff
--- a/data/fileio/WavFileReader.cpp	Thu Aug 09 14:40:03 2007 +0000
+++ b/data/fileio/WavFileReader.cpp	Thu Aug 09 16:29:29 2007 +0000
@@ -19,7 +19,7 @@
 
 #include <QMutexLocker>
 
-WavFileReader::WavFileReader(QString path, bool fileUpdating) :
+WavFileReader::WavFileReader(std::string path, bool fileUpdating) :
     m_file(0),
     m_path(path),
     m_buffer(0),
@@ -34,18 +34,16 @@
 
     m_fileInfo.format = 0;
     m_fileInfo.frames = 0;
-    m_file = sf_open(m_path.toLocal8Bit(), SFM_READ, &m_fileInfo);
+    m_file = sf_open(m_path.c_str(), SFM_READ, &m_fileInfo);
 
     if (!m_file || (!fileUpdating && m_fileInfo.channels <= 0)) {
 	std::cerr << "WavFileReader::initialize: Failed to open file ("
 		  << sf_strerror(m_file) << ")" << std::endl;
 
 	if (m_file) {
-	    m_error = QString("Couldn't load audio file '%1':\n%2")
-		.arg(m_path).arg(sf_strerror(m_file));
+	    setError("Couldn't load audio file", sf_strerror(m_file));
 	} else {
-	    m_error = QString("Failed to open audio file '%1'")
-		.arg(m_path);
+	    setError("Failed to open audio file");
 	}
 	return;
     }
@@ -74,7 +72,7 @@
 
     if (m_file) {
         sf_close(m_file);
-        m_file = sf_open(m_path.toLocal8Bit(), SFM_READ, &m_fileInfo);
+        m_file = sf_open(m_path.c_str(), SFM_READ, &m_fileInfo);
         if (!m_file || m_fileInfo.channels <= 0) {
             std::cerr << "WavFileReader::updateFrameCount: Failed to open file ("
                       << sf_strerror(m_file) << ")" << std::endl;
@@ -164,7 +162,7 @@
 }
 
 void
-WavFileReader::getSupportedExtensions(std::set<QString> &extensions)
+WavFileReader::getSupportedExtensions(std::set<std::string> &extensions)
 {
     int count;