diff options
author | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-10 03:07:46 (GMT) |
---|---|---|
committer | Kurt Korbatits <kurt.korbatits@nokia.com> | 2009-11-10 03:07:46 (GMT) |
commit | 74d3a4bf9654c8bbe9139951cc5c9352015438a6 (patch) | |
tree | 63cc04b5546454fcf668125169c6793fcdbdf04c /src/multimedia/audio/qaudiooutput_alsa_p.cpp | |
parent | 8df98549a4d84b5877e50318140c2041e17632fb (diff) | |
download | Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.zip Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.tar.gz Qt-74d3a4bf9654c8bbe9139951cc5c9352015438a6.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/qaudiooutput_alsa_p.cpp')
-rw-r--r-- | src/multimedia/audio/qaudiooutput_alsa_p.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.cpp b/src/multimedia/audio/qaudiooutput_alsa_p.cpp index e9784d2..689da89 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.cpp +++ b/src/multimedia/audio/qaudiooutput_alsa_p.cpp @@ -77,7 +77,7 @@ QAudioOutputPrivate::QAudioOutputPrivate(const QByteArray &device, const QAudioF intervalTime = 1000; audioBuffer = 0; errorState = QAudio::NoError; - deviceState = QAudio::StoppedState; + deviceState = QAudio::StopState; audioSource = 0; pullMode = true; resuming = false; @@ -215,8 +215,8 @@ int QAudioOutputPrivate::setFormat() QIODevice* QAudioOutputPrivate::start(QIODevice* device) { - if(deviceState != QAudio::StoppedState) - deviceState = QAudio::StoppedState; + if(deviceState != QAudio::StopState) + deviceState = QAudio::StopState; errorState = QAudio::NoError; @@ -256,9 +256,9 @@ QIODevice* QAudioOutputPrivate::start(QIODevice* device) void QAudioOutputPrivate::stop() { - if(deviceState == QAudio::StoppedState) + if(deviceState == QAudio::StopState) return; - deviceState = QAudio::StoppedState; + deviceState = QAudio::StopState; close(); emit stateChanged(deviceState); } @@ -304,7 +304,7 @@ bool QAudioOutputPrivate::open() } if (( err < 0)||(handle == 0)) { errorState = QAudio::OpenError; - deviceState = QAudio::StoppedState; + deviceState = QAudio::StopState; return false; } snd_pcm_nonblock( handle, 0 ); @@ -387,7 +387,7 @@ bool QAudioOutputPrivate::open() if( err < 0) { qWarning()<<errMessage; errorState = QAudio::OpenError; - deviceState = QAudio::StoppedState; + deviceState = QAudio::StopState; return false; } snd_pcm_hw_params_get_buffer_size(hwparams,&buffer_frames); @@ -431,7 +431,7 @@ bool QAudioOutputPrivate::open() void QAudioOutputPrivate::close() { - deviceState = QAudio::StoppedState; + deviceState = QAudio::StopState; timer->stop(); if ( handle ) { @@ -494,7 +494,7 @@ qint64 QAudioOutputPrivate::write( const char *data, qint64 len ) if(err < 0) { close(); errorState = QAudio::FatalError; - deviceState = QAudio::StoppedState; + deviceState = QAudio::StopState; emit stateChanged(deviceState); } return 0; @@ -507,7 +507,7 @@ int QAudioOutputPrivate::periodSize() const void QAudioOutputPrivate::setBufferSize(int value) { - if(deviceState == QAudio::StoppedState) + if(deviceState == QAudio::StopState) buffer_size = value; } @@ -529,14 +529,14 @@ int QAudioOutputPrivate::notifyInterval() const return intervalTime; } -qint64 QAudioOutputPrivate::processedUSecs() const +qint64 QAudioOutputPrivate::totalTime() const { return totalTimeValue; } void QAudioOutputPrivate::resume() { - if(deviceState == QAudio::SuspendedState) { + if(deviceState == QAudio::SuspendState) { int err = 0; if(handle) { @@ -571,7 +571,7 @@ void QAudioOutputPrivate::suspend() { if(deviceState == QAudio::ActiveState || deviceState == QAudio::IdleState || resuming) { timer->stop(); - deviceState = QAudio::SuspendedState; + deviceState = QAudio::SuspendState; errorState = QAudio::NoError; emit stateChanged(deviceState); } @@ -579,7 +579,7 @@ void QAudioOutputPrivate::suspend() void QAudioOutputPrivate::userFeed() { - if(deviceState == QAudio::StoppedState || deviceState == QAudio::SuspendedState) + if(deviceState == QAudio::StopState || deviceState == QAudio::SuspendState) return; #ifdef DEBUG_AUDIO QTime now(QTime::currentTime()); @@ -658,12 +658,12 @@ bool QAudioOutputPrivate::deviceReady() return true; } -qint64 QAudioOutputPrivate::elapsedUSecs() const +qint64 QAudioOutputPrivate::clock() const { if(!handle) return 0; - if (deviceState == QAudio::StoppedState) + if (deviceState == QAudio::StopState) return 0; #if(SND_LIB_MAJOR == 1 && SND_LIB_MINOR == 0 && SND_LIB_SUBMINOR >= 14) |