PulseAudio Qt Bindings

server.h
1/*
2 SPDX-FileCopyrightText: 2016 David Rosca <nowrep@gmail.com>
3 SPDX-FileCopyrightText: 2024 Harald Sitter <sitter@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef SERVER_H
9#define SERVER_H
10
11#include "pulseaudioqt_export.h"
12#include <QObject>
13
14namespace PulseAudioQt
15{
16class Sink;
17class Source;
18class Context;
19
20class PULSEAUDIOQT_EXPORT Server : public QObject
21{
22 Q_OBJECT
23 /// The default Sink (SinkInputs that aren't otherwise assigned explicitly will use this Sink)
24 Q_PROPERTY(Sink *defaultSink READ defaultSink NOTIFY defaultSinkChanged)
25 /// The default Source (SourceOutputs that aren't otherwise assigned explicitly will use this Source)
26 Q_PROPERTY(Source *defaultSource READ defaultSource NOTIFY defaultSourceChanged)
27 /// Whether the connected Server is PipeWire (rather than PulseAudio)
28 Q_PROPERTY(bool isPipeWire READ isPipeWire NOTIFY isPipeWireChanged)
29 /// Whether the connected PipeWire is driven by WirePlumber
30 Q_PROPERTY(bool hasWirePlumber READ hasWirePlumber NOTIFY hasWirePlumberChanged)
31public:
32 ~Server() override;
33
34 Sink *defaultSink() const;
35 void setDefaultSink(Sink *sink);
36
37 Source *defaultSource() const;
38 void setDefaultSource(Source *source);
39
40 /**
41 * Whether PulseAudio is provided via pipewire-pulse.
42 */
43 bool isPipeWire() const;
44
45 /**
46 * Whether WirePlumber is running in addition to PipeWire.
47 *
48 * @since 1.6
49 */
50 [[nodiscard]] bool hasWirePlumber() const;
51
52Q_SIGNALS:
53 void defaultSinkChanged(PulseAudioQt::Sink *sink);
54 void defaultSourceChanged(PulseAudioQt::Source *source);
55 void isPipeWireChanged();
56 void updated();
57 void hasWirePlumberChanged();
58
59private:
60 explicit Server(Context *context);
61
62 void reset();
63 void disconnectSignals();
64 void updateDefaultDevices();
65
66 std::unique_ptr<class ServerPrivate> d;
67
68 friend class ServerPrivate;
69 friend class Context;
70 friend class ContextPrivate;
71};
72
73} // PulseAudioQt
74
75#endif // CONTEXT_H
A PulseAudio sink.
Definition sink.h:20
A PulseAudio source.
Definition source.h:20
KGuiItem reset()
The primary namespace of PulseAudioQt.
Definition card.cpp:17
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:18:01 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.