File indexing completed on 2024-04-14 04:38:23

0001 /*  This file is part of the KDE project
0002     Copyright (C) 2005-2006 Matthias Kretz <kretz@kde.org>
0003 
0004     This library is free software; you can redistribute it and/or
0005     modify it under the terms of the GNU Lesser General Public
0006     License as published by the Free Software Foundation; either
0007     version 2.1 of the License, or (at your option) version 3, or any
0008     later version accepted by the membership of KDE e.V. (or its
0009     successor approved by the membership of KDE e.V.), Nokia Corporation 
0010     (or its successors, if any) and the KDE Free Qt Foundation, which shall
0011     act as a proxy defined in Section 6 of version 3 of the license.
0012 
0013     This library is distributed in the hope that it will be useful,
0014     but WITHOUT ANY WARRANTY; without even the implied warranty of
0015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0016     Lesser General Public License for more details.
0017 
0018     You should have received a copy of the GNU Lesser General Public
0019     License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0020 
0021 */
0022 
0023 #ifndef Phonon_BACKENDCAPABILITIES_H
0024 #define Phonon_BACKENDCAPABILITIES_H
0025 
0026 #include "phonon_export.h"
0027 #include "objectdescription.h"
0028 
0029 #include <QObject>
0030 #include <QStringList>
0031 
0032 #ifdef __QT_SYNCQT__
0033 // Tell syncqt that the BackendCapabilities namespace should be treated like a class
0034 #pragma qt_class(Phonon::BackendCapabilities)
0035 #pragma qt_sync_stop_processing
0036 #endif
0037 
0038 template<class T> class QList;
0039 
0040 namespace Phonon
0041 {
0042 
0043 /**
0044  * Collection of functions describing the capabilities of the Backend.
0045  *
0046  * \ingroup BackendInformation
0047  * \author Matthias Kretz <kretz@kde.org>
0048  */
0049 namespace BackendCapabilities
0050 {
0051     /** \class Notifier backendcapabilities.h phonon/BackendCapabilities
0052      * Notifications about backend capabilities.
0053      *
0054      * \ingroup BackendInformation
0055      */
0056     class Notifier : public QObject
0057     {
0058         Q_OBJECT
0059         Q_SIGNALS:
0060             /**
0061              * This signal is emitted if the capabilities have changed. This can
0062              * happen if the user has requested a backend change.
0063              */
0064             void capabilitiesChanged();
0065 
0066             /**
0067              * This signal is emitted when audio output devices were plugged or
0068              * unplugged.
0069              *
0070              * Check BackendCapabilities::availableAudioOutputDevices to get the
0071              * current list of available devices.
0072              */
0073             void availableAudioOutputDevicesChanged();
0074 
0075 #ifndef PHONON_NO_AUDIOCAPTURE
0076             /**
0077              * This signal is emitted when audio capture devices were plugged or
0078              * unplugged.
0079              *
0080              * Check BackendCapabilities::availableAudioCaptureDevices to get the
0081              * current list of available devices.
0082              */
0083             void availableAudioCaptureDevicesChanged();
0084 #endif //PHONON_NO_AUDIOCAPTURE
0085 
0086 #ifndef PHONON_NO_VIDEOCAPTURE
0087             /**
0088              * This signal is emitted when video capture devices were plugged or
0089              * unplugged.
0090              *
0091              * Check BackendCapabilities::availableVideoCaptureDevices to get the
0092              * current list of available devices.
0093              */
0094             void availableVideoCaptureDevicesChanged();
0095 #endif //PHONON_NO_VIDEOCAPTURE
0096     };
0097 
0098     /**
0099      * Use this function to get a QObject pointer to connect to one of the Notifier signals.
0100      *
0101      * \return a pointer to a QObject.
0102      *
0103      * To connect to the signal do the following:
0104      * \code
0105      * QObject::connect(BackendCapabilities::notifier(), SIGNAL(capabilitiesChanged()), ...
0106      * \endcode
0107      *
0108      * \see Notifier::capabilitiesChanged()
0109      * \see Notifier::availableAudioOutputDevicesChanged()
0110      * \see Notifier::availableAudioCaptureDevicesChanged()
0111      * \see Notifier::availableVideoCaptureDevicesChanged()
0112      */
0113     PHONON_EXPORT Notifier *notifier();
0114 
0115     /**
0116      * Returns a list of mime types that the Backend can decode.
0117      *
0118      * \see isMimeTypeAvailable()
0119      */
0120     PHONON_EXPORT QStringList availableMimeTypes();
0121 
0122     /**
0123      * Often all you want to know is whether one given MIME type can be
0124      * decoded by the backend. Use this method in favor of availableMimeTypes()
0125      * as it can give you a negative answer without having a backend loaded.
0126      *
0127      * \see availableMimeTypes();
0128      */
0129     PHONON_EXPORT bool isMimeTypeAvailable(const QString &mimeType);
0130 
0131     /**
0132      * Returns the audio output devices the backend supports.
0133      *
0134      * \return A list of AudioOutputDevice objects that give a name and
0135      * description for every supported audio output device.
0136      */
0137     PHONON_EXPORT QList<AudioOutputDevice> availableAudioOutputDevices();
0138 
0139 #ifndef PHONON_NO_AUDIOCAPTURE
0140     /**
0141      * Returns the audio capture devices the backend supports.
0142      *
0143      * \return A list of AudioCaptureDevice objects that give a name and
0144      * description for every supported audio capture device.
0145      */
0146     PHONON_EXPORT QList<AudioCaptureDevice> availableAudioCaptureDevices();
0147 #endif //PHONON_NO_AUDIOCAPTURE
0148 
0149     /**
0150      * Returns the video output devices the backend supports.
0151      *
0152      * \return A list of VideoOutputDevice objects that give a name and
0153      * description for every supported video output device.
0154      */
0155 //    PHONON_EXPORT QList<VideoOutputDevice> availableVideoOutputDevices();
0156 
0157 #ifndef PHONON_NO_VIDEOCAPTURE
0158     /**
0159      * Returns the video capture devices the backend supports.
0160      *
0161      * \return A list of VideoCaptureDevice objects that give a name and
0162      * description for every supported video capture device.
0163      */
0164     PHONON_EXPORT QList<VideoCaptureDevice> availableVideoCaptureDevices();
0165 #endif //PHONON_NO_VIDEOCAPTURE
0166 
0167     /**
0168      * Returns the video capture devices that have audio capture capabilities
0169      * that the backend supports. In effect, these are both video and audio
0170      * capture devices and one can connect them to both a VideoWidget and an
0171      * AudioOutput, for example.
0172      *
0173      * The resulting VideoCaptureDevices have a "hasaudio" property to true.
0174      *
0175      * \note These devices appear both in availableVideoCaptureDevices() and
0176      * availableAudioCaptureDevices()
0177      *
0178      * \warning Creating two separate MediaObject instances for the same capture
0179      * device, one for video and the other for audio, most probably doesn't work.
0180      * But, if there are two separate devices, use Experimental::AVCapture.
0181      *
0182      * \see availableVideoCaptureDevices()
0183      * \see availableAudioCaptureDevices()
0184      * \see Experimental::AVCapture
0185      */
0186 #if !defined(PHONON_NO_VIDEOCAPTURE) && !defined(PHONON_NO_AUDIOCAPTURE)
0187     PHONON_EXPORT QList<VideoCaptureDevice> availableAVCaptureDevices();
0188 #endif // NOT PHONON_NO_VIDEOCAPTURE AND NOT PHONON_NO_AUDIOCAPTURE
0189 
0190     /**
0191      * Returns the visualization effects the backend supports.
0192      *
0193      * \return A list of VisualizationEffect objects that give a name and
0194      * description for every supported visualization effect.
0195      */
0196 //    PHONON_EXPORT QList<VisualizationDescription> availableVisualizations();
0197 
0198 #ifndef QT_NO_PHONON_EFFECT
0199     /**
0200      * Returns descriptions for the audio effects the backend supports.
0201      *
0202      * \return A list of AudioEffectDescription objects that give a name and
0203      * description for every supported audio effect.
0204      */
0205     PHONON_EXPORT QList<EffectDescription> availableAudioEffects();
0206 #endif //QT_NO_PHONON_EFFECT
0207 
0208 //X     /**
0209 //X      * Returns descriptions for the video effects the backend supports.
0210 //X      *
0211 //X      * \return A list of VideoEffectDescription objects that give a name and
0212 //X      * description for every supported video effect.
0213 //X      */
0214 //X     PHONON_EXPORT QList<EffectDescription> availableVideoEffects();
0215 
0216     /**
0217      * Returns descriptions for the audio codecs the backend supports.
0218      *
0219      * \return A list of AudioCodec objects that give a name and
0220      * description for every supported audio codec.
0221      */
0222 //    PHONON_EXPORT QList<AudioCodecDescription> availableAudioCodecs();
0223 
0224     /**
0225      * Returns descriptions for the video codecs the backend supports.
0226      *
0227      * \return A list of VideoCodec objects that give a name and
0228      * description for every supported video codec.
0229      */
0230 //    PHONON_EXPORT QList<VideoCodecDescription> availableVideoCodecs();
0231 
0232     /**
0233      * Returns descriptions for the container formats the backend supports.
0234      *
0235      * \return A list of ContainerFormat objects that give a name and
0236      * description for every supported container format.
0237      */
0238 //    PHONON_EXPORT QList<ContainerFormatDescription> availableContainerFormats();
0239 } // namespace BackendCapabilities
0240 } // namespace Phonon
0241 
0242 
0243 #endif // Phonon_BACKENDCAPABILITIES_H
0244 // vim: sw=4 ts=4 tw=80