10#include "pulseaudioqt_export.h"
49class PULSEAUDIOQT_EXPORT Context :
public QObject
57 Q_PROPERTY(State state READ state NOTIFY stateChanged)
65 Q_PROPERTY(
bool autoConnecting READ isAutoConnecting NOTIFY autoConnectingChanged)
84 static Context *instance();
91 static void setApplicationId(
const QString &applicationId);
100 QList<Sink *> sinks()
const;
107 QList<SinkInput *> sinkInputs()
const;
114 QList<Source *> sources()
const;
121 QList<SourceOutput *> sourceOutputs()
const;
128 QList<Client *> clients()
const;
135 QList<Card *> cards()
const;
142 QList<Module *> modules()
const;
149 QList<StreamRestore *> streamRestores()
const;
156 pa_context *context()
const;
158 void setCardProfile(quint32 index,
const QString &profile);
159 void setDefaultSink(
const QString &name);
160 void setDefaultSource(
const QString &name);
167 [[nodiscard]]
State state()
const;
174 [[nodiscard]]
bool isAutoConnecting()
const;
186 void loadModule(
const QString &name,
const QString &argument);
195 void unloadModule(PulseAudioQt::Module *module);
203 void reconnectDaemon();
209 void sinkAdded(PulseAudioQt::Sink *sink);
214 void sinkRemoved(PulseAudioQt::Sink *sink);
219 void sinkInputAdded(PulseAudioQt::SinkInput *sinkInput);
224 void sinkInputRemoved(PulseAudioQt::SinkInput *sinkInput);
229 void sourceAdded(PulseAudioQt::Source *source);
234 void sourceRemoved(PulseAudioQt::Source *source);
239 void sourceOutputAdded(PulseAudioQt::SourceOutput *sourceOutput);
244 void sourceOutputRemoved(PulseAudioQt::SourceOutput *sourceOutput);
249 void clientAdded(PulseAudioQt::Client *client);
254 void clientRemoved(PulseAudioQt::Client *client);
259 void cardAdded(PulseAudioQt::Card *card);
264 void cardRemoved(PulseAudioQt::Card *card);
269 void moduleAdded(PulseAudioQt::Module *module);
274 void moduleRemoved(PulseAudioQt::Module *module);
279 void streamRestoreAdded(PulseAudioQt::StreamRestore *streamRestore);
284 void streamRestoreRemoved(PulseAudioQt::StreamRestore *streamRestore);
298 void autoConnectingChanged();
301 explicit Context(QObject *parent =
nullptr);
303 std::unique_ptr<class ContextPrivate> d;
306 friend class SinkInput;
308 friend class SourceOutput;
310 friend class StreamRestorePrivate;
312 friend class SinkModel;
313 friend class SinkInputModel;
314 friend class SourceModel;
315 friend class SourceOutputModel;
316 friend class StreamRestoreModel;
317 friend class CardModel;
318 friend class ModuleModel;
KCMUTILS_EXPORT KCModule * loadModule(const KPluginMetaData &metaData, QWidget *parent=nullptr, const QVariantList &args={}, const std::shared_ptr< QQmlEngine > &engine={})
bool isValid(QStringView ifopt)
The primary namespace of PulseAudioQt.
qint64 normalVolume()
The normal volume (100%, 0 dB).
qint64 maximumUIVolume()
The maximum volume suitable to display in a UI.
qint64 minimumVolume()
The minimum volume (0%).
qint64 maximumVolume()
The maximum volume PulseAudio can store.