1 | /* This file is part of the KDE project |
2 | Copyright (C) 2005-2006 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_BACKENDCAPABILITIES_H |
24 | #define Phonon_BACKENDCAPABILITIES_H |
25 | |
26 | #include "phonon_export.h" |
27 | #include "objectdescription.h" |
28 | |
29 | #include <QtCore/QObject> |
30 | |
31 | |
32 | #ifdef __QT_SYNCQT__ |
33 | // Tell syncqt that the BackendCapabilities namespace should be treated like a class |
34 | #pragma qt_class(Phonon::BackendCapabilities) |
35 | #pragma qt_sync_stop_processing |
36 | #endif |
37 | |
38 | template<class T> class QList; |
39 | class QStringList; |
40 | |
41 | namespace Phonon |
42 | { |
43 | |
44 | /** |
45 | * Collection of functions describing the capabilities of the Backend. |
46 | * |
47 | * \ingroup BackendInformation |
48 | * \author Matthias Kretz <kretz@kde.org> |
49 | */ |
50 | namespace BackendCapabilities |
51 | { |
52 | /** \class Notifier backendcapabilities.h phonon/BackendCapabilities |
53 | * Notifications about backend capabilities. |
54 | * |
55 | * \ingroup BackendInformation |
56 | */ |
57 | class Notifier : public QObject |
58 | { |
59 | Q_OBJECT |
60 | Q_SIGNALS: |
61 | /** |
62 | * This signal is emitted if the capabilities have changed. This can |
63 | * happen if the user has requested a backend change. |
64 | */ |
65 | void capabilitiesChanged(); |
66 | |
67 | /** |
68 | * This signal is emitted when audio output devices were plugged or |
69 | * unplugged. |
70 | * |
71 | * Check BackendCapabilities::availableAudioOutputDevices to get the |
72 | * current list of available devices. |
73 | */ |
74 | void availableAudioOutputDevicesChanged(); |
75 | |
76 | #ifndef PHONON_NO_AUDIOCAPTURE |
77 | /** |
78 | * This signal is emitted when audio capture devices were plugged or |
79 | * unplugged. |
80 | * |
81 | * Check BackendCapabilities::availableAudioCaptureDevices to get the |
82 | * current list of available devices. |
83 | */ |
84 | void availableAudioCaptureDevicesChanged(); |
85 | #endif //PHONON_NO_AUDIOCAPTURE |
86 | |
87 | #ifndef PHONON_NO_VIDEOCAPTURE |
88 | /** |
89 | * This signal is emitted when video capture devices were plugged or |
90 | * unplugged. |
91 | * |
92 | * Check BackendCapabilities::availableVideoCaptureDevices to get the |
93 | * current list of available devices. |
94 | */ |
95 | void availableVideoCaptureDevicesChanged(); |
96 | #endif //PHONON_NO_VIDEOCAPTURE |
97 | }; |
98 | |
99 | /** |
100 | * Use this function to get a QObject pointer to connect to one of the Notifier signals. |
101 | * |
102 | * \return a pointer to a QObject. |
103 | * |
104 | * To connect to the signal do the following: |
105 | * \code |
106 | * QObject::connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), ... |
107 | * \endcode |
108 | * |
109 | * \see Notifier::capabilitiesChanged() |
110 | * \see Notifier::availableAudioOutputDevicesChanged() |
111 | * \see Notifier::availableAudioCaptureDevicesChanged() |
112 | * \see Notifier::availableVideoCaptureDevicesChanged() |
113 | */ |
114 | PHONON_EXPORT Notifier *notifier(); |
115 | |
116 | /** |
117 | * Returns a list of mime types that the Backend can decode. |
118 | * |
119 | * \see isMimeTypeAvailable() |
120 | */ |
121 | PHONON_EXPORT QStringList availableMimeTypes(); |
122 | |
123 | /** |
124 | * Often all you want to know is whether one given MIME type can be |
125 | * decoded by the backend. Use this method in favor of availableMimeTypes() |
126 | * as it can give you a negative answer without having a backend loaded. |
127 | * |
128 | * \see availableMimeTypes(); |
129 | */ |
130 | PHONON_EXPORT bool isMimeTypeAvailable(const QString &mimeType); |
131 | |
132 | /** |
133 | * Returns the audio output devices the backend supports. |
134 | * |
135 | * \return A list of AudioOutputDevice objects that give a name and |
136 | * description for every supported audio output device. |
137 | */ |
138 | PHONON_EXPORT QList<AudioOutputDevice> availableAudioOutputDevices(); |
139 | |
140 | #ifndef PHONON_NO_AUDIOCAPTURE |
141 | /** |
142 | * Returns the audio capture devices the backend supports. |
143 | * |
144 | * \return A list of AudioCaptureDevice objects that give a name and |
145 | * description for every supported audio capture device. |
146 | */ |
147 | PHONON_EXPORT QList<AudioCaptureDevice> availableAudioCaptureDevices(); |
148 | #endif //PHONON_NO_AUDIOCAPTURE |
149 | |
150 | /** |
151 | * Returns the video output devices the backend supports. |
152 | * |
153 | * \return A list of VideoOutputDevice objects that give a name and |
154 | * description for every supported video output device. |
155 | */ |
156 | // PHONON_EXPORT QList<VideoOutputDevice> availableVideoOutputDevices(); |
157 | |
158 | #ifndef PHONON_NO_VIDEOCAPTURE |
159 | /** |
160 | * Returns the video capture devices the backend supports. |
161 | * |
162 | * \return A list of VideoCaptureDevice objects that give a name and |
163 | * description for every supported video capture device. |
164 | */ |
165 | PHONON_EXPORT QList<VideoCaptureDevice> availableVideoCaptureDevices(); |
166 | #endif //PHONON_NO_VIDEOCAPTURE |
167 | |
168 | /** |
169 | * Returns the video capture devices that have audio capture capabilities |
170 | * that the backend supports. In effect, these are both video and audio |
171 | * capture devices and one can connect them to both a VideoWidget and an |
172 | * AudioOutput, for example. |
173 | * |
174 | * The resulting VideoCaptureDevices have a "hasaudio" property to true. |
175 | * |
176 | * \note These devices appear both in availableVideoCaptureDevices() and |
177 | * availableAudioCaptureDevices() |
178 | * |
179 | * \warning Creating two separate MediaObject instances for the same capture |
180 | * device, one for video and the other for audio, most probably doesn't work. |
181 | * But, if there are two separate devices, use Experimental::AVCapture. |
182 | * |
183 | * \see availableVideoCaptureDevices() |
184 | * \see availableAudioCaptureDevices() |
185 | * \see Experimental::AVCapture |
186 | */ |
187 | #if !defined(PHONON_NO_VIDEOCAPTURE) && !defined(PHONON_NO_AUDIOCAPTURE) |
188 | PHONON_EXPORT QList<VideoCaptureDevice> availableAVCaptureDevices(); |
189 | #endif // NOT PHONON_NO_VIDEOCAPTURE AND NOT PHONON_NO_AUDIOCAPTURE |
190 | |
191 | /** |
192 | * Returns the visualization effects the backend supports. |
193 | * |
194 | * \return A list of VisualizationEffect objects that give a name and |
195 | * description for every supported visualization effect. |
196 | */ |
197 | // PHONON_EXPORT QList<VisualizationDescription> availableVisualizations(); |
198 | |
199 | #ifndef QT_NO_PHONON_EFFECT |
200 | /** |
201 | * Returns descriptions for the audio effects the backend supports. |
202 | * |
203 | * \return A list of AudioEffectDescription objects that give a name and |
204 | * description for every supported audio effect. |
205 | */ |
206 | PHONON_EXPORT QList<EffectDescription> availableAudioEffects(); |
207 | #endif //QT_NO_PHONON_EFFECT |
208 | |
209 | //X /** |
210 | //X * Returns descriptions for the video effects the backend supports. |
211 | //X * |
212 | //X * \return A list of VideoEffectDescription objects that give a name and |
213 | //X * description for every supported video effect. |
214 | //X */ |
215 | //X PHONON_EXPORT QList<EffectDescription> availableVideoEffects(); |
216 | |
217 | /** |
218 | * Returns descriptions for the audio codecs the backend supports. |
219 | * |
220 | * \return A list of AudioCodec objects that give a name and |
221 | * description for every supported audio codec. |
222 | */ |
223 | // PHONON_EXPORT QList<AudioCodecDescription> availableAudioCodecs(); |
224 | |
225 | /** |
226 | * Returns descriptions for the video codecs the backend supports. |
227 | * |
228 | * \return A list of VideoCodec objects that give a name and |
229 | * description for every supported video codec. |
230 | */ |
231 | // PHONON_EXPORT QList<VideoCodecDescription> availableVideoCodecs(); |
232 | |
233 | /** |
234 | * Returns descriptions for the container formats the backend supports. |
235 | * |
236 | * \return A list of ContainerFormat objects that give a name and |
237 | * description for every supported container format. |
238 | */ |
239 | // PHONON_EXPORT QList<ContainerFormatDescription> availableContainerFormats(); |
240 | } // namespace BackendCapabilities |
241 | } // namespace Phonon |
242 | |
243 | |
244 | #endif // Phonon_BACKENDCAPABILITIES_H |
245 | // vim: sw=4 ts=4 tw=80 |
246 | |