pulsesupport.h

Go to the documentation of this file.
00001 /*  This file is part of the KDE project
00002     Copyright (C) 2009 Colin Guthrie <cguthrie@mandriva.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_PULSESUPPORT_H
00024 #define PHONON_PULSESUPPORT_H
00025 
00026 #include "phonon_export.h"
00027 #include "phononnamespace.h"
00028 #include "objectdescription.h"
00029 
00030 #include <QtCore/QtGlobal>
00031 #include <QtCore/QSet>
00032 
00033 QT_BEGIN_HEADER
00034 QT_BEGIN_NAMESPACE
00035 
00036 namespace Phonon
00037 {
00038     class PHONON_EXPORT PulseSupport : public QObject
00039     {
00040         Q_OBJECT
00041         public:
00042             static PulseSupport* getInstance();
00043             static void shutdown();
00044 
00045             bool isActive();
00046             void enable(bool enabled = true);
00047 
00048             QList<int> objectDescriptionIndexes(ObjectDescriptionType type) const;
00049             QHash<QByteArray, QVariant> objectDescriptionProperties(ObjectDescriptionType type, int index) const;
00050             QList<int> objectIndexesByCategory(ObjectDescriptionType type, Category category) const;
00051 
00052             void setOutputDevicePriorityForCategory(Category category, QList<int> order);
00053             void setCaptureDevicePriorityForCategory(Category category, QList<int> order);
00054 
00055             void setStreamPropList(Category category, QString streamUuid);
00056             void emitObjectDescriptionChanged(ObjectDescriptionType);
00057             void emitUsingDevice(QString streamUuid, int device);
00058 
00059             bool setOutputDevice(QString streamUuid, int device);
00060             bool setCaptureDevice(QString streamUuid, int device);
00061             void clearStreamCache(QString streamUuid);
00062 
00063         signals:
00064             void objectDescriptionChanged(ObjectDescriptionType);
00065             void usingDevice(QString streamUuid, int device);
00066 
00067         private:
00068             PulseSupport();
00069             ~PulseSupport();
00070 
00071             bool mEnabled;
00072     };
00073 } // namespace Phonon
00074 
00075 QT_END_NAMESPACE
00076 QT_END_HEADER
00077 
00078 #endif // PHONON_PULSESUPPORT_H