phonon/mediaobjectinterface.h Source File

mediaobjectinterface.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 2006-2007 Matthias Kretz <kretz@kde.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), Nokia Corporation
10  (or its successors, if any) and the KDE Free Qt Foundation, which shall
11  act as a proxy defined in Section 6 of version 3 of the license.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #ifndef PHONON_MEDIAOBJECTINTERFACE_H
24 #define PHONON_MEDIAOBJECTINTERFACE_H
25 
26 #include "mediaobject.h"
27 #include <QtCore/QObject>
28 
31 
32 namespace Phonon
33 {
34 class StreamInterface;
35 
68 {
69  public:
70  virtual ~MediaObjectInterface() {}
71 
81  virtual void play() = 0;
82 
91  virtual void pause() = 0;
92 
104  virtual void stop() = 0;
105 
121  virtual void seek(qint64 milliseconds) = 0;
122 
129  virtual qint32 tickInterval() const = 0;
139  virtual void setTickInterval(qint32 interval) = 0;
140 
146  virtual bool hasVideo() const = 0;
152  virtual bool isSeekable() const = 0;
156  virtual qint64 currentTime() const = 0;
160  virtual Phonon::State state() const = 0;
161 
165  virtual QString errorString() const = 0;
166 
172  virtual Phonon::ErrorType errorType() const = 0;
173 
181  virtual qint64 totalTime() const = 0;
182 
186  virtual MediaSource source() const = 0;
187 
208  virtual void setSource(const MediaSource &) = 0;
209 
225  virtual void setNextSource(const MediaSource &source) = 0;
226 
227  virtual qint64 remainingTime() const { return totalTime() - currentTime(); }
228  virtual qint32 prefinishMark() const = 0;
229  virtual void setPrefinishMark(qint32) = 0;
230 
231  virtual qint32 transitionTime() const = 0;
232  virtual void setTransitionTime(qint32) = 0;
233 };
234 }
235 
236 Q_DECLARE_INTERFACE(Phonon::MediaObjectInterface, "MediaObjectInterface3.phonon.kde.org")
237 
240 
241 #endif // PHONON_MEDIAOBJECTINTERFACE_H
242 // vim: sw=4 ts=4 tw=80
virtual Phonon::State state() const =0
Get the current state.
GLsizei GLsizei GLchar * source
Definition: GLee.h:1721
#define QT_END_NAMESPACE
Definition: qglobal.h:128
int qint32
Definition: qglobal.h:937
virtual bool isSeekable() const =0
If the current media may be seeked returns true.
Backend interface for media sources.
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
State
The state the media producing object is in at the moment.
virtual qint64 currentTime() const =0
Get the current time (in milliseconds) of the file currently being played.
long long qint64
Definition: qglobal.h:947
virtual QString errorString() const =0
A translated string describing the error.
virtual qint32 prefinishMark() const =0
virtual void setNextSource(const MediaSource &source)=0
Sets the next source to be used for transitions.
Note that all constructors of this class are implicit, so that you can simply write.
Definition: mediasource.h:61
virtual void stop()=0
Requests the playback to be stopped.
virtual void setSource(const MediaSource &)=0
Sets the current source.
virtual bool hasVideo() const =0
Check whether the media data includes a video stream.
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
virtual void play()=0
Requests the playback to start.
QT_BEGIN_NAMESPACE Q_DECLARE_INTERFACE(QWebKitPlatformPlugin,"com.nokia.Qt.WebKit.PlatformPlugin/1.7")
virtual qint32 tickInterval() const =0
Return the time interval in milliseconds between two ticks.
virtual void setPrefinishMark(qint32)=0
ErrorType
Tells your program how to recover from an error.
virtual Phonon::ErrorType errorType() const =0
Tells your program what to do about the error.
The KDE Multimedia classes.
virtual void pause()=0
Requests the playback to pause.
virtual qint64 totalTime() const =0
Returns the total time of the media in milliseconds.
virtual qint32 transitionTime() const =0
virtual void seek(qint64 milliseconds)=0
Requests the playback to be seeked to the given time.
virtual void setTickInterval(qint32 interval)=0
Change the interval the tick signal is emitted.
#define QT_END_HEADER
Definition: qglobal.h:142
virtual void setTransitionTime(qint32)=0
virtual qint64 remainingTime() const
virtual MediaSource source() const =0
Returns the current source.