src/multimedia/qmediaplayercontrol.h
changeset 0 876b1a06bc25
equal deleted inserted replaced
-1:000000000000 0:876b1a06bc25
       
     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 QMEDIAPLAYERCONTROL_H
       
    43 #define QMEDIAPLAYERCONTROL_H
       
    44 
       
    45 #include "qmediacontrol.h"
       
    46 #include "qmediaplayer.h"
       
    47 #include "qmediatimerange.h"
       
    48 
       
    49 #include <QtCore/qpair.h>
       
    50 
       
    51 QT_BEGIN_NAMESPACE
       
    52 
       
    53 class QMediaPlaylist;
       
    54 
       
    55 class Q_MULTIMEDIA_EXPORT QMediaPlayerControl : public QMediaControl
       
    56 {
       
    57     Q_OBJECT
       
    58 
       
    59 public:
       
    60     ~QMediaPlayerControl();
       
    61 
       
    62     virtual QMediaPlayer::State state() const = 0;
       
    63 
       
    64     virtual QMediaPlayer::MediaStatus mediaStatus() const = 0;
       
    65 
       
    66     virtual qint64 duration() const = 0;
       
    67 
       
    68     virtual qint64 position() const = 0;
       
    69     virtual void setPosition(qint64 position) = 0;
       
    70 
       
    71     virtual int volume() const = 0;
       
    72     virtual void setVolume(int volume) = 0;
       
    73 
       
    74     virtual bool isMuted() const = 0;
       
    75     virtual void setMuted(bool muted) = 0;
       
    76 
       
    77     virtual int bufferStatus() const = 0;
       
    78 
       
    79     virtual bool isAudioAvailable() const = 0;
       
    80     virtual bool isVideoAvailable() const = 0;
       
    81 
       
    82     virtual bool isSeekable() const = 0;
       
    83 
       
    84     virtual QMediaTimeRange availablePlaybackRanges() const = 0;
       
    85 
       
    86     virtual qreal playbackRate() const = 0;
       
    87     virtual void setPlaybackRate(qreal rate) = 0;
       
    88 
       
    89     virtual QMediaContent media() const = 0;
       
    90     virtual const QIODevice *mediaStream() const = 0;
       
    91     virtual void setMedia(const QMediaContent &media, QIODevice *stream) = 0;
       
    92 
       
    93     virtual void play() = 0;
       
    94     virtual void pause() = 0;
       
    95     virtual void stop() = 0;
       
    96 
       
    97 Q_SIGNALS:
       
    98     void mediaChanged(const QMediaContent& content);
       
    99     void durationChanged(qint64 duration);
       
   100     void positionChanged(qint64 position);
       
   101     void stateChanged(QMediaPlayer::State newState);
       
   102     void mediaStatusChanged(QMediaPlayer::MediaStatus status);
       
   103     void volumeChanged(int volume);
       
   104     void mutedChanged(bool muted);
       
   105     void audioAvailableChanged(bool audioAvailable);
       
   106     void videoAvailableChanged(bool videoAvailable);
       
   107     void bufferStatusChanged(int percentFilled);
       
   108     void seekableChanged(bool);
       
   109     void availablePlaybackRangesChanged(const QMediaTimeRange&);
       
   110     void playbackRateChanged(qreal rate);
       
   111     void error(int error, const QString &errorString);
       
   112 
       
   113 protected:
       
   114     QMediaPlayerControl(QObject* parent = 0);
       
   115 };
       
   116 
       
   117 #define QMediaPlayerControl_iid "com.nokia.Qt.QMediaPlayerControl/1.0"
       
   118 Q_MEDIA_DECLARE_CONTROL(QMediaPlayerControl, QMediaPlayerControl_iid)
       
   119 
       
   120 QT_END_NAMESPACE
       
   121 
       
   122 #endif  // QMEDIAPLAYERCONTROL_H
       
   123