Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowsmediadevices_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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
4#ifndef QWINDOWSMEDIADEVICES_H
5#define QWINDOWSMEDIADEVICES_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qplatformmediadevices_p.h>
19#include <private/qcomptr_p.h>
20
21#include <qaudiodevice.h>
22
23struct IAudioClient3;
24struct IMMDeviceEnumerator;
25
27
28class QWindowsEngine;
30
32{
33public:
35 virtual ~QWindowsMediaDevices();
36
37 QList<QAudioDevice> audioInputs() const override;
38 QList<QAudioDevice> audioOutputs() const override;
40 QObject *parent) override;
42 QObject *parent) override;
43
44 void prepareAudio() override;
45
46private:
47 QList<QAudioDevice> availableDevices(QAudioDevice::Mode mode) const;
48
49 ComPtr<IMMDeviceEnumerator> m_deviceEnumerator;
50 ComPtr<CMMNotificationClient> m_notificationClient;
51 // The "warm-up" audio client is required to run in the background in order to keep audio engine
52 // ready for audio output immediately after creating any other subsequent audio client.
53 ComPtr<IAudioClient3> m_warmUpAudioClient;
54 std::atomic_bool m_isAudioClientWarmedUp = false;
55
57};
58
60
61#endif
The QAudioDevice class provides an information about audio devices and their functionality.
Mode
Describes the mode of this device.
Definition qlist.h:74
\inmodule QtCore
Definition qobject.h:90
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
QPlatformAudioSink * createAudioSink(const QAudioDevice &deviceInfo, QObject *parent) override
QList< QAudioDevice > audioInputs() const override
QList< QAudioDevice > audioOutputs() const override
QPlatformAudioSource * createAudioSource(const QAudioDevice &deviceInfo, QObject *parent) override
Combined button and popup list for selecting options.
GLenum mode