phonon/mediacontroller.h Source File

mediacontroller.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_MEDIACONTROLLER_H
24 #define PHONON_MEDIACONTROLLER_H
25 
26 #include "phonon_export.h"
27 #include "objectdescription.h"
28 
29 #include <QtCore/QObject>
30 #include <QtCore/QtGlobal>
31 
34 
35 #ifndef QT_NO_PHONON_MEDIACONTROLLER
36 
37 namespace Phonon
38 {
39 class MediaControllerPrivate;
40 class MediaObject;
41 
49 {
50  Q_OBJECT
51  Q_FLAGS(Features)
52  public:
53  enum Feature {
54  Angles = 1,
55  Chapters = 2,
56  Titles = 4
57  };
58  Q_DECLARE_FLAGS(Features, Feature)
59 
61  ~MediaController();
62 
63  Features supportedFeatures() const;
64 
65  int availableAngles() const;
66  int currentAngle() const;
67 
68  int availableChapters() const;
69  int currentChapter() const;
70 
71  int availableTitles() const;
72  int currentTitle() const;
73 
74  bool autoplayTitles() const;
75 
82  AudioChannelDescription currentAudioChannel() const;
83 
90  SubtitleDescription currentSubtitle() const;
91 
99  QList<AudioChannelDescription> availableAudioChannels() const;
100 
108  QList<SubtitleDescription> availableSubtitles() const;
109 
121  void setCurrentAudioChannel(const Phonon::AudioChannelDescription &stream);
122 
134  void setCurrentSubtitle(const Phonon::SubtitleDescription &stream);
135 
136  public Q_SLOTS:
137  void setCurrentAngle(int angleNumber);
138  void setCurrentChapter(int chapterNumber);
139 
146  void setCurrentTitle(int titleNumber);
147  void setAutoplayTitles(bool);
148 
155  void nextTitle();
156 
163  void previousTitle();
164 
165  Q_SIGNALS:
166  void availableSubtitlesChanged();
167  void availableAudioChannelsChanged();
168  void availableAnglesChanged(int availableAngles);
169  void angleChanged(int angleNumber);
170  void availableChaptersChanged(int availableChapters);
171  void chapterChanged(int chapterNumber);
172  void availableTitlesChanged(int availableTitles);
173  void titleChanged(int titleNumber);
174 
175  protected:
176  MediaControllerPrivate *const d;
177 };
178 
179 } // namespace Phonon
180 
181 Q_DECLARE_OPERATORS_FOR_FLAGS(Phonon::MediaController::Features)
182 
183 #endif //QT_NO_PHONON_MEDIACONTROLLER
184 
187 
188 #endif // PHONON_MEDIACONTROLLER_H
#define QT_END_NAMESPACE
Definition: qglobal.h:128
#define QT_BEGIN_HEADER
Definition: qglobal.h:141
#define Q_SLOTS
Definition: qobjectdefs.h:71
#define Q_SIGNALS
Definition: qobjectdefs.h:72
Interface for media playback of a given URL.
Definition: mediaobject.h:84
#define QT_BEGIN_NAMESPACE
Definition: qglobal.h:127
Provides a tuple of enduser visible name and description.
#define Q_OBJECT
Definition: qobjectdefs.h:157
The KDE Multimedia classes.
Controls optional features of a media file/device like title, chapter, angle.
#define Q_FLAGS(x)
Definition: qobjectdefs.h:85
#define PHONON_EXPORT
Definition: phonon_export.h:38
#define QT_END_HEADER
Definition: qglobal.h:142