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>
This commit is contained in:
committed by
The Qt Project
parent
9b3b9fbd02
commit
339fda0ca9
@@ -151,16 +151,16 @@ QAudioInput::~QAudioInput()
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Uses the \a device as the QIODevice to transfer data.
|
Starts transferring audio data from the system's audio input to the \a device.
|
||||||
Passing a QIODevice allows the data to be transferred without any extra code.
|
The \a device must have been opened in the \l{QIODevice::WriteOnly}{WriteOnly},
|
||||||
All that is required is to open the QIODevice.
|
\l{QIODevice::Append}{Append} or \l{QIODevice::ReadWrite}{ReadWrite} modes.
|
||||||
|
|
||||||
If able to successfully get audio data from the systems audio device the
|
If the QAudioInput is able to successfully get audio data, state() returns
|
||||||
state() is set to either QAudio::ActiveState or QAudio::IdleState,
|
either QAudio::ActiveState or QAudio::IdleState, error() returns QAudio::NoError
|
||||||
error() is set to QAudio::NoError and the stateChanged() signal is emitted.
|
and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
If a problem occurs during this process the error() is set to QAudio::OpenError,
|
If a problem occurs during this process, error() returns QAudio::OpenError,
|
||||||
state() is set to QAudio::StoppedState and stateChanged() signal is emitted.
|
state() returns QAudio::StoppedState and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
\sa QIODevice
|
\sa QIODevice
|
||||||
*/
|
*/
|
||||||
@@ -171,16 +171,19 @@ void QAudioInput::start(QIODevice* device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a pointer to the QIODevice being used to handle the data
|
Returns a pointer to the internal QIODevice being used to transfer data from
|
||||||
transfer. This QIODevice can be used to read() audio data
|
the system's audio input. The device will already be open and
|
||||||
directly.
|
\l{QIODevice::read()}{read()} can read data directly from it.
|
||||||
|
|
||||||
If able to access the systems audio device the state() is set to
|
\note The pointer will become invalid after the stream is stopped or
|
||||||
QAudio::IdleState, error() is set to QAudio::NoError
|
if you start another stream.
|
||||||
|
|
||||||
|
If the QAudioInput is able to access the system's audio device, state() returns
|
||||||
|
QAudio::IdleState, error() returns QAudio::NoError
|
||||||
and the stateChanged() signal is emitted.
|
and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
If a problem occurs during this process the error() is set to QAudio::OpenError,
|
If a problem occurs during this process, error() returns QAudio::OpenError,
|
||||||
state() is set to QAudio::StoppedState and stateChanged() signal is emitted.
|
state() returns QAudio::StoppedState and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
\sa QIODevice
|
\sa QIODevice
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -161,16 +161,16 @@ QAudioFormat QAudioOutput::format() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Uses the \a device as the QIODevice to transfer data.
|
Starts transferring audio data from the \a device to the system's audio output.
|
||||||
Passing a QIODevice allows the data to be transferred without any extra code.
|
The \a device must have been opened in the \l{QIODevice::ReadOnly}{ReadOnly} or
|
||||||
All that is required is to open the QIODevice.
|
\l{QIODevice::ReadWrite}{ReadWrite} modes.
|
||||||
|
|
||||||
If able to successfully output audio data to the systems audio device the
|
If the QAudioOutput is able to successfully output audio data, state() returns
|
||||||
state() is set to QAudio::ActiveState, error() is set to QAudio::NoError
|
QAudio::ActiveState, error() returns QAudio::NoError
|
||||||
and the stateChanged() signal is emitted.
|
and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
If a problem occurs during this process the error() is set to QAudio::OpenError,
|
If a problem occurs during this process, error() returns QAudio::OpenError,
|
||||||
state() is set to QAudio::StoppedState and stateChanged() signal is emitted.
|
state() returns QAudio::StoppedState and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
\sa QIODevice
|
\sa QIODevice
|
||||||
*/
|
*/
|
||||||
@@ -180,15 +180,19 @@ void QAudioOutput::start(QIODevice* device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Returns a pointer to the QIODevice being used to handle the data
|
Returns a pointer to the internal QIODevice being used to transfer data to
|
||||||
transfer. This QIODevice can be used to write() audio data directly.
|
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
|
\note The pointer will become invalid after the stream is stopped or
|
||||||
QAudio::IdleState, error() is set to QAudio::NoError
|
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.
|
and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
If a problem occurs during this process the error() is set to QAudio::OpenError,
|
If a problem occurs during this process, error() returns QAudio::OpenError,
|
||||||
state() is set to QAudio::StoppedState and stateChanged() signal is emitted.
|
state() returns QAudio::StoppedState and the stateChanged() signal is emitted.
|
||||||
|
|
||||||
\sa QIODevice
|
\sa QIODevice
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user