File indexing completed on 2024-04-21 16:20:31

0001 /*
0002     SPDX-FileCopyrightText: 2016 David Edmundson <davidedmundson@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef MODULEMANAGER_H
0008 #define MODULEMANAGER_H
0009 
0010 #include <QString>
0011 
0012 #include <pulse/introspect.h>
0013 
0014 #include "context.h"
0015 // Properties need fully qualified classes even with pointers.
0016 #include "client.h"
0017 
0018 namespace QPulseAudio
0019 {
0020 class ConfigModule;
0021 
0022 class ModuleManager : public QObject
0023 {
0024     Q_OBJECT
0025     Q_PROPERTY(bool settingsSupported READ settingsSupported NOTIFY serverUpdated)
0026     Q_PROPERTY(bool combineSinks READ combineSinks WRITE setCombineSinks NOTIFY combineSinksChanged)
0027     Q_PROPERTY(bool switchOnConnect READ switchOnConnect WRITE setSwitchOnConnect NOTIFY switchOnConnectChanged)
0028     Q_PROPERTY(bool configModuleLoaded READ configModuleLoaded NOTIFY loadedModulesChanged)
0029     Q_PROPERTY(QString configModuleName READ configModuleName CONSTANT)
0030     Q_PROPERTY(QStringList loadedModules READ loadedModules NOTIFY loadedModulesChanged)
0031 public:
0032     explicit ModuleManager(QObject *parent = nullptr);
0033     ~ModuleManager() override;
0034 
0035     bool settingsSupported() const;
0036     bool combineSinks() const;
0037     void setCombineSinks(bool combineSinks);
0038     bool switchOnConnect() const;
0039     void setSwitchOnConnect(bool switchOnConnect);
0040     QStringList loadedModules() const;
0041     bool configModuleLoaded() const;
0042     QString configModuleName() const;
0043 
0044 Q_SIGNALS:
0045     void combineSinksChanged();
0046     void switchOnConnectChanged();
0047     void loadedModulesChanged();
0048     void serverUpdated();
0049 
0050 private:
0051     void updateLoadedModules();
0052 
0053     ConfigModule *m_combineSinks;
0054     ConfigModule *m_switchOnConnect;
0055     ConfigModule *m_deviceManager;
0056     QStringList m_loadedModules;
0057 };
0058 
0059 } // QPulseAudio
0060 
0061 #endif // STREAM_H