Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qpipewire_audiodevices.cpp
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
5
10
12
13namespace QtPipeWire {
14
16{
17 Q_ASSERT(isSupported());
18
19 QAudioDeviceMonitor::DeviceLists deviceLists =
21
22 m_sourceDeviceList = std::move(deviceLists.sources);
23 m_sinkDeviceList = std::move(deviceLists.sinks);
24
25 connect(&QAudioContextManager::deviceMonitor(), &QAudioDeviceMonitor::audioSinksChanged, this,
26 [this](QList<QAudioDevice> sinks) {
27 m_sinkDeviceList = std::move(sinks);
28 onAudioOutputsChanged();
29 });
30
31 connect(&QAudioContextManager::deviceMonitor(), &QAudioDeviceMonitor::audioSourcesChanged, this,
32 [this](QList<QAudioDevice> sources) {
33 m_sourceDeviceList = std::move(sources);
34 onAudioInputsChanged();
35 });
36}
37
43
45{
46 return m_sourceDeviceList;
47}
48
50{
51 return m_sinkDeviceList;
52}
53
54QPlatformAudioSource *QAudioDevices::createAudioSource(const QAudioDevice &device, const QAudioFormat &format,
55 QObject *parent)
56{
57 return new QPipewireAudioSource(device, format, parent);
58}
59
60QPlatformAudioSink *QAudioDevices::createAudioSink(const QAudioDevice &device, const QAudioFormat &format,
61 QObject *parent)
62{
63 return new QPipewireAudioSink(device, format, parent);
64}
65
66} // namespace QtPipeWire
67
68QT_END_NAMESPACE
DeviceLists getDeviceLists(bool verifyThreading=true)
QPlatformAudioSink * createAudioSink(const QAudioDevice &, const QAudioFormat &, QObject *parent) override
QPlatformAudioSource * createAudioSource(const QAudioDevice &, const QAudioFormat &, QObject *parent) override
QList< QAudioDevice > findAudioOutputs() const override
QList< QAudioDevice > findAudioInputs() const override