qtmobility/plugins/multimedia/symbian/openmaxal/mediarecorder/qxarecordsession.h
changeset 4 90517678cc4f
child 5 453da2cfceef
equal deleted inserted replaced
1:2b40d63a9c3d 4:90517678cc4f
       
     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 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 QXARECORDSESSION_H
       
    43 #define QXARECORDSESSION_H
       
    44 
       
    45 #include <QObject>
       
    46 #include <QUrl>
       
    47 #include "qmediarecorder.h"
       
    48 #include "xarecordsessioncommon.h"
       
    49 
       
    50 QTM_USE_NAMESPACE
       
    51 
       
    52 class XARecordSessionImpl;
       
    53 
       
    54 /*
       
    55  * This is a backend class for all QXXXControl objects.
       
    56  * This class contains actual implementation of recording functionality
       
    57  * from the control object's perspective.
       
    58  */
       
    59 
       
    60 
       
    61 class QXARecordSession : public QObject,
       
    62                          public XARecordObserver
       
    63 {
       
    64 Q_OBJECT
       
    65 
       
    66 public:
       
    67     QXARecordSession(QObject *parent);
       
    68     virtual ~QXARecordSession();
       
    69 
       
    70     /* For QMediaRecorderControl begin */
       
    71     QUrl outputLocation();
       
    72     bool setOutputLocation(const QUrl &location);
       
    73     QMediaRecorder::State state();
       
    74     qint64 duration();
       
    75     void applySettings();
       
    76 
       
    77     void record();
       
    78     void pause();
       
    79     void stop();
       
    80 
       
    81     void cbDurationChanged(TInt64 new_pos);
       
    82     void cbAvailableAudioInputsChanged();
       
    83     void cbRecordingStarted();
       
    84     void cbRecordingStopped();
       
    85     /* For QMediaRecorderControl end */
       
    86 
       
    87     /* For QAudioEndpointSelector begin */
       
    88     QList<QString> availableEndpoints();
       
    89     QString endpointDescription(const QString &name);
       
    90     QString defaultEndpoint();
       
    91     QString activeEndpoint();
       
    92     void setActiveEndpoint(const QString &name);
       
    93     /* For QAudioEndpointSelector end */
       
    94 
       
    95     /* For QAudioEncoderControl begin */
       
    96     QStringList supportedAudioCodecs();
       
    97     QString codecDescription(const QString &codecName);
       
    98     QList<int> supportedSampleRates(
       
    99                 const QAudioEncoderSettings &settings,
       
   100                 bool *continuous);
       
   101     QAudioEncoderSettings audioSettings();
       
   102     void setAudioSettings(const QAudioEncoderSettings &settings);
       
   103     QStringList supportedEncodingOptions(const QString &codec);
       
   104     QVariant encodingOption(const QString &codec, const QString &name);
       
   105     void setEncodingOption(const QString &codec, const QString &name, const QVariant &value);
       
   106     /* For QAudioEncoderControl end */
       
   107 
       
   108     /* For QMediaContainerControl begin */
       
   109     QStringList supportedContainers();
       
   110     QString containerMimeType();
       
   111     void setContainerMimeType(const QString &formatMimeType);
       
   112     QString containerDescription(const QString &formatMimeType);
       
   113     /* For QMediaContainerControl end */
       
   114 
       
   115 Q_SIGNALS:
       
   116     void stateChanged(QMediaRecorder::State state);
       
   117     void durationChanged(qint64 duration);
       
   118     void error(int error, const QString &errorString);
       
   119     void activeEndpointChanged(const QString& name);
       
   120     void availableAudioInputsChanged();
       
   121 
       
   122 private:
       
   123     void setRecorderState(QMediaRecorder::State state);
       
   124     void initCodecsList();
       
   125     void initContainersList();
       
   126     bool setEncoderSettingsToImpl();
       
   127 
       
   128 private:
       
   129     /* Own */
       
   130     XARecordSessionImpl *m_impl;
       
   131     QUrl m_outputLocation;
       
   132     QMediaRecorder::State m_state;
       
   133     QStringList m_codecs;
       
   134     QAudioEncoderSettings m_audioencodersettings;
       
   135     QAudioEncoderSettings m_appliedaudioencodersettings;
       
   136     QStringList m_containers;
       
   137     QStringList m_containersDesc;
       
   138     QString m_containerMimeType;
       
   139 };
       
   140 
       
   141 #endif /* QXARECORDSESSION_H */