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
qandroidaudioinput.cpp
Go to the documentation of this file.
1
// Copyright (C) 2021 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
"qandroidaudioinput_p.h"
5
6
#
include
<
qaudioinput
.
h
>
7
8
#
include
<
QtCore
/
qjniobject
.
h
>
9
10
QT_BEGIN_NAMESPACE
11
12
QAndroidAudioInput::QAndroidAudioInput(QAudioInput *parent)
13
: QObject(parent),
14
QPlatformAudioInput(parent)
15
{
16
m_muted = isMuted();
17
}
18
19
QAndroidAudioInput::~QAndroidAudioInput()
20
{
21
setMuted(m_muted);
22
}
23
24
void
QAndroidAudioInput::setMuted(
bool
muted)
25
{
26
bool
isInputMuted = isMuted();
27
if
(muted != isInputMuted) {
28
QJniObject::callStaticMethod<
void
>(
29
"org/qtproject/qt/android/multimedia/QtAudioDeviceManager"
,
30
"setInputMuted"
,
31
"(Z)V"
,
32
muted);
33
emit mutedChanged(muted);
34
}
35
}
36
37
bool
QAndroidAudioInput::isMuted()
const
38
{
39
return
QJniObject::callStaticMethod<jboolean>(
40
"org/qtproject/qt/android/multimedia/QtAudioDeviceManager"
,
41
"isMicrophoneMute"
,
42
"()Z"
);
43
}
44
45
QT_END_NAMESPACE
46
47
#
include
"moc_qandroidaudioinput_p.cpp"
QPlatformGraphicsBufferHelper
\inmodule QtGui
qtmultimedia
src
plugins
multimedia
android
common
qandroidaudioinput.cpp
Generated on
for Qt by
1.14.0