Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
mediasource.h
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 
29 #include "mrl.h"
30 #include "objectdescription.h"
31 
32 #include <QtCore/QSharedData>
33 #include <QtCore/QString>
34 
35 
36 class QUrl;
37 class QIODevice;
38 
39 namespace Phonon
40 {
41 
42 class MediaSourcePrivate;
43 class AbstractMediaStream;
44 
62 class PHONON_EXPORT MediaSource
63 {
64  friend class StreamInterface;
65  friend QDebug operator <<(QDebug dbg, const Phonon::MediaSource &);
66  public:
72  enum Type {
76  Invalid = -1,
85  Url,
118  AudioVideoCapture
119 /* post 4.0:
120  / **
121  * Links multiple MediaSource objects together.
122  * /
123  Link
124 */
125  };
126 
135  MediaSource();
136 
144  PHONON_DEPRECATED MediaSource(const QString &fileName); //krazy:exclude=explicit
145 
153  MediaSource(const QUrl &url); //krazy:exclude=explicit
154 
163  MediaSource(DiscType discType, const QString &deviceName = QString()); //krazy:exclude=explicit
164 
165 #ifndef PHONON_NO_AUDIOCAPTURE
166 
170  MediaSource(const AudioCaptureDevice& device);
171 #endif
172 
173 #ifndef PHONON_NO_VIDEOCAPTURE
174 
178  MediaSource(const VideoCaptureDevice& device);
179 #endif
180 
181 #if !defined(PHONON_NO_VIDEOCAPTURE) && !defined(PHONON_NO_AUDIOCAPTURE)
182 
186  MediaSource(Capture::DeviceType deviceType, CaptureCategory category = NoCaptureCategory);
187 
198  MediaSource(CaptureCategory category);
199 #endif
200 
201 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
202 
212  MediaSource(AbstractMediaStream *stream); //krazy:exclude=explicit
213 
225  MediaSource(QIODevice *ioDevice); //krazy:exclude=explicit
226 #endif
227 
231  ~MediaSource();
232 
238  MediaSource(const MediaSource &rhs);
239 
245  MediaSource &operator=(const MediaSource &rhs);
246 
250  bool operator==(const MediaSource &rhs) const;
251 
263  void setAutoDelete(bool enable);
264 
270  bool autoDelete() const;
271 
277  Type type() const;
278 
283  QString fileName() const;
284 
296  Mrl mrl() const;
297 
302  QUrl url() const;
303 
308  DiscType discType() const;
309 
314  const DeviceAccessList& deviceAccessList() const;
315 
321  const DeviceAccessList& videoDeviceAccessList() const;
322 
328  const DeviceAccessList& audioDeviceAccessList() const;
329 
334  QString deviceName() const;
335 
336 #ifndef QT_NO_PHONON_ABSTRACTMEDIASTREAM
337 
341  AbstractMediaStream *stream() const;
342 #endif
343 
344 #ifndef PHONON_NO_AUDIOCAPTURE
345 
348  AudioCaptureDevice audioCaptureDevice() const;
349 #endif
350 
351 #ifndef PHONON_NO_VIDEOCAPTURE
352 
355  VideoCaptureDevice videoCaptureDevice() const;
356 #endif
357 
358 /* post 4.0:
359  MediaSource(const QList<MediaSource> &mediaList);
360  QList<MediaSource> substreams() const;
361 */
362 
363  protected:
364  QExplicitlySharedDataPointer<MediaSourcePrivate> d;
365  MediaSource(MediaSourcePrivate &);
366 
367  PHONON_DEPRECATED MediaSource(const DeviceAccess &access);
368 };
369 
370 PHONON_EXPORT QDebug operator <<(QDebug dbg, const Phonon::MediaSource &);
371 
372 } // namespace Phonon
373 
374 
375 #endif // PHONON_MEDIASOURCE_H