Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpulseaudiodevice.cpp
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
6#include "qpulsehelpers_p.h"
7
9
12{
14 isDefault = isDef;
15
17 maximumChannelCount = PA_CHANNELS_MAX;
19 maximumSampleRate = PA_RATE_MAX;
20
21 constexpr bool isBigEndian = QSysInfo::ByteOrder == QSysInfo::BigEndian;
22
23 const struct {
24 pa_sample_format pa_fmt;
26 } formatMap[] = {
27 { PA_SAMPLE_U8, QAudioFormat::UInt8 },
28 { isBigEndian ? PA_SAMPLE_S16BE : PA_SAMPLE_S16LE, QAudioFormat::Int16 },
29 { isBigEndian ? PA_SAMPLE_S32BE : PA_SAMPLE_S32LE, QAudioFormat::Int32 },
30 { isBigEndian ? PA_SAMPLE_FLOAT32BE : PA_SAMPLE_FLOAT32LE, QAudioFormat::Float },
31 };
32
33 for (const auto &f : formatMap) {
34 if (pa_sample_format_valid(f.pa_fmt) != 0)
36 }
37
44}
45
IOBluetoothDevice * device
QAudioFormat preferredFormat
QList< QAudioFormat::SampleFormat > supportedSampleFormats
Mode
Describes the mode of this device.
constexpr void setSampleRate(int sampleRate) noexcept
Sets the sample rate to samplerate in Hertz.
SampleFormat
Qt will always expect and use samples in the endianness of the host platform.
constexpr void setSampleFormat(SampleFormat f) noexcept
Sets the sample format to format.
constexpr void setChannelCount(int channelCount) noexcept
Sets the channel count to channels.
T value(qsizetype i) const
Definition qlist.h:664
void append(parameter_type t)
Definition qlist.h:458
QPulseAudioDeviceInfo(const char *device, const char *description, bool isDefault, QAudioDevice::Mode mode)
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:6018
@ BigEndian
Definition qsysinfo.h:29
@ ByteOrder
Definition qsysinfo.h:34
Combined button and popup list for selecting options.
GLenum mode
GLfloat GLfloat f
static const struct @731 formatMap[]
bool contains(const AT &t) const noexcept
Definition qlist.h:45