blob: 6001fb700f7f480a114e56175b9185c8d79fb482 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#include "qandroidaudioinput_p.h"
#include <qaudioinput.h>
#include <QtCore/qjniobject.h>
QT_BEGIN_NAMESPACE
QAndroidAudioInput::QAndroidAudioInput(QAudioInput *parent)
: QObject(parent),
QPlatformAudioInput(parent)
{
m_muted = isMuted();
}
QAndroidAudioInput::~QAndroidAudioInput()
{
setMuted(m_muted);
}
void QAndroidAudioInput::setMuted(bool muted)
{
bool isInputMuted = isMuted();
if (muted != isInputMuted) {
QJniObject::callStaticMethod<void>(
"org/qtproject/qt/android/multimedia/QtAudioDeviceManager",
"setInputMuted",
"(Z)V",
muted);
emit mutedChanged(muted);
}
}
bool QAndroidAudioInput::isMuted() const
{
return QJniObject::callStaticMethod<jboolean>(
"org/qtproject/qt/android/multimedia/QtAudioDeviceManager",
"isMicrophoneMute",
"()Z");
}
QT_END_NAMESPACE
|