abstractmediastream.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Lesser General Public
00006     License as published by the Free Software Foundation; either
00007     version 2.1 of the License, or (at your option) version 3, or any
00008     later version accepted by the membership of KDE e.V. (or its
00009     successor approved by the membership of KDE e.V.), Nokia Corporation 
00010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
00011     act as a proxy defined in Section 6 of version 3 of the license.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public 
00019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
00020 
00021 */
00022 
00023 #ifndef PHONON_ABSTRACTMEDIASTREAM_H
00024 #define PHONON_ABSTRACTMEDIASTREAM_H
00025 
00026 #include "phonon_export.h"
00027 #include "phononnamespace.h"
00028 #include <QtCore/QObject>
00029 
00030 QT_BEGIN_HEADER
00031 QT_BEGIN_NAMESPACE
00032 
00033 class QByteArray;
00034 
00035 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
00036 
00037 namespace Phonon
00038 {
00039 class MediaObject;
00040 class AbstractMediaStreamPrivate;
00041 
00103 class PHONON_EXPORT AbstractMediaStream : public QObject
00104 {
00105     Q_OBJECT
00106     Q_DECLARE_PRIVATE(AbstractMediaStream)
00107     friend class MediaObject;
00108     friend class MediaObjectPrivate;
00109     friend class StreamInterface;
00110     public:
00111         virtual ~AbstractMediaStream();
00112 
00113     protected:
00117         explicit AbstractMediaStream(QObject *parent = 0);
00118 
00126         qint64 streamSize() const;
00127 
00138         void setStreamSize(qint64);
00139 
00145         bool streamSeekable() const;
00146 
00154         void setStreamSeekable(bool);
00155 
00161         void writeData(const QByteArray &data);
00162 
00168         void endOfData();
00169 
00177         void error(Phonon::ErrorType errorType, const QString &errorString);
00178 
00189         virtual void reset() = 0;
00190 
00197         virtual void needData() = 0;
00198 
00204         virtual void enoughData();
00205 
00214         virtual void seekStream(qint64 offset);
00215 
00216         AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject *parent);
00217         QScopedPointer<AbstractMediaStreamPrivate> d_ptr;
00218 };
00219 
00220 } // namespace Phonon
00221 
00222 #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
00223 
00224 QT_END_NAMESPACE
00225 QT_END_HEADER
00226 
00227 #endif // PHONON_ABSTRACTMEDIASTREAM_H