mediacontroller.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_MEDIACONTROLLER_H
00024 #define PHONON_MEDIACONTROLLER_H
00025 
00026 #include "phonon_export.h"
00027 #include "objectdescription.h"
00028 
00029 #include <QtCore/QObject>
00030 #include <QtCore/QtGlobal>
00031 
00032 QT_BEGIN_HEADER
00033 QT_BEGIN_NAMESPACE
00034 
00035 #ifndef QT_NO_PHONON_MEDIACONTROLLER
00036 
00037 namespace Phonon
00038 {
00039 class MediaControllerPrivate;
00040 class MediaObject;
00041 
00048 class PHONON_EXPORT MediaController : public QObject
00049 {
00050     Q_OBJECT
00051     Q_FLAGS(Features)
00052     public:
00053         enum Feature {
00054             Angles = 1,
00055             Chapters = 2,
00056             Titles = 4
00057         };
00058         Q_DECLARE_FLAGS(Features, Feature)
00059 
00060         MediaController(MediaObject *parent);
00061         ~MediaController();
00062 
00063         Features supportedFeatures() const;
00064 
00065         int availableAngles() const;
00066         int currentAngle() const;
00067 
00068         int availableChapters() const;
00069         int currentChapter() const;
00070 
00071         int availableTitles() const;
00072         int currentTitle() const;
00073 
00074         bool autoplayTitles() const;
00075 
00082         AudioChannelDescription currentAudioChannel() const;
00083 
00090         SubtitleDescription currentSubtitle() const;
00091 
00099         QList<AudioChannelDescription> availableAudioChannels() const;
00100 
00108         QList<SubtitleDescription> availableSubtitles() const;
00109 
00121         void setCurrentAudioChannel(const Phonon::AudioChannelDescription &stream);
00122 
00134         void setCurrentSubtitle(const Phonon::SubtitleDescription &stream);
00135 
00136     public Q_SLOTS:
00137         void setCurrentAngle(int angleNumber);
00138         void setCurrentChapter(int chapterNumber);
00139 
00146         void setCurrentTitle(int titleNumber);
00147         void setAutoplayTitles(bool);
00148 
00155         void nextTitle();
00156 
00163         void previousTitle();
00164 
00165     Q_SIGNALS:
00166         void availableSubtitlesChanged();
00167         void availableAudioChannelsChanged();
00168         void availableAnglesChanged(int availableAngles);
00169         void angleChanged(int angleNumber);
00170         void availableChaptersChanged(int availableChapters);
00171         void chapterChanged(int chapterNumber);
00172         void availableTitlesChanged(int availableTitles);
00173         void titleChanged(int titleNumber);
00174 
00175     protected:
00176         MediaControllerPrivate *const d;
00177 };
00178 
00179 } // namespace Phonon
00180 
00181 Q_DECLARE_OPERATORS_FOR_FLAGS(Phonon::MediaController::Features)
00182 
00183 #endif //QT_NO_PHONON_MEDIACONTROLLER
00184 
00185 QT_END_NAMESPACE
00186 QT_END_HEADER
00187 
00188 #endif // PHONON_MEDIACONTROLLER_H