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#ifndef QAUDIO_H
5#define QAUDIO_H
6
7#if 0
8#pragma qt_class(QAudio)
9#endif
10
11#include <QtMultimedia/qtmultimediaglobal.h>
12
13QT_BEGIN_NAMESPACE
14
15// ### Qt7: merge the QAudio namespace into QtAudio
16#if defined(Q_QDOC)
17namespace QtAudio
18#else
19namespace QAudio
20#endif
21{
22enum Error
23{
24 NoError,
25 OpenError,
26 IOError,
27 UnderrunError,
28 FatalError,
29};
30enum State
31{
32 ActiveState,
33 SuspendedState,
34 StoppedState,
35 IdleState,
36};
37
38enum VolumeScale
39{
40 LinearVolumeScale,
41 CubicVolumeScale,
42 LogarithmicVolumeScale,
43 DecibelVolumeScale,
44};
45
46} // namespace QtAudio
47
48
49namespace QtAudio {
50
51#if !defined(Q_QDOC)
52using Error = QAudio::Error;
53using State = QAudio::State;
54using VolumeScale = QAudio::VolumeScale;
55
56inline constexpr auto NoError = QAudio::NoError;
57inline constexpr auto OpenError = QAudio::OpenError;
58inline constexpr auto IOError = QAudio::IOError;
59inline constexpr auto UnderrunError = QAudio::UnderrunError;
60inline constexpr auto FatalError = QAudio::FatalError;
61inline constexpr auto ActiveState = QAudio::ActiveState;
62inline constexpr auto SuspendedState = QAudio::SuspendedState;
63inline constexpr auto StoppedState = QAudio::StoppedState;
64inline constexpr auto IdleState = QAudio::IdleState;
65inline constexpr auto LinearVolumeScale = QAudio::LinearVolumeScale;
66inline constexpr auto CubicVolumeScale = QAudio::CubicVolumeScale;
67inline constexpr auto LogarithmicVolumeScale = QAudio::LogarithmicVolumeScale;
68inline constexpr auto DecibelVolumeScale = QAudio::DecibelVolumeScale;
69#endif
70
71Q_MULTIMEDIA_EXPORT float convertVolume(float volume, VolumeScale from, VolumeScale to);
72
73} // namespace QtAudio
74
75
76#if !defined(Q_QDOC)
77namespace QAudio
78{
79#if QT_CORE_REMOVED_SINCE(6, 10)
80Q_MULTIMEDIA_EXPORT float convertVolume(float volume, VolumeScale from, VolumeScale to);
81#elif !defined(QT_MULTIMEDIA_BUILD_REMOVED_API)
82using QtAudio::convertVolume;
83#endif
84} // namespace QAudio
85#endif
86
87#ifndef QT_NO_DEBUG_STREAM
88Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QtAudio::Error error);
89Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QtAudio::State state);
90Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug dbg, QtAudio::VolumeScale role);
91#endif
92
93QT_END_NAMESPACE
94
95#endif // QAUDIO_H
96

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