phonon/mediasource.h Source File

mediasource.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_MEDIASOURCE_H
24 #define PHONON_MEDIASOURCE_H
25 
26 #include "phonon_export.h"
27 #include "phononnamespace.h"
28 #include "objectdescription.h"
29 #include <QtCore/QSharedData>
30 #include <QtCore/QString>
31 
34 
35 class QUrl;
36 class QIODevice;
37 
38 namespace Phonon
39 {
40 
41 class MediaSourcePrivate;
42 class AbstractMediaStream;
43 
62 {
63  friend class StreamInterface;
64  public:
70  enum Type {
74  Invalid = -1,
83  Url,
103  Empty
104 /* post 4.0:
105  / **
106  * Links multiple MediaSource objects together.
107  * /
108  Link
109 */
110  };
111 
120  MediaSource();
121 
127  MediaSource(const QString &fileName); //krazy:exclude=explicit
128 
134  MediaSource(const QUrl &url); //krazy:exclude=explicit
135 
144  MediaSource(Phonon::DiscType discType, const QString &deviceName = QString()); //krazy:exclude=explicit
145 
146 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
147 
157  MediaSource(AbstractMediaStream *stream); //krazy:exclude=explicit
158 
170  MediaSource(QIODevice *ioDevice); //krazy:exclude=explicit
171 #endif
172 
176  //MediaSource(const AudioCaptureDevice &, const VideoCaptureDevice &);
177 
181  ~MediaSource();
182 
188  MediaSource(const MediaSource &rhs);
189 
195  MediaSource &operator=(const MediaSource &rhs);
196 
200  bool operator==(const MediaSource &rhs) const;
201 
213  void setAutoDelete(bool enable);
214 
220  bool autoDelete() const;
221 
227  Type type() const;
228 
233  QString fileName() const;
234 
239  QUrl url() const;
240 
245  Phonon::DiscType discType() const;
246 
251  QString deviceName() const;
252 
253 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
254 
258  AbstractMediaStream *stream() const;
259 #endif
260 
261  //AudioCaptureDevice audioCaptureDevice() const;
262  //VideoCaptureDevice videoCaptureDevice() const;
263 
264 /* post 4.0:
265  MediaSource(const QList<MediaSource> &mediaList);
266  QList<MediaSource> substreams() const;
267 */
268 
269  protected:
271  MediaSource(MediaSourcePrivate &);
272 };
273 
274 } // namespace Phonon
275 
278 
279 #endif // PHONON_MEDIASOURCE_H
GLuint GLuint GLsizei GLenum type
Definition: GLee.h:872
Base class for custom media data streams.
#define QT_END_NAMESPACE
Definition: qglobal.h:128
The MediaSource object describes a local file.
Definition: mediasource.h:78
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
DiscType
Enum to identify the media discs supported by MediaObject.
Backend interface to handle media streams (AbstractMediaStream).
Type
Identifies the type of media described by the MediaSource object.
Definition: mediasource.h:70
The MediaSource object describes a URL, which can be both a local file and a file on the network...
Definition: mediasource.h:83
Note that all constructors of this class are implicit, so that you can simply write.
Definition: mediasource.h:61
bool operator==(const Attribute &cA, const AttributeInstance< type > &cB)
This operator compares the two attributes and NOT their values.
Definition: node.h:577
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
The MediaSource object describes a data stream.
Definition: mediasource.h:95
Definition: qurl.h:61
The KDE Multimedia classes.
The MediaSource object describes a disc.
Definition: mediasource.h:87
QExplicitlySharedDataPointer< MediaSourcePrivate > d
Definition: mediasource.h:270
#define PHONON_EXPORT
Definition: phonon_export.h:38
#define QT_END_HEADER
Definition: qglobal.h:142