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
qaudiohelpers_p.h
Go to the documentation of this file.
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#ifndef QAUDIOHELPERS_P_H
5#define QAUDIOHELPERS_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qspan.h>
19#include <QtMultimedia/qaudioformat.h>
20#include <QtMultimedia/private/qtmultimediaglobal_p.h>
21#include <QtMultimedia/private/qaudio_rtsan_support_p.h>
22
23QT_BEGIN_NAMESPACE
24
25namespace QAudioHelperInternal {
27 const QAudioFormat &format,
28 const void *src,
29 void *dest,
30 int len) noexcept QT_MM_NONBLOCKING;
31
33void applyVolume(float volume,
34 const QAudioFormat &,
35 QSpan<const std::byte> source,
37
46
51
55QAudioFormat::SampleFormat bestSampleFormat(NativeSampleFormat);
56
57NativeSampleFormat toNativeSampleFormat(QAudioFormat::SampleFormat);
58
60{
61 switch (fmt) {
63 return 1;
65 return 2;
67 return 3;
71 return 4;
72 default:
74 }
75}
76
77std::optional<float> sanitizeVolume(float volume, float lastVolume);
78
79} // namespace QAudioHelperInternal
80
82QDebug operator<<(QDebug dbg, QAudioHelperInternal::NativeSampleFormat);
83
84QT_END_NAMESPACE
85
86#endif // QAUDIOHELPERS_P_H
QT_MM_MAKE_STRING_RESOLVER(QAudioHelperInternal::NativeSampleFormat, QtMultimediaPrivate::EnumName,(QAudioHelperInternal::NativeSampleFormat::uint8_t, "uint8_t")(QAudioHelperInternal::NativeSampleFormat::int16_t, "int16_t")(QAudioHelperInternal::NativeSampleFormat::int32_t, "int32_t")(QAudioHelperInternal::NativeSampleFormat::int24_t_3b, "int24_t_3b")(QAudioHelperInternal::NativeSampleFormat::int24_t_4b_low, "int24_t_4b_low")(QAudioHelperInternal::NativeSampleFormat::float32_t, "float32_t"))
#define QT_MM_RESTRICT
QT_MM_DEFINE_QDEBUG_ENUM(QAudioHelperInternal::NativeSampleFormat)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
Definition qdir.cpp:2568