~ubuntu-branches/ubuntu/gutsy/kde4libs/gutsy

« back to all changes in this revision

Viewing changes to phonon/backendcapabilities.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-02-21 11:00:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070221110012-6kw8khr9knv6lmg1
Tags: 3.80.3-0ubuntu1
New upstream unstable release

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <QObject>
24
24
 
25
25
#include <kdelibs_export.h>
26
 
#include <kstaticdeleter.h>
27
26
#include "objectdescription.h"
 
27
#include <kglobal.h>
28
28
 
29
29
template<class T> class QList;
30
30
class QStringList;
37
37
 *
38
38
 * \author Matthias Kretz <kretz@kde.org>
39
39
 */
40
 
class PHONONCORE_EXPORT BackendCapabilities : public QObject
 
40
namespace BackendCapabilities
41
41
{
42
 
        friend void ::KStaticDeleter<BackendCapabilities>::destructObject();
43
 
 
44
 
        Q_OBJECT
45
 
        public:
46
 
                /**
47
 
                 * Use this function to get the QObject pointer for connecting the
48
 
                 * capabilitiesChanged signal.
49
 
                 *
50
 
                 * \return a pointer to the BackendCapabilities instance. If no instance existed before a new
51
 
                 * one is created.
52
 
                 */
53
 
                static BackendCapabilities* self();
54
 
 
55
 
                /**
56
 
                 * Tells whether the backend is audio only or can handle video files
57
 
                 * and display of videos.
58
 
                 *
59
 
                 * If the backend does not support video the classes
60
 
                 * VideoPath, VideoEffect and all AbstractVideoOutput subclasses won't
61
 
                 * do anything.
62
 
                 */
63
 
                static bool supportsVideo();
64
 
 
65
 
                /**
66
 
                 * Tells whether the backend implements the OSD interfaces.
67
 
                 *
68
 
                 * \todo there's no interfaces for it at this point
69
 
                 */
70
 
                static bool supportsOSD();
71
 
 
72
 
                /**
73
 
                 * Tells whether the backend supports subtitle rendering on the
74
 
                 * video output.
75
 
                 *
76
 
                 * \todo there's no interfaces for it at this point
77
 
                 */
78
 
                static bool supportsSubtitles();
79
 
 
80
 
                /**
81
 
                 * Returns a list of mime types that the Backend can decode.
82
 
                 *
83
 
                 * \see isMimeTypeKnown()
84
 
                 */
85
 
                static QStringList knownMimeTypes();
86
 
 
87
 
                /**
88
 
                 * Often all you want to know is whether one given MIME type can be
89
 
                 * decoded by the backend. Use this method in favor of knownMimeTypes()
90
 
                 * as it can give you a negative answer without having a backend loaded.
91
 
                 *
92
 
                 * \see knownMimeTypes();
93
 
                 */
94
 
                static bool isMimeTypeKnown( const QString& mimeType );
 
42
    /**
 
43
     * Notifications about backend capabilities.
 
44
     */
 
45
    class Notifier : public QObject
 
46
    {
 
47
        Q_OBJECT
 
48
        Q_SIGNALS:
 
49
            /**
 
50
             * This signal is emitted if the capabilities have changed. This can
 
51
             * happen if the user has requested a backend change.
 
52
             */
 
53
            void capabilitiesChanged();
 
54
    };
 
55
 
 
56
    /**
 
57
     * Use this function to get a QObject pointer to connect to the capabilitiesChanged signal.
 
58
     *
 
59
     * \return a pointer to a QObject.
 
60
     *
 
61
     * The capabilitiesChanged signal is emitted if the capabilities have changed. This can
 
62
     * happen if the user has requested a backend change.
 
63
     *
 
64
     * To connect to this signal do the following:
 
65
     * \code
 
66
     * QObject::connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), ...
 
67
     * \endcode
 
68
     *
 
69
     * \see Notifier::capabilitiesChanged()
 
70
     */
 
71
    PHONONCORE_EXPORT Notifier *notifier();
 
72
 
 
73
    /**
 
74
     * Tells whether the backend is audio only or can handle video files
 
75
     * and display of videos.
 
76
     *
 
77
     * If the backend does not support video the classes
 
78
     * VideoPath, VideoEffect and all AbstractVideoOutput subclasses won't
 
79
     * do anything.
 
80
     */
 
81
    PHONONCORE_EXPORT bool supportsVideo();
 
82
 
 
83
    /**
 
84
     * Tells whether the backend implements the OSD interfaces.
 
85
     *
 
86
     * \todo there's no interfaces for it at this point
 
87
     */
 
88
    PHONONCORE_EXPORT bool supportsOSD();
 
89
 
 
90
    /**
 
91
     * Tells whether the backend supports subtitle rendering on the
 
92
     * video output.
 
93
     *
 
94
     * \todo there's no interfaces for it at this point
 
95
     */
 
96
    PHONONCORE_EXPORT bool supportsSubtitles();
 
97
 
 
98
    /**
 
99
     * Returns a list of mime types that the Backend can decode.
 
100
     *
 
101
     * \see isMimeTypeKnown()
 
102
     */
 
103
    PHONONCORE_EXPORT QStringList knownMimeTypes();
 
104
 
 
105
    /**
 
106
     * Often all you want to know is whether one given MIME type can be
 
107
     * decoded by the backend. Use this method in favor of knownMimeTypes()
 
108
     * as it can give you a negative answer without having a backend loaded.
 
109
     *
 
110
     * \see knownMimeTypes();
 
111
     */
 
112
    PHONONCORE_EXPORT bool isMimeTypeKnown( const QString& mimeType );
95
113
 
96
114
#if 0
97
 
                /**
98
 
                 * Returns the audio output devices the backend reports as usable. That
99
 
                 * doesn't have to say the device will certainly work as the backend
100
 
                 * might not be able to open the device if it's blocked by another
101
 
                 * application. But at least the device is physically available.
102
 
                 *
103
 
                 * \return A list of AudioOutputDevice objects that give a name and
104
 
                 * description for every supported audio output device.
105
 
                 * 
106
 
                 * \see knownAudioOutputDevices
107
 
                 */
108
 
                static QList<AudioOutputDevice> usableAudioOutputDevices();
 
115
    /**
 
116
     * Returns the audio output devices the backend reports as usable. That
 
117
     * doesn't have to say the device will certainly work as the backend
 
118
     * might not be able to open the device if it's blocked by another
 
119
     * application. But at least the device is physically available.
 
120
     *
 
121
     * \return A list of AudioOutputDevice objects that give a name and
 
122
     * description for every supported audio output device.
 
123
     * 
 
124
     * \see knownAudioOutputDevices
 
125
     */
 
126
    PHONONCORE_EXPORT QList<AudioOutputDevice> usableAudioOutputDevices();
109
127
 
110
 
                /**
111
 
                 * Returns the audio output devices the backend has ever reported as
112
 
                 * usable.
113
 
                 *
114
 
                 * \return A list of AudioOutputDevice objects that give a name and
115
 
                 * description for every supported audio output device.
116
 
                 *
117
 
                 * \see usableAudioOutputDevices
118
 
                 */
119
 
                static QList<AudioOutputDevice> knownAudioOutputDevices();
 
128
    /**
 
129
     * Returns the audio output devices the backend has ever reported as
 
130
     * usable.
 
131
     *
 
132
     * \return A list of AudioOutputDevice objects that give a name and
 
133
     * description for every supported audio output device.
 
134
     *
 
135
     * \see usableAudioOutputDevices
 
136
     */
 
137
    PHONONCORE_EXPORT QList<AudioOutputDevice> knownAudioOutputDevices();
120
138
#endif
121
 
                /**
122
 
                 * Returns the audio output devices the backend supports.
123
 
                 *
124
 
                 * \return A list of AudioOutputDevice objects that give a name and
125
 
                 * description for every supported audio output device.
126
 
                 */
127
 
                static QList<AudioOutputDevice> availableAudioOutputDevices();
128
 
 
129
 
                /**
130
 
                 * Returns the audio capture devices the backend supports.
131
 
                 *
132
 
                 * \return A list of AudioCaptureDevice objects that give a name and
133
 
                 * description for every supported audio capture device.
134
 
                 */
135
 
                static QList<AudioCaptureDevice> availableAudioCaptureDevices();
136
 
 
137
 
                /**
138
 
                 * Returns the video output devices the backend supports.
139
 
                 *
140
 
                 * \return A list of VideoOutputDevice objects that give a name and
141
 
                 * description for every supported video output device.
142
 
                 */
143
 
                static QList<VideoOutputDevice> availableVideoOutputDevices();
144
 
 
145
 
                /**
146
 
                 * Returns the video capture devices the backend supports.
147
 
                 *
148
 
                 * \return A list of VideoCaptureDevice objects that give a name and
149
 
                 * description for every supported video capture device.
150
 
                 */
151
 
                static QList<VideoCaptureDevice> availableVideoCaptureDevices();
152
 
 
153
 
                /**
154
 
                 * Returns the visualization effects the backend supports.
155
 
                 *
156
 
                 * \return A list of VisualizationEffect objects that give a name and
157
 
                 * description for every supported visualization effect.
158
 
                 */
159
 
                static QList<VisualizationDescription> availableVisualizations();
160
 
 
161
 
                /**
162
 
                 * Returns descriptions for the audio effects the backend supports.
163
 
                 *
164
 
                 * \return A list of AudioEffectDescription objects that give a name and
165
 
                 * description for every supported audio effect.
166
 
                 */
167
 
                static QList<AudioEffectDescription> availableAudioEffects();
168
 
 
169
 
                /**
170
 
                 * Returns descriptions for the video effects the backend supports.
171
 
                 *
172
 
                 * \return A list of VideoEffectDescription objects that give a name and
173
 
                 * description for every supported video effect.
174
 
                 */
175
 
                static QList<VideoEffectDescription> availableVideoEffects();
176
 
 
177
 
                /**
178
 
                 * Returns descriptions for the audio codecs the backend supports.
179
 
                 *
180
 
                 * \return A list of AudioCodec objects that give a name and
181
 
                 * description for every supported audio codec.
182
 
                 */
183
 
                static QList<AudioCodecDescription> availableAudioCodecs();
184
 
 
185
 
                /**
186
 
                 * Returns descriptions for the video codecs the backend supports.
187
 
                 *
188
 
                 * \return A list of VideoCodec objects that give a name and
189
 
                 * description for every supported video codec.
190
 
                 */
191
 
                static QList<VideoCodecDescription> availableVideoCodecs();
192
 
 
193
 
                /**
194
 
                 * Returns descriptions for the container formats the backend supports.
195
 
                 *
196
 
                 * \return A list of ContainerFormat objects that give a name and
197
 
                 * description for every supported container format.
198
 
                 */
199
 
                static QList<ContainerFormatDescription> availableContainerFormats();
200
 
 
201
 
        Q_SIGNALS:
202
 
                /**
203
 
                 * This signal is emitted if the capabilities have changed. This can
204
 
                 * happen if the user has requested a backend change.
205
 
                 *
206
 
                 * To connect to this signal use the self function:
207
 
                 * \code
208
 
                 * QObject::connect( BackendCapabilities::self(), SIGNAL(capabilitiesChanged()), ...
209
 
                 * \endcode
210
 
                 */
211
 
                void capabilitiesChanged();
212
 
 
213
 
        protected:
214
 
                BackendCapabilities();
215
 
                ~BackendCapabilities();
216
 
 
217
 
        private Q_SLOTS:
218
 
                void _k_slotBackendChanged();
219
 
 
220
 
        private:
221
 
                static BackendCapabilities* m_self;
222
 
                class Private;
223
 
                Private* d;
224
 
};
 
139
    /**
 
140
     * Returns the audio output devices the backend supports.
 
141
     *
 
142
     * \return A list of AudioOutputDevice objects that give a name and
 
143
     * description for every supported audio output device.
 
144
     */
 
145
    PHONONCORE_EXPORT QList<AudioOutputDevice> availableAudioOutputDevices();
 
146
 
 
147
    /**
 
148
     * Returns the audio capture devices the backend supports.
 
149
     *
 
150
     * \return A list of AudioCaptureDevice objects that give a name and
 
151
     * description for every supported audio capture device.
 
152
     */
 
153
    PHONONCORE_EXPORT QList<AudioCaptureDevice> availableAudioCaptureDevices();
 
154
 
 
155
    /**
 
156
     * Returns the video output devices the backend supports.
 
157
     *
 
158
     * \return A list of VideoOutputDevice objects that give a name and
 
159
     * description for every supported video output device.
 
160
     */
 
161
    PHONONCORE_EXPORT QList<VideoOutputDevice> availableVideoOutputDevices();
 
162
 
 
163
    /**
 
164
     * Returns the video capture devices the backend supports.
 
165
     *
 
166
     * \return A list of VideoCaptureDevice objects that give a name and
 
167
     * description for every supported video capture device.
 
168
     */
 
169
    PHONONCORE_EXPORT QList<VideoCaptureDevice> availableVideoCaptureDevices();
 
170
 
 
171
    /**
 
172
     * Returns the visualization effects the backend supports.
 
173
     *
 
174
     * \return A list of VisualizationEffect objects that give a name and
 
175
     * description for every supported visualization effect.
 
176
     */
 
177
    PHONONCORE_EXPORT QList<VisualizationDescription> availableVisualizations();
 
178
 
 
179
    /**
 
180
     * Returns descriptions for the audio effects the backend supports.
 
181
     *
 
182
     * \return A list of AudioEffectDescription objects that give a name and
 
183
     * description for every supported audio effect.
 
184
     */
 
185
    PHONONCORE_EXPORT QList<AudioEffectDescription> availableAudioEffects();
 
186
 
 
187
    /**
 
188
     * Returns descriptions for the video effects the backend supports.
 
189
     *
 
190
     * \return A list of VideoEffectDescription objects that give a name and
 
191
     * description for every supported video effect.
 
192
     */
 
193
    PHONONCORE_EXPORT QList<VideoEffectDescription> availableVideoEffects();
 
194
 
 
195
    /**
 
196
     * Returns descriptions for the audio codecs the backend supports.
 
197
     *
 
198
     * \return A list of AudioCodec objects that give a name and
 
199
     * description for every supported audio codec.
 
200
     */
 
201
    PHONONCORE_EXPORT QList<AudioCodecDescription> availableAudioCodecs();
 
202
 
 
203
    /**
 
204
     * Returns descriptions for the video codecs the backend supports.
 
205
     *
 
206
     * \return A list of VideoCodec objects that give a name and
 
207
     * description for every supported video codec.
 
208
     */
 
209
    PHONONCORE_EXPORT QList<VideoCodecDescription> availableVideoCodecs();
 
210
 
 
211
    /**
 
212
     * Returns descriptions for the container formats the backend supports.
 
213
     *
 
214
     * \return A list of ContainerFormat objects that give a name and
 
215
     * description for every supported container format.
 
216
     */
 
217
    PHONONCORE_EXPORT QList<ContainerFormatDescription> availableContainerFormats();
 
218
} // namespace BackendCapabilities
225
219
} // namespace Phonon
226
220
 
227
221
#endif // Phonon_BACKENDCAPABILITIES_H
228
 
// vim: sw=4 ts=4 tw=80 noet
 
222
// vim: sw=4 ts=4 tw=80