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
qaudiodevice.h
Go to the documentation of this file.
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/qtaudio.h>
17#include <QtMultimedia/qaudioformat.h>
18
20
21class QAudioDevicePrivate;
22QT_DECLARE_QESDP_SPECIALIZATION_DTOR_WITH_EXPORT(QAudioDevicePrivate, Q_MULTIMEDIA_EXPORT)
23
24class 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)
31public:
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.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#if QT_DEPRECATED_SINCE(6, 10)
72 QT_DEPRECATED_VERSION_X_6_10("The method is internal and deprecated")
73 const QAudioDevicePrivate *handle() const { return d.get(); }
74#endif
75private:
76 friend class QAudioDevicePrivate;
77 explicit QAudioDevice(QAudioDevicePrivate *p);
78 QExplicitlySharedDataPointer<QAudioDevicePrivate> d;
79};
80
81#ifndef QT_NO_DEBUG_STREAM
82Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QAudioDevice::Mode mode);
83#endif
84
85QT_END_NAMESPACE
86
87#endif // QAUDIODEVICEINFO_H
The QAudioDevice class provides an information about audio devices and their functionality.
\qmltype AudioInput \nativetype QAudioInput
Definition qaudioinput.h:19
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568