1// Copyright (C) 2022 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
5#ifndef QAUDIODEVICEINFO_P_H
6#define QAUDIODEVICEINFO_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtMultimedia/qaudiodevice.h>
20#include <QtCore/private/qglobal_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class Q_MULTIMEDIA_EXPORT QAudioDevicePrivate : public QSharedData
25{
26public:
27 QAudioDevicePrivate(const QByteArray &i, QAudioDevice::Mode m)
28 : id(i),
29 mode(m)
30 {}
31 virtual ~QAudioDevicePrivate();
32 QByteArray id;
33 QAudioDevice::Mode mode = QAudioDevice::Output;
34 bool isDefault = false;
35
36 QAudioFormat preferredFormat;
37 QString description;
38 int minimumSampleRate = 0;
39 int maximumSampleRate = 0;
40 int minimumChannelCount = 0;
41 int maximumChannelCount = 0;
42 QList<QAudioFormat::SampleFormat> supportedSampleFormats;
43 QAudioFormat::ChannelConfig channelConfiguration = QAudioFormat::ChannelConfigUnknown;
44
45 bool operator == (const QAudioDevicePrivate &other) const
46 {
47 return id == other.id && mode == other.mode && isDefault == other.isDefault
48 && preferredFormat == other.preferredFormat && description == other.description
49 && minimumSampleRate == other.minimumSampleRate
50 && maximumSampleRate == other.maximumSampleRate
51 && minimumChannelCount == other.minimumChannelCount
52 && maximumChannelCount == other.maximumChannelCount
53 && supportedSampleFormats == other.supportedSampleFormats
54 && channelConfiguration == other.channelConfiguration;
55 }
56
57 QAudioDevice create() { return QAudioDevice(this); }
58};
59
60QT_END_NAMESPACE
61
62#endif // QAUDIODEVICEINFO_H
63

source code of qtmultimedia/src/multimedia/audio/qaudiodevice_p.h