1 | // Copyright (C) 2016 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_H |
6 | #define QAUDIODEVICEINFO_H |
7 | |
8 | #include <QtCore/qobject.h> |
9 | #include <QtCore/qbytearray.h> |
10 | #include <QtCore/qstring.h> |
11 | #include <QtCore/qstringlist.h> |
12 | #include <QtCore/qlist.h> |
13 | |
14 | #include <QtMultimedia/qtmultimediaglobal.h> |
15 | |
16 | #include <QtMultimedia/qaudio.h> |
17 | #include <QtMultimedia/qaudioformat.h> |
18 | |
19 | QT_BEGIN_NAMESPACE |
20 | |
21 | class QAudioDevicePrivate; |
22 | QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QAudioDevicePrivate, Q_MULTIMEDIA_EXPORT) |
23 | |
24 | class Q_MULTIMEDIA_EXPORT QAudioDevice |
25 | { |
26 | Q_GADGET |
27 | Q_PROPERTY(QByteArray id READ id CONSTANT) |
28 | Q_PROPERTY(QString description READ description CONSTANT) |
29 | Q_PROPERTY(bool isDefault READ isDefault CONSTANT) |
30 | Q_PROPERTY(Mode mode READ mode CONSTANT) |
31 | public: |
32 | enum Mode { |
33 | Null, |
34 | Input, |
35 | Output |
36 | }; |
37 | Q_ENUM(Mode) |
38 | |
39 | QAudioDevice(); |
40 | QAudioDevice(const QAudioDevice& other); |
41 | ~QAudioDevice(); |
42 | |
43 | QAudioDevice(QAudioDevice &&other) noexcept = default; |
44 | QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QAudioDevice) |
45 | void swap(QAudioDevice &other) noexcept |
46 | { d.swap(other&: other.d); } |
47 | |
48 | QAudioDevice& operator=(const QAudioDevice& other); |
49 | |
50 | bool operator==(const QAudioDevice &other) const; |
51 | bool operator!=(const QAudioDevice &other) const; |
52 | |
53 | bool isNull() const; |
54 | |
55 | QByteArray id() const; |
56 | QString description() const; |
57 | |
58 | bool isDefault() const; |
59 | QAudioDevice::Mode mode() const; |
60 | |
61 | bool isFormatSupported(const QAudioFormat &format) const; |
62 | QAudioFormat preferredFormat() const; |
63 | |
64 | int minimumSampleRate() const; |
65 | int maximumSampleRate() const; |
66 | int minimumChannelCount() const; |
67 | int maximumChannelCount() const; |
68 | QList<QAudioFormat::SampleFormat> supportedSampleFormats() const; |
69 | QAudioFormat::ChannelConfig channelConfiguration() const; |
70 | |
71 | const QAudioDevicePrivate *handle() const { return d.get(); } |
72 | private: |
73 | friend class QAudioDevicePrivate; |
74 | QAudioDevice(QAudioDevicePrivate *p); |
75 | QExplicitlySharedDataPointer<QAudioDevicePrivate> d; |
76 | }; |
77 | |
78 | #ifndef QT_NO_DEBUG_STREAM |
79 | Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QAudioDevice::Mode mode); |
80 | #endif |
81 | |
82 | QT_END_NAMESPACE |
83 | |
84 | #endif // QAUDIODEVICEINFO_H |
85 |