Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
streaminterface.h
1 /*
2  Copyright (C) 2007 Matthias Kretz <kretz@kde.org>
3  Copyright (C) 2011 Harald Sitter <sitter@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) version 3, or any
9  later version accepted by the membership of KDE e.V. (or its
10  successor approved by the membership of KDE e.V.), Nokia Corporation
11  (or its successors, if any) and the KDE Free Qt Foundation, which shall
12  act as a proxy defined in Section 6 of version 3 of the license.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public
20  License along with this library. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef PHONON_STREAMINTERFACE_H
24 #define PHONON_STREAMINTERFACE_H
25 
26 #include "phonon_export.h"
27 #include <QtCore/QObject>
28 
29 
30 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
31 
32 namespace Phonon
33 {
34 class StreamInterfacePrivate;
35 class MediaSource;
36 
55 class PHONON_EXPORT StreamInterface
56 {
57  friend class StreamInterfacePrivate;
58  friend class AbstractMediaStreamPrivate;
59  public:
60  virtual ~StreamInterface();
61 
68  virtual void writeData(const QByteArray &data) = 0;
69 
73  virtual void endOfData() = 0;
74 
80  virtual void setStreamSize(qint64 newSize) = 0;
81 
85  virtual void setStreamSeekable(bool s) = 0;
86 
93  void connectToSource(const MediaSource &mediaSource);
94 
105  void needData();
106 
111  void enoughData();
112 
117  void seekStream(qint64 seekTo);
118 
123  void reset();
124 
125  protected:
126  StreamInterface();
127 
128  StreamInterfacePrivate *const d;
129 };
130 } // namespace Phonon
131 
132 Q_DECLARE_INTERFACE(Phonon::StreamInterface, "StreamInterface1.phonon.kde.org")
133 
134 #endif //QT_NO_PHONON_ABSTRACTMEDIASTREAM
135 
136 
137 #endif // PHONON_STREAMINTERFACE_H