Qt 4.8
avmediaobject.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef AV_MEDIAOBJECT_H
43 #define AV_MEDIAOBJECT_H
44 
45 #include <phonon/mediaobjectinterface.h>
46 
47 #include <QtCore/QMultiMap>
48 
49 class AVAudioOutput;
51 
52 using namespace Phonon;
53 
54 class AVMediaObject : public QObject, public Phonon::MediaObjectInterface
55 {
56  Q_OBJECT
57  Q_INTERFACES(Phonon::MediaObjectInterface)
58 
59 public:
60  AVMediaObject(QObject *parent);
61  ~AVMediaObject();
62  void play();
63  void pause();
64  void stop();
65  void seek(qint64 milliseconds);
66  qint32 tickInterval() const;
67  void setTickInterval(qint32 newTickInterval);
68  bool hasVideo() const;
69  bool isSeekable() const;
70  qint64 currentTime() const;
71  Phonon::State state() const;
72  QString errorString() const;
73  Phonon::ErrorType errorType() const;
74  qint64 totalTime() const;
75  Phonon::MediaSource source() const;
76  void setSource(const Phonon::MediaSource &source);
77  void setNextSource(const Phonon::MediaSource &source);
78 
79  qint32 prefinishMark() const;
80  void setPrefinishMark(qint32 newPrefinishMark);
81  qint32 transitionTime() const;
82  void setTransitionTime(qint32);
83 
84 Q_SIGNALS:
85  void stateChanged(Phonon::State newstate, Phonon::State oldstate);
86  void totalTimeChanged(qint64 length);
87  void currentSourceChanged(const MediaSource&);
88  void aboutToFinish();
89  void finished();
90  //TODO
91  void tick(qint64 time);
92 
93 // unused
94  void seekableChanged(bool);
95  void hasVideoChanged(bool);
96  void bufferStatus(int);
97  void prefinishMarkReached(qint32);
98  void metaDataChanged(const QMultiMap<QString, QString> &);
99 
100 public:
101  void setAudioOutput(AVAudioOutput *audioOutput);
102  void handlePlayerFinished();
103 
104 private Q_SLOTS:
105  void setVolume(qreal newVolume);
106 
107 private:
108  void changeState(Phonon::State state);
109  bool checkPlayer() const;
110 
114  mutable Phonon::ErrorType m_errorType;
115  Phonon::MediaSource m_mediaSource;
116 
119 };
120 
122 
123 #endif // PHONON_MEDIAOBJECT_H
The QMultiMap class is a convenience QMap subclass that provides multi-valued maps.
Definition: qcontainerfwd.h:59
AVAudioOutput * m_output
double qreal
Definition: qglobal.h:1193
QString m_errorString
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
int qint32
Definition: qglobal.h:937
Phonon::MediaSource m_mediaSource
qint32 m_tickInterval
AVMediaObjectPrivate * d
#define Q_SLOTS
Definition: qobjectdefs.h:71
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
#define Q_SIGNALS
Definition: qobjectdefs.h:72
Phonon::State m_state
Phonon::ErrorType m_errorType
Q_GUI_EXPORT QString errorString(EGLint code=eglGetError())
Definition: qegl.cpp:743
__int64 qint64
Definition: qglobal.h:942
#define Q_OBJECT
Definition: qobjectdefs.h:157
State
Definition: qaudio.h:59
#define Q_INTERFACES(x)
This macro tells Qt which interfaces the class implements.
Definition: qobjectdefs.h:79
static Qt::KeyboardModifiers oldstate
Definition: qdnd_qws.cpp:87