qtmobility/src/multimedia/audio/qaudiosystem.cpp
changeset 14 6fbed849b4f4
child 15 1f895d8a5b2b
equal deleted inserted replaced
11:06b8e2af4411 14:6fbed849b4f4
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #include "qaudiosystem.h"
       
    43 
       
    44 QT_BEGIN_NAMESPACE
       
    45 
       
    46 /*!
       
    47     \class QAbstractAudioDeviceInfo
       
    48     \brief The QAbstractAudioDeviceInfo class is a base class for audio backends.
       
    49 
       
    50     \ingroup multimedia
       
    51     \inmodule QtMultimedia
       
    52     \internal
       
    53 
       
    54     This class implements the audio functionality for
       
    55     QAudioDeviceInfo, i.e., QAudioDeviceInfo keeps a
       
    56     QAbstractAudioDeviceInfo and routes function calls to it. For a
       
    57     description of the functionality that QAbstractAudioDeviceInfo
       
    58     implements, you can read the class and functions documentation of
       
    59     QAudioDeviceInfo.
       
    60 
       
    61     \sa QAudioDeviceInfo
       
    62     \sa QAbstractAudioOutput, QAbstractAudioInput
       
    63 */
       
    64 
       
    65 /*!
       
    66     \fn virtual QAudioFormat QAbstractAudioDeviceInfo::preferredFormat() const
       
    67     Returns the recommended settings to use.
       
    68 */
       
    69 
       
    70 /*!
       
    71     \fn virtual bool QAbstractAudioDeviceInfo::isFormatSupported(const QAudioFormat& format) const
       
    72     Returns true if \a format is available from audio device.
       
    73 */
       
    74 
       
    75 /*!
       
    76     \fn virtual QString QAbstractAudioDeviceInfo::deviceName() const
       
    77     Returns the audio device name.
       
    78 */
       
    79 
       
    80 /*!
       
    81     \fn virtual QStringList QAbstractAudioDeviceInfo::supportedCodecs()
       
    82     Returns the list of currently available codecs.
       
    83 */
       
    84 
       
    85 /*!
       
    86     \fn virtual QList<int> QAbstractAudioDeviceInfo::supportedSampleRates()
       
    87     Returns the list of currently available sample rates.
       
    88 */
       
    89 
       
    90 /*!
       
    91     \fn virtual QList<int> QAbstractAudioDeviceInfo::supportedChannelCounts()
       
    92     Returns the list of currently available channels.
       
    93 */
       
    94 
       
    95 /*!
       
    96     \fn virtual QList<int> QAbstractAudioDeviceInfo::supportedSampleSizes()
       
    97     Returns the list of currently available sample sizes.
       
    98 */
       
    99 
       
   100 /*!
       
   101     \fn virtual QList<QAudioFormat::Endian> QAbstractAudioDeviceInfo::supportedByteOrders()
       
   102     Returns the list of currently available byte orders.
       
   103 */
       
   104 
       
   105 /*!
       
   106     \fn virtual QList<QAudioFormat::SampleType> QAbstractAudioDeviceInfo::supportedSampleTypes()
       
   107     Returns the list of currently available sample types.
       
   108 */
       
   109 
       
   110 /*!
       
   111     \class QAbstractAudioOutput
       
   112     \brief The QAbstractAudioOutput class is a base class for audio backends.
       
   113 
       
   114     \ingroup multimedia
       
   115     \inmodule QtMultimedia
       
   116     \internal
       
   117 
       
   118     QAbstractAudioOutput implements audio functionality for
       
   119     QAudioOutput, i.e., QAudioOutput routes function calls to
       
   120     QAbstractAudioOutput. For a description of the functionality that
       
   121     is implemented, see the QAudioOutput class and function
       
   122     descriptions.
       
   123 
       
   124     \sa QAudioOutput
       
   125 */
       
   126 
       
   127 /*!
       
   128     \fn virtual void QAbstractAudioOutput::start(QIODevice* device)
       
   129     Uses the \a device as the QIODevice to transfer data.
       
   130 */
       
   131 
       
   132 /*!
       
   133     \fn virtual QIODevice* QAbstractAudioOutput::start()
       
   134     Returns a pointer to the QIODevice being used to handle
       
   135     the data transfer. This QIODevice can be used to write() audio data directly.
       
   136 */
       
   137 
       
   138 /*!
       
   139     \fn virtual void QAbstractAudioOutput::stop()
       
   140     Stops the audio output.
       
   141 */
       
   142 
       
   143 /*!
       
   144     \fn virtual void QAbstractAudioOutput::reset()
       
   145     Drops all audio data in the buffers, resets buffers to zero.
       
   146 */
       
   147 
       
   148 /*!
       
   149     \fn virtual void QAbstractAudioOutput::suspend()
       
   150     Stops processing audio data, preserving buffered audio data.
       
   151 */
       
   152 
       
   153 /*!
       
   154     \fn virtual void QAbstractAudioOutput::resume()
       
   155     Resumes processing audio data after a suspend()
       
   156 */
       
   157 
       
   158 /*!
       
   159     \fn virtual int QAbstractAudioOutput::bytesFree() const
       
   160     Returns the free space available in bytes in the audio buffer.
       
   161 */
       
   162 
       
   163 /*!
       
   164     \fn virtual int QAbstractAudioOutput::periodSize() const
       
   165     Returns the period size in bytes.
       
   166 */
       
   167 
       
   168 /*!
       
   169     \fn virtual void QAbstractAudioOutput::setBufferSize(int value)
       
   170     Sets the audio buffer size to \a value in bytes.
       
   171 */
       
   172 
       
   173 /*!
       
   174     \fn virtual int QAbstractAudioOutput::bufferSize() const
       
   175     Returns the audio buffer size in bytes.
       
   176 */
       
   177 
       
   178 /*!
       
   179     \fn virtual void QAbstractAudioOutput::setNotifyInterval(int ms)
       
   180     Sets the interval for notify() signal to be emitted. This is based on the \a ms
       
   181     of audio data processed not on actual real-time. The resolution of the timer
       
   182     is platform specific.
       
   183 */
       
   184 
       
   185 /*!
       
   186     \fn virtual int QAbstractAudioOutput::notifyInterval() const
       
   187     Returns the notify interval in milliseconds.
       
   188 */
       
   189 
       
   190 /*!
       
   191     \fn virtual qint64 QAbstractAudioOutput::processedUSecs() const
       
   192     Returns the amount of audio data processed since start() was called in milliseconds.
       
   193 */
       
   194 
       
   195 /*!
       
   196     \fn virtual qint64 QAbstractAudioOutput::elapsedUSecs() const
       
   197     Returns the milliseconds since start() was called, including time in Idle and suspend states.
       
   198 */
       
   199 
       
   200 /*!
       
   201     \fn virtual QAudio::Error QAbstractAudioOutput::error() const
       
   202     Returns the error state.
       
   203 */
       
   204 
       
   205 /*!
       
   206     \fn virtual QAudio::State QAbstractAudioOutput::state() const
       
   207     Returns the state of audio processing.
       
   208 */
       
   209 
       
   210 /*!
       
   211     \fn virtual void QAbstractAudioOutput::setFormat(const QAudioFormat& fmt)
       
   212     Set the QAudioFormat to use to \a fmt.
       
   213     Setting the format is only allowable while in QAudio::StoppedState.
       
   214 */
       
   215 
       
   216 /*!
       
   217     \fn virtual QAudioFormat QAbstractAudioOutput::format() const
       
   218     Returns the QAudioFormat being used.
       
   219 */
       
   220 
       
   221 /*!
       
   222     \fn QAbstractAudioOutput::errorChanged(QAudio::Error error)
       
   223     This signal is emitted when the \a error state has changed.
       
   224 */
       
   225 
       
   226 /*!
       
   227     \fn QAbstractAudioOutput::stateChanged(QAudio::State state)
       
   228     This signal is emitted when the device \a state has changed.
       
   229 */
       
   230 
       
   231 /*!
       
   232     \fn QAbstractAudioOutput::notify()
       
   233     This signal is emitted when x ms of audio data has been processed
       
   234     the interval set by setNotifyInterval(x).
       
   235 */
       
   236 
       
   237 
       
   238 /*!
       
   239     \class QAbstractAudioInput
       
   240     \brief The QAbstractAudioInput class provides access for QAudioInput to access the audio
       
   241     device provided by the plugin.
       
   242 
       
   243     \ingroup multimedia
       
   244     \inmodule QtMultimedia
       
   245     \internal
       
   246 
       
   247     QAudioDeviceInput keeps an instance of QAbstractAudioInput and
       
   248     routes calls to functions of the same name to QAbstractAudioInput.
       
   249     This means that it is QAbstractAudioInput that implements the
       
   250     audio functionality. For a description of the functionality, see
       
   251     the QAudioInput class description.
       
   252 
       
   253     \sa QAudioInput
       
   254 */
       
   255 
       
   256 /*!
       
   257     \fn virtual void QAbstractAudioInput::start(QIODevice* device)
       
   258     Uses the \a device as the QIODevice to transfer data.
       
   259 */
       
   260 
       
   261 /*!
       
   262     \fn virtual QIODevice* QAbstractAudioInput::start()
       
   263     Returns a pointer to the QIODevice being used to handle
       
   264     the data transfer. This QIODevice can be used to read() audio data directly.
       
   265 */
       
   266 
       
   267 /*!
       
   268     \fn virtual void QAbstractAudioInput::stop()
       
   269     Stops the audio input.
       
   270 */
       
   271 
       
   272 /*!
       
   273     \fn virtual void QAbstractAudioInput::reset()
       
   274     Drops all audio data in the buffers, resets buffers to zero.
       
   275 */
       
   276 
       
   277 /*!
       
   278     \fn virtual void QAbstractAudioInput::suspend()
       
   279     Stops processing audio data, preserving buffered audio data.
       
   280 */
       
   281 
       
   282 /*!
       
   283     \fn virtual void QAbstractAudioInput::resume()
       
   284     Resumes processing audio data after a suspend().
       
   285 */
       
   286 
       
   287 /*!
       
   288     \fn virtual int QAbstractAudioInput::bytesReady() const
       
   289     Returns the amount of audio data available to read in bytes.
       
   290 */
       
   291 
       
   292 /*!
       
   293     \fn virtual int QAbstractAudioInput::periodSize() const
       
   294     Returns the period size in bytes.
       
   295 */
       
   296 
       
   297 /*!
       
   298     \fn virtual void QAbstractAudioInput::setBufferSize(int value)
       
   299     Sets the audio buffer size to \a value in milliseconds.
       
   300 */
       
   301 
       
   302 /*!
       
   303     \fn virtual int QAbstractAudioInput::bufferSize() const
       
   304     Returns the audio buffer size in milliseconds.
       
   305 */
       
   306 
       
   307 /*!
       
   308     \fn virtual void QAbstractAudioInput::setNotifyInterval(int ms)
       
   309     Sets the interval for notify() signal to be emitted. This is based
       
   310     on the \a ms of audio data processed not on actual real-time.
       
   311     The resolution of the timer is platform specific.
       
   312 */
       
   313 
       
   314 /*!
       
   315     \fn virtual int QAbstractAudioInput::notifyInterval() const
       
   316     Returns the notify interval in milliseconds.
       
   317 */
       
   318 
       
   319 /*!
       
   320     \fn virtual qint64 QAbstractAudioInput::processedUSecs() const
       
   321     Returns the amount of audio data processed since start() was called in milliseconds.
       
   322 */
       
   323 
       
   324 /*!
       
   325     \fn virtual qint64 QAbstractAudioInput::elapsedUSecs() const
       
   326     Returns the milliseconds since start() was called, including time in Idle and suspend states.
       
   327 */
       
   328 
       
   329 /*!
       
   330     \fn virtual QAudio::Error QAbstractAudioInput::error() const
       
   331     Returns the error state.
       
   332 */
       
   333 
       
   334 /*!
       
   335     \fn virtual QAudio::State QAbstractAudioInput::state() const
       
   336     Returns the state of audio processing.
       
   337 */
       
   338 
       
   339 /*!
       
   340     \fn virtual void QAbstractAudioInput::setFormat(const QAudioFormat& fmt)
       
   341     Set the QAudioFormat to use to \a fmt.
       
   342     Setting the format is only allowable while in QAudio::StoppedState.
       
   343 */
       
   344 
       
   345 /*!
       
   346     \fn virtual QAudioFormat QAbstractAudioInput::format() const
       
   347     Returns the QAudioFormat being used
       
   348 */
       
   349 
       
   350 /*!
       
   351     \fn QAbstractAudioInput::errorChanged(QAudio::Error error)
       
   352     This signal is emitted when the \a error state has changed.
       
   353 */
       
   354 
       
   355 /*!
       
   356     \fn QAbstractAudioInput::stateChanged(QAudio::State state)
       
   357     This signal is emitted when the device \a state has changed.
       
   358 */
       
   359 
       
   360 /*!
       
   361     \fn QAbstractAudioInput::notify()
       
   362     This signal is emitted when x ms of audio data has been processed
       
   363     the interval set by setNotifyInterval(x).
       
   364 */
       
   365 
       
   366 
       
   367 QT_END_NAMESPACE