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