diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2013-02-22 23:11:19 +0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-27 10:34:44 +0100 |
commit | 339fda0ca9d622f3525b58e91dbf78f65b44bcc2 (patch) | |
tree | a760f90a48d1f3eefc7488cd55cf4e21bf61e995 /src/multimedia/audio/qaudiooutput.cpp | |
parent | 9b3b9fbd02210a19d989a52be08453137c246b36 (diff) |
Doc: Clarify and polish docs for QAudio[Input|Output]::start()
QAudio[Input|Output] retains ownership of the QIODevices that are
returned.
Change-Id: Ieb2f319eef906822debc13b4399d7e7336024552
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Diffstat (limited to 'src/multimedia/audio/qaudiooutput.cpp')
-rw-r--r-- | src/multimedia/audio/qaudiooutput.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp index add0e5463..d6b0c5f10 100644 --- a/src/multimedia/audio/qaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput.cpp @@ -161,16 +161,16 @@ QAudioFormat QAudioOutput::format() const } /*! - Uses the \a device as the QIODevice to transfer data. - Passing a QIODevice allows the data to be transferred without any extra code. - All that is required is to open the QIODevice. + Starts transferring audio data from the \a device to the system's audio output. + The \a device must have been opened in the \l{QIODevice::ReadOnly}{ReadOnly} or + \l{QIODevice::ReadWrite}{ReadWrite} modes. - If able to successfully output audio data to the systems audio device the - state() is set to QAudio::ActiveState, error() is set to QAudio::NoError + If the QAudioOutput is able to successfully output audio data, state() returns + QAudio::ActiveState, error() returns QAudio::NoError and the stateChanged() signal is emitted. - If a problem occurs during this process the error() is set to QAudio::OpenError, - state() is set to QAudio::StoppedState and stateChanged() signal is emitted. + If a problem occurs during this process, error() returns QAudio::OpenError, + state() returns QAudio::StoppedState and the stateChanged() signal is emitted. \sa QIODevice */ @@ -180,15 +180,19 @@ void QAudioOutput::start(QIODevice* device) } /*! - Returns a pointer to the QIODevice being used to handle the data - transfer. This QIODevice can be used to write() audio data directly. + Returns a pointer to the internal QIODevice being used to transfer data to + the system's audio output. The device will already be open and + \l{QIODevice::write()}{write()} can write data directly to it. - If able to access the systems audio device the state() is set to - QAudio::IdleState, error() is set to QAudio::NoError + \note The pointer will become invalid after the stream is stopped or + if you start another stream. + + If the QAudioOutput is able to access the system's audio device, state() returns + QAudio::IdleState, error() returns QAudio::NoError and the stateChanged() signal is emitted. - If a problem occurs during this process the error() is set to QAudio::OpenError, - state() is set to QAudio::StoppedState and stateChanged() signal is emitted. + If a problem occurs during this process, error() returns QAudio::OpenError, + state() returns QAudio::StoppedState and the stateChanged() signal is emitted. \sa QIODevice */ |