Phonon  4.7.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
pulsesupport.h
1 /* This file is part of the KDE project
2  Copyright (C) 2009 Colin Guthrie <cguthrie@mandriva.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_PULSESUPPORT_H
24 #define PHONON_PULSESUPPORT_H
25 
26 #include "phonon_export.h"
27 #include "phononnamespace.h"
28 #include "objectdescription.h"
29 
30 #include <QtCore/QtGlobal>
31 #include <QtCore/QSet>
32 
33 
34 namespace Phonon
35 {
36  class PulseStream;
37  class PHONON_EXPORT PulseSupport : public QObject
38  {
39  Q_OBJECT
40  public:
41  static PulseSupport* getInstance();
42  static void shutdown();
43 
44  bool isActive();
45  void enable(bool enabled = true);
46 
47  QList<int> objectDescriptionIndexes(ObjectDescriptionType type) const;
48  QHash<QByteArray, QVariant> objectDescriptionProperties(ObjectDescriptionType type, int index) const;
49  QList<int> objectIndexesByCategory(ObjectDescriptionType type, Category category) const;
50  QList<int> objectIndexesByCategory(ObjectDescriptionType type, CaptureCategory category) const;
51 
52  void setOutputDevicePriorityForCategory(Category category, QList<int> order);
53  void setCaptureDevicePriorityForCategory(CaptureCategory category, QList<int> order);
54 
55  PHONON_DEPRECATED void setCaptureDevicePriorityForCategory(Category category, QList<int> order);
56 
57  PulseStream *registerOutputStream(QString streamUuid, Category category);
58  PulseStream *registerCaptureStream(QString streamUuid, CaptureCategory category);
59  PHONON_DEPRECATED PulseStream *registerCaptureStream(QString streamUuid, Category category);
60 
79  QHash<QString, QString> streamProperties(QString streamUuid) const;
80 
93  void setupStreamEnvironment(QString streamUuid);
94 
95  void emitObjectDescriptionChanged(ObjectDescriptionType);
96 
97  bool setOutputName(QString streamUuid, QString name);
98  bool setOutputDevice(QString streamUuid, int device);
99  bool setOutputVolume(QString streamUuid, qreal volume);
100  bool setOutputMute(QString streamUuid, bool mute);
101  bool setCaptureDevice(QString streamUuid, int device);
102  // NB Capture Volume/Mute not set until PA supports per-source-output volumes/mutes
103  // or phonon supports capture properly... which ever comes first.
104  void clearStreamCache(QString streamUuid);
105 
106  static void debug();
107  public Q_SLOTS:
108  void connectToDaemon();
109 
110  Q_SIGNALS:
111  void objectDescriptionChanged(ObjectDescriptionType);
112 
113  private:
114  PulseSupport();
115  ~PulseSupport();
116 
117  bool mEnabled;
118  };
119 } // namespace Phonon
120 
121 
122 #endif // PHONON_PULSESUPPORT_H