Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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#include <QtCore/private/qfunctions_win_p.h>
21#include <private/qwindowsmediafoundation_p.h>
22
23#include <qaudiodevice.h>
24
25struct IAudioClient3;
26struct IMMDeviceEnumerator;
27
29
30class QWindowsEngine;
32
34{
35public:
37 virtual ~QWindowsMediaDevices();
38
39 QList<QAudioDevice> audioInputs() const override;
40 QList<QAudioDevice> audioOutputs() const override;
42 QObject *parent) override;
44 QObject *parent) override;
45
46 void prepareAudio() override;
47
48private:
49 QComHelper m_comRuntime;
51 QList<QAudioDevice> availableDevices(QAudioDevice::Mode mode) const;
52
53 ComPtr<IMMDeviceEnumerator> m_deviceEnumerator;
54 ComPtr<CMMNotificationClient> m_notificationClient;
55 // The "warm-up" audio client is required to run in the background in order to keep audio engine
56 // ready for audio output immediately after creating any other subsequent audio client.
57 ComPtr<IAudioClient3> m_warmUpAudioClient;
58 std::atomic_bool m_isAudioClientWarmedUp = false;
59
61};
62
64
65#endif
The QAudioDevice class provides an information about audio devices and their functionality.
Mode
Describes the mode of this device.
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
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
static QWindowsMediaFoundation * instance()
Combined button and popup list for selecting options.
GLenum mode