diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-05 04:18:38 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-10 03:55:12 (GMT) |
commit | 75fb85bbf1b2dc473f99da72124daa65c5839e01 (patch) | |
tree | 83975d52d8430270372400c922f9764d5f7adbf6 /src/multimedia/audio/qaudioinput_mac_p.cpp | |
parent | 74d3a4bf9654c8bbe9139951cc5c9352015438a6 (diff) | |
download | Qt-75fb85bbf1b2dc473f99da72124daa65c5839e01.zip Qt-75fb85bbf1b2dc473f99da72124daa65c5839e01.tar.gz Qt-75fb85bbf1b2dc473f99da72124daa65c5839e01.tar.bz2 |
Changes to low-level audio API.
QAudioFormat::isNull() -> QAudioFormat::isValid() (inverse logic)
QAudio::SuspendState -> QAudio::SuspendedState
QAudio::StopState -> QAudio::StoppedState
QAudioDeviceInfo::deviceList() -> QAudioDeviceInfo::availableDevices()
clock() -> elapsedUSecs()
totalTime() -> processedUSecs()
QIODevice* start(QIODevice*) -> void start(QIODevice*), QIODevice*
start()
Reviewed-by:Justin McPherson
Diffstat (limited to 'src/multimedia/audio/qaudioinput_mac_p.cpp')
-rw-r--r-- | src/multimedia/audio/qaudioinput_mac_p.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/multimedia/audio/qaudioinput_mac_p.cpp b/src/multimedia/audio/qaudioinput_mac_p.cpp index cb05920..d63045f 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.cpp +++ b/src/multimedia/audio/qaudioinput_mac_p.cpp @@ -526,7 +526,7 @@ QAudioInputPrivate::QAudioInputPrivate(const QByteArray& device, QAudioFormat co internalBufferSize = default_buffer_size; clockFrequency = AudioGetHostClockFrequency() / 1000; errorCode = QAudio::NoError; - stateCode = QAudio::StopState; + stateCode = QAudio::StoppedState; intervalTimer = new QTimer(this); intervalTimer->setInterval(1000); @@ -708,7 +708,7 @@ QIODevice* QAudioInputPrivate::start(QIODevice* device) QIODevice* op = device; if (!open()) { - stateCode = QAudio::StopState; + stateCode = QAudio::StoppedState; errorCode = QAudio::OpenError; return audioIO; } @@ -736,12 +736,12 @@ QIODevice* QAudioInputPrivate::start(QIODevice* device) void QAudioInputPrivate::stop() { QMutexLocker lock(&mutex); - if (stateCode != QAudio::StopState) { + if (stateCode != QAudio::StoppedState) { audioThreadStop(); audioBuffer->flush(true); errorCode = QAudio::NoError; - stateCode = QAudio::StopState; + stateCode = QAudio::StoppedState; QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); } } @@ -749,11 +749,11 @@ void QAudioInputPrivate::stop() void QAudioInputPrivate::reset() { QMutexLocker lock(&mutex); - if (stateCode != QAudio::StopState) { + if (stateCode != QAudio::StoppedState) { audioThreadStop(); errorCode = QAudio::NoError; - stateCode = QAudio::StopState; + stateCode = QAudio::StoppedState; QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); } } @@ -765,7 +765,7 @@ void QAudioInputPrivate::suspend() audioThreadStop(); errorCode = QAudio::NoError; - stateCode = QAudio::SuspendState; + stateCode = QAudio::SuspendedState; QMetaObject::invokeMethod(this, "stateChanged", Qt::QueuedConnection, Q_ARG(QAudio::State, stateCode)); } } @@ -773,7 +773,7 @@ void QAudioInputPrivate::suspend() void QAudioInputPrivate::resume() { QMutexLocker lock(&mutex); - if (stateCode == QAudio::SuspendState) { + if (stateCode == QAudio::SuspendedState) { audioThreadStart(); errorCode = QAudio::NoError; @@ -812,14 +812,14 @@ int QAudioInputPrivate::notifyInterval() const return intervalTimer->interval(); } -qint64 QAudioInputPrivate::totalTime() const +qint64 QAudioInputPrivate::processedUSecs() const { return totalFrames * 1000000 / audioFormat.frequency(); } -qint64 QAudioInputPrivate::clock() const +qint64 QAudioInputPrivate::elapsedUSecs() const { - if (stateCode == QAudio::StopState) + if (stateCode == QAudio::StoppedState) return 0; return (AudioGetCurrentHostTime() - startTime) / (clockFrequency / 1000); @@ -875,7 +875,7 @@ void QAudioInputPrivate::audioDeviceError() audioDeviceStop(); errorCode = QAudio::IOError; - stateCode = QAudio::StopState; + stateCode = QAudio::StoppedState; QMetaObject::invokeMethod(this, "deviceStopped", Qt::QueuedConnection); } } |