phonon/abstractmediastream.h Source File

abstractmediastream.h
Go to the documentation of this file.
1 /* This file is part of the KDE project
2  Copyright (C) 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_ABSTRACTMEDIASTREAM_H
24 #define PHONON_ABSTRACTMEDIASTREAM_H
25 
26 #include "phonon_export.h"
27 #include "phononnamespace.h"
28 #include <QtCore/QObject>
29 
32 
33 class QByteArray;
34 
35 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
36 
37 namespace Phonon
38 {
39 class MediaObject;
40 class AbstractMediaStreamPrivate;
41 
104 {
105  Q_OBJECT
106  Q_DECLARE_PRIVATE(AbstractMediaStream)
107  friend class MediaObject;
108  friend class MediaObjectPrivate;
109  friend class StreamInterface;
110  public:
111  virtual ~AbstractMediaStream();
112 
113  protected:
117  explicit AbstractMediaStream(QObject *parent = 0);
118 
126  qint64 streamSize() const;
127 
138  void setStreamSize(qint64);
139 
145  bool streamSeekable() const;
146 
154  void setStreamSeekable(bool);
155 
161  void writeData(const QByteArray &data);
162 
168  void endOfData();
169 
177  void error(Phonon::ErrorType errorType, const QString &errorString);
178 
189  virtual void reset() = 0;
190 
197  virtual void needData() = 0;
198 
204  virtual void enoughData();
205 
214  virtual void seekStream(qint64 offset);
215 
216  AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject *parent);
217  QScopedPointer<AbstractMediaStreamPrivate> d_ptr;
218 };
219 
220 } // namespace Phonon
221 
222 #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
223 
226 
227 #endif // PHONON_ABSTRACTMEDIASTREAM_H
Base class for custom media data streams.
#define QT_END_NAMESPACE
Definition: qglobal.h:128
GLintptr offset
Definition: GLee.h:1562
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
Backend interface to handle media streams (AbstractMediaStream).
long long qint64
Definition: qglobal.h:947
Interface for media playback of a given URL.
Definition: mediaobject.h:84
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: GLee.h:880
#define Q_OBJECT
Definition: qobjectdefs.h:157
ErrorType
Tells your program how to recover from an error.
The KDE Multimedia classes.
GLboolean reset
Definition: GLee.h:895
#define PHONON_EXPORT
Definition: phonon_export.h:38
#define QT_END_HEADER
Definition: qglobal.h:142