diff options
author | Laszlo Papp <lpapp@kde.org> | 2011-12-06 12:51:31 +0200 |
---|---|---|
committer | Laszlo Papp <ext-laszlo.papp@nokia.com> | 2011-12-06 12:51:31 +0200 |
commit | c9d789ddff480a7773c8571c97471dfda6b087a0 (patch) | |
tree | 5bff3e8b229e350ed025a7fb07b5804a9323bd40 | |
parent | 77fba7aedfc2ab30fc7fefeaff1678aa615588e3 (diff) |
Use the "SndFile" term instead of "Snd" inside the sndfile decoder backend
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/qalcontext.cpp | 4 | ||||
-rw-r--r-- | src/qalsndfileaudiodecoder.cpp (renamed from src/qalsndaudiodecoder.cpp) | 48 | ||||
-rw-r--r-- | src/qalsndfileaudiodecoder.h (renamed from src/qalsndaudiodecoder.h) | 6 |
4 files changed, 31 insertions, 31 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 480c278..59fc141 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -49,7 +49,7 @@ set(QtOpenAL_SRCS qalbufferformat.cpp qalbufferqueue.cpp qalcontext.cpp - qalsndaudiodecoder.cpp + qalsndfileaudiodecoder.cpp qalsource.cpp qalvorbisfileaudiodecoder.cpp ) @@ -60,7 +60,7 @@ set(QtOpenAL_HEADERS qalbufferformat.h qalbufferqueue.h qalcontext.h - qalsndaudiodecoder.h + qalsndfileaudiodecoder.h qalsource.h qalvorbisfileaudiodecoder.h ${CMAKE_CURRENT_BINARY_DIR}/qtopenal_global.h diff --git a/src/qalcontext.cpp b/src/qalcontext.cpp index 677c650..053a450 100644 --- a/src/qalcontext.cpp +++ b/src/qalcontext.cpp @@ -20,7 +20,7 @@ #include "qalcontext.h" #include "qalbufferqueue.h" -#include "qalsndaudiodecoder.h" +#include "qalsndfileaudiodecoder.h" #include <QtCore/QDebug> @@ -183,7 +183,7 @@ QALContext::cacheBuffer(const QString& filename) { ALuint buffer = d->loadedBuffers.value(filename, 0); if (!buffer) { - QALSndAudioDecoder qalSndAudioDecoder; + QALSndFileAudioDecoder qalSndAudioDecoder; if (qalSndAudioDecoder.open(filename) == false) return 0; diff --git a/src/qalsndaudiodecoder.cpp b/src/qalsndfileaudiodecoder.cpp index b352b8e..88feac8 100644 --- a/src/qalsndaudiodecoder.cpp +++ b/src/qalsndfileaudiodecoder.cpp @@ -17,7 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "qalsndaudiodecoder.h" +#include "qalsndfileaudiodecoder.h" #include <QtCore/QFile> #include <QtCore/QString> @@ -26,7 +26,7 @@ #include <sndfile.h> -class QALSndAudioDecoder::Private +class QALSndFileAudioDecoder::Private { public: Private() @@ -50,15 +50,15 @@ class QALSndAudioDecoder::Private }; sf_count_t -QALSndAudioDecoder::Private::fileLengthCallback(void *user_data) +QALSndFileAudioDecoder::Private::fileLengthCallback(void *user_data) { - return reinterpret_cast<QALSndAudioDecoder::Private*>(user_data)->file.size(); + return reinterpret_cast<QALSndFileAudioDecoder::Private*>(user_data)->file.size(); } sf_count_t -QALSndAudioDecoder::Private::seekCallback(sf_count_t offset, int whence, void *user_data) +QALSndFileAudioDecoder::Private::seekCallback(sf_count_t offset, int whence, void *user_data) { - QFile &tmpFile = reinterpret_cast<QALSndAudioDecoder::Private*>(user_data)->file; + QFile &tmpFile = reinterpret_cast<QALSndFileAudioDecoder::Private*>(user_data)->file; switch (whence) { case SEEK_SET: if (tmpFile.seek(offset) == true) @@ -90,40 +90,40 @@ QALSndAudioDecoder::Private::seekCallback(sf_count_t offset, int whence, void *u } sf_count_t -QALSndAudioDecoder::Private::readCallback(void *ptr, sf_count_t count, void *user_data) +QALSndFileAudioDecoder::Private::readCallback(void *ptr, sf_count_t count, void *user_data) { - return reinterpret_cast<QALSndAudioDecoder::Private*>(user_data)->file.read(reinterpret_cast<char*>(ptr), count); + return reinterpret_cast<QALSndFileAudioDecoder::Private*>(user_data)->file.read(reinterpret_cast<char*>(ptr), count); } sf_count_t -QALSndAudioDecoder::Private::tellCallback(void *user_data) +QALSndFileAudioDecoder::Private::tellCallback(void *user_data) { - return reinterpret_cast<QALSndAudioDecoder::Private*>(user_data)->file.pos(); + return reinterpret_cast<QALSndFileAudioDecoder::Private*>(user_data)->file.pos(); } -QALSndAudioDecoder::QALSndAudioDecoder() +QALSndFileAudioDecoder::QALSndFileAudioDecoder() : d(new Private) { } -QALSndAudioDecoder::~QALSndAudioDecoder() +QALSndFileAudioDecoder::~QALSndFileAudioDecoder() { } bool -QALSndAudioDecoder::open(const QFile &file) +QALSndFileAudioDecoder::open(const QFile &file) { return open(file.fileName()); } bool -QALSndAudioDecoder::open(const QUrl &fileUrl) +QALSndFileAudioDecoder::open(const QUrl &fileUrl) { return open(fileUrl.toLocalFile()); } bool -QALSndAudioDecoder::open(const QString &fileName) +QALSndFileAudioDecoder::open(const QString &fileName) { d->file.setFileName(fileName); SF_INFO sfInfo; @@ -147,7 +147,7 @@ QALSndAudioDecoder::open(const QString &fileName) } qint64 -QALSndAudioDecoder::pos() +QALSndFileAudioDecoder::pos() { int position; if ((position = sf_seek(d->sndFile, 0, SEEK_CUR)) == -1) { @@ -158,7 +158,7 @@ QALSndAudioDecoder::pos() } bool -QALSndAudioDecoder::seek(qint64 pos) +QALSndFileAudioDecoder::seek(qint64 pos) { if (sf_seek(d->sndFile, pos, SEEK_SET) == -1) { qWarning() << Q_FUNC_INFO << "Failed to seek in the file:" << sf_strerror(d->sndFile); @@ -169,7 +169,7 @@ QALSndAudioDecoder::seek(qint64 pos) } bool -QALSndAudioDecoder::close() +QALSndFileAudioDecoder::close() { if (sf_close(d->sndFile)) { qWarning() << Q_FUNC_INFO << "Failed to close the file:" << sf_strerror(d->sndFile); @@ -180,31 +180,31 @@ QALSndAudioDecoder::close() } void -QALSndAudioDecoder::setEncodedData(const QByteArray &encodedData) +QALSndFileAudioDecoder::setEncodedData(const QByteArray &encodedData) { d->encodedData = encodedData; } int -QALSndAudioDecoder::channels() const +QALSndFileAudioDecoder::channels() const { return d->sfInfo.channels; } int -QALSndAudioDecoder::sampleRate() const +QALSndFileAudioDecoder::sampleRate() const { return d->sfInfo.samplerate; } int -QALSndAudioDecoder::sampleSize() const +QALSndFileAudioDecoder::sampleSize() const { return 16; } QByteArray -QALSndAudioDecoder::decode(qint64 maxlen) +QALSndFileAudioDecoder::decode(qint64 maxlen) { QByteArray result; result.reserve(maxlen); @@ -218,7 +218,7 @@ QALSndAudioDecoder::decode(qint64 maxlen) } qint64 -QALSndAudioDecoder::decode(char *decodedData, qint64 maxlen) +QALSndFileAudioDecoder::decode(char *decodedData, qint64 maxlen) { return sf_readf_short(d->sndFile, reinterpret_cast<short*>(decodedData), maxlen); } diff --git a/src/qalsndaudiodecoder.h b/src/qalsndfileaudiodecoder.h index 619ef68..99647cd 100644 --- a/src/qalsndaudiodecoder.h +++ b/src/qalsndfileaudiodecoder.h @@ -24,12 +24,12 @@ #include "qalabstractaudiodecoder.h" -class Q_OPENAL_EXPORT QALSndAudioDecoder : QALAbstractAudioDecoder +class Q_OPENAL_EXPORT QALSndFileAudioDecoder : QALAbstractAudioDecoder { //Q_DECLARE_PRIVATE(QALAbstractAudioDecoder) public: - QALSndAudioDecoder(); - virtual ~QALSndAudioDecoder(); + QALSndFileAudioDecoder(); + virtual ~QALSndFileAudioDecoder(); bool open(const QFile &file); bool open(const QUrl &fileUrl); |