Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qandroidaudiodevice.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
4
#
include
"qandroidaudiodevice_p.h"
5
6
#
include
<
private
/
qaudioformat_p
.
h
>
7
#
include
<
private
/
qaudiodevice_p
.
h
>
8
9
#
include
<
QtCore
/
qjniobject
.
h
>
10
11
QT_BEGIN_NAMESPACE
12
13
namespace
{
14
15
QAudioDevicePrivate
::
AudioDeviceFormat
16
createAndroidAudioDeviceFormatFromPreferred
(
const
QAudioFormat &preferredFormat)
17
{
18
QAudioDevicePrivate::AudioDeviceFormat format;
19
20
format.preferredFormat = preferredFormat;
21
22
// Report support for everything that Qt supports, as Android should be able to resample and
23
// up/downmix if needed
24
format.minimumChannelCount = 1;
25
format.maximumChannelCount = 32;
26
format.minimumSampleRate = QtMultimediaPrivate::allSupportedSampleRates.front();
27
format.maximumSampleRate = QtMultimediaPrivate::allSupportedSampleRates.back();
28
format.supportedSampleFormats = qAllSupportedSampleFormats();
29
format.channelConfiguration = preferredFormat.channelConfig();
30
31
return
format;
32
}
33
34
}
// namespace
35
36
QAndroidAudioDevice::QAndroidAudioDevice(QByteArray device, QString desc, QAudioDevice::Mode mode,
37
QAudioFormat format,
bool
isBluetoothDevice,
38
bool
isDefaultDevice)
39
: QAudioDevicePrivate{ std::move(device), mode, std::move(desc), isDefaultDevice,
40
createAndroidAudioDeviceFormatFromPreferred(format) },
41
m_isBluetoothDevice(isBluetoothDevice)
42
{
43
}
44
45
bool
QAndroidAudioDevice::isBluetoothDevice()
const
46
{
47
return
m_isBluetoothDevice;
48
}
49
50
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QT_BEGIN_NAMESPACE::createAndroidAudioDeviceFormatFromPreferred
QAudioDevicePrivate::AudioDeviceFormat createAndroidAudioDeviceFormatFromPreferred(const QAudioFormat &preferredFormat)
Definition
qandroidaudiodevice.cpp:16
qtmultimedia
src
multimedia
android
qandroidaudiodevice.cpp
Generated on
for Qt by
1.18.0