Index: trunk/src/multimedia/audio/qaudiooutput.cpp
===================================================================
--- trunk/src/multimedia/audio/qaudiooutput.cpp	(revision 651)
+++ trunk/src/multimedia/audio/qaudiooutput.cpp	(revision 769)
@@ -203,4 +203,15 @@
     All that is required is to open the QIODevice.
 
+    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
+    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.
+
+    In either case, the stateChanged() signal may be emitted either synchronously
+    during execution of the start() function or asynchronously after start() has
+    returned to the caller.
+
     \sa QIODevice
 */
@@ -208,11 +219,4 @@
 void QAudioOutput::start(QIODevice* device)
 {
-    /*
-    -If currently not StoppedState, stop.
-    -If previous start was push mode, delete internal QIODevice.
-    -open audio output.
-    -If ok, NoError and ActiveState, else OpenError and StoppedState
-    -emit stateChanged()
-    */
     d->start(device);
 }
@@ -222,4 +226,15 @@
     transfer. This QIODevice can be used to write() audio data directly.
 
+    If able to access the systems audio device the state() is set to
+    QAudio::IdleState, error() is set to 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.
+
+    In either case, the stateChanged() signal may be emitted either synchronously
+    during execution of the start() function or asynchronously after start() has
+    returned to the caller.
+
     \sa QIODevice
 */
@@ -227,27 +242,16 @@
 QIODevice* QAudioOutput::start()
 {
-    /*
-    -If currently not StoppedState, stop.
-    -If no internal QIODevice, create one.
-    -open audio output.
-    -If ok, NoError and IdleState, else OpenError and StoppedState
-    -emit stateChanged()
-    -return internal QIODevice
-    */
     return d->start(0);
 }
 
 /*!
-    Stops the audio output.
+    Stops the audio output, detaching from the system resource.
+
+    Sets error() to QAudio::NoError, state() to QAudio::StoppedState and
+    emit stateChanged() signal.
 */
 
 void QAudioOutput::stop()
 {
-    /*
-    -If StoppedState, return
-    -set to StoppedState
-    -detach from audio device
-    -emit stateChanged()
-    */
     d->stop();
 }
@@ -259,8 +263,4 @@
 void QAudioOutput::reset()
 {
-    /*
-    -drop all buffered audio, set buffers to zero.
-    -call stop()
-    */
     d->reset();
 }
@@ -268,14 +268,11 @@
 /*!
     Stops processing audio data, preserving buffered audio data.
+
+    Sets error() to QAudio::NoError, state() to QAudio::SuspendedState and
+    emit stateChanged() signal.
 */
 
 void QAudioOutput::suspend()
 {
-    /*
-    -If not ActiveState|IdleState, return
-    -stop processing audio, saving all buffered audio data
-    -set NoError and SuspendedState
-    -emit stateChanged()
-    */
     d->suspend();
 }
@@ -283,16 +280,15 @@
 /*!
     Resumes processing audio data after a suspend().
+
+    Sets error() to QAudio::NoError.
+    Sets state() to QAudio::ActiveState if you previously called start(QIODevice*).
+    Sets state() to QAudio::IdleState if you previously called start().
+    emits stateChanged() signal.
+
+    Note: signal will always be emitted during execution of the resume() function.
 */
 
 void QAudioOutput::resume()
 {
-    /*
-    -If SuspendedState, return
-    -resume audio
-    -(PULL MODE): set ActiveState, NoError
-    -(PUSH MODE): set IdleState, NoError
-    -kick start audio if needed
-    -emit stateChanged()
-    */
      d->resume();
 }
@@ -300,12 +296,11 @@
 /*!
     Returns the free space available in bytes in the audio buffer.
+
+    NOTE: returned value is only valid while in QAudio::ActiveState or QAudio::IdleState
+    state, otherwise returns zero.
 */
 
 int QAudioOutput::bytesFree() const
 {
-    /*
-    -If not ActiveState|IdleState, return 0
-    -return space available in audio buffer in bytes
-    */
     return d->bytesFree();
 }
@@ -354,5 +349,8 @@
     Sets the interval for notify() signal to be emitted.
     This is based on the \a ms of audio data processed
-    not on actual real-time. The resolution of the timer is platform specific.
+    not on actual real-time.
+    The minimum resolution of the timer is platform specific and values
+    should be checked with notifyInterval() to confirm actual value
+    being used.
 */
 
@@ -372,6 +370,15 @@
 
 /*!
-    Returns the amount of audio data processed since start()
+    Returns the amount of audio data processed by the class since start()
     was called in microseconds.
+
+    Note: The amount of audio data played can be determined by subtracting
+    the microseconds of audio data still in the systems audio buffer.
+
+    \code
+    qint64 bytesInBuffer = bufferSize() - bytesFree();
+    qint64 usInBuffer = (qint64)(1000000) * bytesInBuffer / ( channels() * sampleSize() / 8 ) / frequency();
+    qint64 usPlayed = processedUSecs() - usInBuffer;
+    \endcode
 */
 
