]> git.sesse.net Git - vlc/blob - bindings/phonon/vlc/mediacontroller.h
Phonon Backend using VLC
[vlc] / bindings / phonon / vlc / mediacontroller.h
1 /*****************************************************************************
2  * VLC backend for the Phonon library                                        *
3  * Copyright (C) 2007-2008 Tanguy Krotoff <tkrotoff@gmail.com>               *
4  * Copyright (C) 2008 Lukas Durfina <lukas.durfina@gmail.com>                *
5  * Copyright (C) 2009 Fathi Boudra <fabo@kde.org>                            *
6  *                                                                           *
7  * This program is free software; you can redistribute it and/or             *
8  * modify it under the terms of the GNU Lesser General Public                *
9  * License as published by the Free Software Foundation; either              *
10  * version 3 of the License, or (at your option) any later version.          *
11  *                                                                           *
12  * This program is distributed in the hope that it will be useful,           *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of            *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
15  * Lesser General Public License for more details.                           *
16  *                                                                           *
17  * You should have received a copy of the GNU Lesser General Public          *
18  * License along with this package; if not, write to the Free Software       *
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA *
20  *****************************************************************************/
21
22 #ifndef PHONON_VLC_MEDIACONTROLLER_H
23 #define PHONON_VLC_MEDIACONTROLLER_H
24
25 #include <phonon/addoninterface.h>
26 #include <phonon/objectdescription.h>
27
28 namespace Phonon
29 {
30 namespace VLC {
31
32 /**
33  * Interface for AddonInterface.
34  *
35  * This class cannot inherit from QObject has MediaObject already inherit from QObject.
36  * This is a Qt limitation: there is no possibility to inherit virtual Qobject :/
37  * See http://doc.trolltech.com/qq/qq15-academic.html
38  * Phonon implementation got the same problem.
39  *
40  * @see VLCMediaController
41  * @see VLCMediaObject
42  * @see MediaObject
43  */
44 class MediaController : public AddonInterface
45 {
46 public:
47
48     MediaController();
49     virtual ~MediaController();
50
51     bool hasInterface(Interface iface) const;
52
53     QVariant interfaceCall(Interface iface, int i_command, const QList<QVariant> & arguments = QList<QVariant>());
54
55     // MediaController signals
56     virtual void availableSubtitlesChanged() = 0;
57     virtual void availableAudioChannelsChanged() = 0;
58
59 //    virtual void availableChaptersChanged() = 0;
60 //    virtual void availableTitlesChanged() = 0;
61     virtual void availableChaptersChanged(int) = 0;
62     virtual void availableTitlesChanged(int) = 0;
63
64     virtual void availableAnglesChanged(int i_available_angles) = 0;
65     virtual void angleChanged(int i_angle_number) = 0;
66     virtual void chapterChanged(int i_chapter_number) = 0;
67     virtual void titleChanged(int i_title_number) = 0;
68
69 protected:
70
71     // AudioChannel
72     virtual void setCurrentAudioChannel(const Phonon::AudioChannelDescription & audioChannel) = 0;
73     virtual QList<Phonon::AudioChannelDescription> availableAudioChannels() const = 0;
74     virtual Phonon::AudioChannelDescription currentAudioChannel() const = 0;
75
76     // Subtitle
77     virtual void setCurrentSubtitle(const Phonon::SubtitleDescription & subtitle) = 0;
78     virtual QList<Phonon::SubtitleDescription> availableSubtitles() const = 0;
79     virtual Phonon::SubtitleDescription currentSubtitle() const = 0;
80
81     // Angle
82     virtual void setCurrentAngle(int i_angle_number) = 0;
83     virtual int availableAngles() const = 0;
84     virtual int currentAngle() const = 0;
85
86     // Chapter
87 //    virtual void setCurrentChapter( const Phonon::ChapterDescription & chapter ) = 0;
88 //    virtual QList<Phonon::ChapterDescription> availableChapters() const = 0;
89 //    virtual Phonon::ChapterDescription currentChapter() const = 0;
90     virtual void setCurrentChapter(int chapterNumber) = 0;
91     virtual int availableChapters() const = 0;
92     virtual int currentChapter() const = 0;
93
94     // Title
95 //    virtual void setCurrentTitle( const Phonon::TitleDescription & title ) = 0;
96 //    virtual QList<Phonon::TitleDescription> availableTitles() const = 0;
97 //    virtual Phonon::TitleDescription currentTitle() const = 0;
98     virtual void setCurrentTitle(int titleNumber) = 0;
99     virtual int availableTitles() const = 0;
100     virtual int currentTitle() const = 0;
101
102     virtual void setAutoplayTitles(bool b_autoplay) = 0;
103     virtual bool autoplayTitles() const = 0;
104
105     /**
106      * Clear all (i.e availableSubtitles, availableChapters...).
107      *
108      * This is used each time we restart the video.
109      */
110     virtual void clearMediaController();
111
112     Phonon::AudioChannelDescription current_audio_channel;
113     QList<Phonon::AudioChannelDescription> available_audio_channels;
114
115     Phonon::SubtitleDescription current_subtitle;
116     QList<Phonon::SubtitleDescription> available_subtitles;
117
118 //    Phonon::ChapterDescription current_chapter;
119 //    QList<Phonon::ChapterDescription> available_chapters;
120     int current_chapter;
121     int available_chapters;
122
123 //    Phonon::TitleDescription current_title;
124 //    QList<Phonon::TitleDescription> available_titles;
125     int current_title;
126     int available_titles;
127
128     int i_current_angle;
129     int i_available_angles;
130
131     bool b_autoplay_titles;
132
133 private:
134 };
135
136 }
137 } // Namespace Phonon::VLC
138
139 #endif // PHONON_VLC_MEDIACONTROLLER_H