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)
29public:
30 ~Server();
31
32 Sink *defaultSink() const;
33 void setDefaultSink(Sink *sink);
34
35 Source *defaultSource() const;
36 void setDefaultSource(Source *source);
37
38 /**
39 * Whether PulseAudio is provided via pipewire-pulse.
40 */
41 bool isPipeWire() const;
42
43Q_SIGNALS:
44 void defaultSinkChanged(PulseAudioQt::Sink *sink);
45 void defaultSourceChanged(PulseAudioQt::Source *source);
46 void isPipeWireChanged();
47 void updated();
48
49private:
50 explicit Server(Context *context);
51
52 void reset();
53 void updateDefaultDevices();
54
55 class ServerPrivate *const d;
56
57 friend class ServerPrivate;
58 friend class Context;
59 friend class ContextPrivate;
60};
61
62} // PulseAudioQt
63
64#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 Tue Mar 26 2024 11:20:07 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.