qtmobility/src/multimedia/audio/qaudiosystem.h
changeset 14 6fbed849b4f4
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 #ifndef QAUDIOSYSTEM_H
       
    43 #define QAUDIOSYSTEM_H
       
    44 
       
    45 #include <qmobilityglobal.h>
       
    46 #include <qtmedianamespace.h>
       
    47 
       
    48 #include "qaudio.h"
       
    49 #include "qaudioformat.h"
       
    50 #include "qaudiodeviceinfo.h"
       
    51 
       
    52 QT_BEGIN_HEADER
       
    53 
       
    54 QT_BEGIN_NAMESPACE
       
    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 QString deviceName() const = 0;
       
    64     virtual QStringList supportedCodecs() = 0;
       
    65     virtual QList<int> supportedSampleRates() = 0;
       
    66     virtual QList<int> supportedChannelCounts() = 0;
       
    67     virtual QList<int> supportedSampleSizes() = 0;
       
    68     virtual QList<QAudioFormat::Endian> supportedByteOrders() = 0;
       
    69     virtual QList<QAudioFormat::SampleType> supportedSampleTypes() = 0;
       
    70 };
       
    71 
       
    72 class Q_MULTIMEDIA_EXPORT QAbstractAudioOutput : public QObject
       
    73 {
       
    74     Q_OBJECT
       
    75 
       
    76 public:
       
    77     virtual void start(QIODevice *device) = 0;
       
    78     virtual QIODevice* start() = 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 processedUSecs() const = 0;
       
    90     virtual qint64 elapsedUSecs() const = 0;
       
    91     virtual QAudio::Error error() const = 0;
       
    92     virtual QAudio::State state() const = 0;
       
    93     virtual void setFormat(const QAudioFormat& fmt) = 0;
       
    94     virtual QAudioFormat format() const = 0;
       
    95 
       
    96 Q_SIGNALS:
       
    97     void errorChanged(QAudio::Error);
       
    98     void stateChanged(QAudio::State);
       
    99     void notify();
       
   100 };
       
   101 
       
   102 class Q_MULTIMEDIA_EXPORT QAbstractAudioInput : public QObject
       
   103 {
       
   104     Q_OBJECT
       
   105 
       
   106 public:
       
   107     virtual void start(QIODevice *device) = 0;
       
   108     virtual QIODevice* start() = 0;
       
   109     virtual void stop() = 0;
       
   110     virtual void reset() = 0;
       
   111     virtual void suspend()  = 0;
       
   112     virtual void resume() = 0;
       
   113     virtual int bytesReady() const = 0;
       
   114     virtual int periodSize() const = 0;
       
   115     virtual void setBufferSize(int value) = 0;
       
   116     virtual int bufferSize() const = 0;
       
   117     virtual void setNotifyInterval(int milliSeconds) = 0;
       
   118     virtual int notifyInterval() const = 0;
       
   119     virtual qint64 processedUSecs() const = 0;
       
   120     virtual qint64 elapsedUSecs() const = 0;
       
   121     virtual QAudio::Error error() const = 0;
       
   122     virtual QAudio::State state() const = 0;
       
   123     virtual void setFormat(const QAudioFormat& fmt) = 0;
       
   124     virtual QAudioFormat format() const = 0;
       
   125 
       
   126 Q_SIGNALS:
       
   127     void errorChanged(QAudio::Error);
       
   128     void stateChanged(QAudio::State);
       
   129     void notify();
       
   130 };
       
   131 
       
   132 QT_END_NAMESPACE
       
   133 
       
   134 QT_END_HEADER
       
   135 
       
   136 #endif // QAUDIOSYSTEM_H