diff options
author | Geir Vattekar <geir.vattekar@trolltech.com> | 2009-09-15 11:01:45 (GMT) |
---|---|---|
committer | Geir Vattekar <geir.vattekar@trolltech.com> | 2009-09-15 11:03:34 (GMT) |
commit | cd5f0f868bc830c6b350e8263fd53597f52e1146 (patch) | |
tree | 1306128003e1ca96546515c96ea6802ff4c56fe8 /src/multimedia/audio | |
parent | 2b21c3f4022c64ee6f0178b1866f22639c377ae6 (diff) | |
download | Qt-cd5f0f868bc830c6b350e8263fd53597f52e1146.zip Qt-cd5f0f868bc830c6b350e8263fd53597f52e1146.tar.gz Qt-cd5f0f868bc830c6b350e8263fd53597f52e1146.tar.bz2 |
Doc: Added some snippets to the multimedia audio docs.
Diffstat (limited to 'src/multimedia/audio')
-rw-r--r-- | src/multimedia/audio/qaudiodeviceinfo.cpp | 6 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioformat.cpp | 3 | ||||
-rw-r--r-- | src/multimedia/audio/qaudioinput.cpp | 7 | ||||
-rw-r--r-- | src/multimedia/audio/qaudiooutput.cpp | 7 |
4 files changed, 18 insertions, 5 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo.cpp b/src/multimedia/audio/qaudiodeviceinfo.cpp index e349733..e38a91e 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.cpp +++ b/src/multimedia/audio/qaudiodeviceinfo.cpp @@ -71,7 +71,11 @@ QT_BEGIN_NAMESPACE audio plugins installed and the audio device capabilities. If you need a specific format, you can check if the device supports it with isFormatSupported(), or fetch a supported format that is as close as possible to the format with - nearestFormat(). + nearestFormat(). For instance: + + \snippet doc/src/snippets/audio/main.cpp 1 + \dots 8 + \snippet doc/src/snippets/audio/main.cpp 2 A QAudioDeviceInfo is constructed with a QAudioDeviceId, which is an identifier for a physical device. It is used by Qt to construct diff --git a/src/multimedia/audio/qaudioformat.cpp b/src/multimedia/audio/qaudioformat.cpp index ddfcc2c..c23e454 100644 --- a/src/multimedia/audio/qaudioformat.cpp +++ b/src/multimedia/audio/qaudioformat.cpp @@ -134,7 +134,8 @@ public: through functions in QAudioDeviceInfo. This class also lets you query available parameter values for a device, so that you can set the parameters yourself. See the QAudioDeviceInfo class - description for details. + description for details. You need to know the format of the audio + streams you wish to play. Qt does not set up formats for you. */ /*! diff --git a/src/multimedia/audio/qaudioinput.cpp b/src/multimedia/audio/qaudioinput.cpp index edf6dd6..3c0d98e 100644 --- a/src/multimedia/audio/qaudioinput.cpp +++ b/src/multimedia/audio/qaudioinput.cpp @@ -128,7 +128,12 @@ QT_BEGIN_NAMESPACE which states the QAudioInput has been in. If an error should occur, you can fetch its reason with error(). - The possible error reasons are described by the QAudio::Error enum. + The possible error reasons are described by the QAudio::Error + enum. The QAudioInput will enter the \l{QAudio::}{StopState} when + an error is encountered. Connect to the stateChanged() signal to + handle the error: + + \snippet doc/src/snippets/audio/main.cpp 0 \sa QAudioOutput, QAudioDeviceInfo */ diff --git a/src/multimedia/audio/qaudiooutput.cpp b/src/multimedia/audio/qaudiooutput.cpp index 556b616..8a8edb4 100644 --- a/src/multimedia/audio/qaudiooutput.cpp +++ b/src/multimedia/audio/qaudiooutput.cpp @@ -129,9 +129,12 @@ QT_BEGIN_NAMESPACE If an error occurs, you can fetch the \l{QAudio::Error}{error type} with the error() function. Please see the QAudio::Error enum - for a description of the possible errors that are reported. + for a description of the possible errors that are reported. When + an error is encountered, the state changes to QAudio::StopState. + You can check for errors by connecting to the stateChanged() + signal: - If an error is encountered state changes to QAudio::StopState. + \snippet doc/src/snippets/audio/main.cpp 3 \sa QAudioInput, QAudioDeviceInfo */ |