src/multimedia/audio/qaudioengine.h
changeset 0 1918ee327afb
child 3 41300fa6a67c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 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 QtMultimedia module of the Qt Toolkit.
       
     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 #ifndef QAUDIOENGINE_H
       
    43 #define QAUDIOENGINE_H
       
    44 
       
    45 #include <QtCore/qglobal.h>
       
    46 #include <QtMultimedia/qaudio.h>
       
    47 #include <QtMultimedia/qaudioformat.h>
       
    48 #include <QtMultimedia/qaudiodeviceinfo.h>
       
    49 
       
    50 QT_BEGIN_HEADER
       
    51 
       
    52 QT_BEGIN_NAMESPACE
       
    53 
       
    54 QT_MODULE(Multimedia)
       
    55 
       
    56 class Q_MULTIMEDIA_EXPORT QAbstractAudioDeviceInfo : public QObject
       
    57 {
       
    58     Q_OBJECT
       
    59 
       
    60 public:
       
    61     virtual QAudioFormat preferredFormat() const = 0;
       
    62     virtual bool isFormatSupported(const QAudioFormat &format) const = 0;
       
    63     virtual QAudioFormat nearestFormat(const QAudioFormat &format) const = 0;
       
    64     virtual QString deviceName() const = 0;
       
    65     virtual QStringList codecList() = 0;
       
    66     virtual QList<int> frequencyList() = 0;
       
    67     virtual QList<int> channelsList() = 0;
       
    68     virtual QList<int> sampleSizeList() = 0;
       
    69     virtual QList<QAudioFormat::Endian> byteOrderList() = 0;
       
    70     virtual QList<QAudioFormat::SampleType> sampleTypeList() = 0;
       
    71 };
       
    72 
       
    73 class Q_MULTIMEDIA_EXPORT QAbstractAudioOutput : public QObject
       
    74 {
       
    75     Q_OBJECT
       
    76 
       
    77 public:
       
    78     virtual QIODevice* start(QIODevice* device) = 0;
       
    79     virtual void stop() = 0;
       
    80     virtual void reset() = 0;
       
    81     virtual void suspend() = 0;
       
    82     virtual void resume() = 0;
       
    83     virtual int bytesFree() const = 0;
       
    84     virtual int periodSize() const = 0;
       
    85     virtual void setBufferSize(int value) = 0;
       
    86     virtual int bufferSize() const = 0;
       
    87     virtual void setNotifyInterval(int milliSeconds) = 0;
       
    88     virtual int notifyInterval() const = 0;
       
    89     virtual qint64 totalTime() const = 0;
       
    90     virtual qint64 clock() const = 0;
       
    91     virtual QAudio::Error error() const = 0;
       
    92     virtual QAudio::State state() const = 0;
       
    93     virtual QAudioFormat format() const = 0;
       
    94 
       
    95 Q_SIGNALS:
       
    96     void stateChanged(QAudio::State);
       
    97     void notify();
       
    98 };
       
    99 
       
   100 class Q_MULTIMEDIA_EXPORT QAbstractAudioInput : public QObject
       
   101 {
       
   102     Q_OBJECT
       
   103 
       
   104 public:
       
   105     virtual QIODevice* start(QIODevice* device) = 0;
       
   106     virtual void stop() = 0;
       
   107     virtual void reset() = 0;
       
   108     virtual void suspend()  = 0;
       
   109     virtual void resume() = 0;
       
   110     virtual int bytesReady() const = 0;
       
   111     virtual int periodSize() const = 0;
       
   112     virtual void setBufferSize(int value) = 0;
       
   113     virtual int bufferSize() const = 0;
       
   114     virtual void setNotifyInterval(int milliSeconds) = 0;
       
   115     virtual int notifyInterval() const = 0;
       
   116     virtual qint64 totalTime() const = 0;
       
   117     virtual qint64 clock() const = 0;
       
   118     virtual QAudio::Error error() const = 0;
       
   119     virtual QAudio::State state() const = 0;
       
   120     virtual QAudioFormat format() const = 0;
       
   121 
       
   122 Q_SIGNALS:
       
   123     void stateChanged(QAudio::State);
       
   124     void notify();
       
   125 };
       
   126 
       
   127 QT_END_NAMESPACE
       
   128 
       
   129 QT_END_HEADER
       
   130 
       
   131 #endif // QAUDIOENGINE_H