mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 00:17:25 +02:00
fixed android build
This commit is contained in:
parent
05a8c7853c
commit
a777757c48
4 changed files with 7 additions and 8 deletions
|
@ -19,7 +19,7 @@
|
||||||
#include "SettingHandle.h"
|
#include "SettingHandle.h"
|
||||||
#include "AudioFileWav.h"
|
#include "AudioFileWav.h"
|
||||||
#include <shared/ReadWriteLockable.h>
|
#include <shared/ReadWriteLockable.h>
|
||||||
#include "HifiAudioDeviceInfo.h"
|
#include <HifiAudioDeviceInfo.h>
|
||||||
|
|
||||||
using MutedGetter = std::function<bool()>;
|
using MutedGetter = std::function<bool()>;
|
||||||
using MutedSetter = std::function<void(bool)>;
|
using MutedSetter = std::function<void(bool)>;
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
#include <QAudioDeviceInfo>
|
#include <QAudioDeviceInfo>
|
||||||
|
|
||||||
#include "HifiAudioDeviceInfo.h"
|
#include <HifiAudioDeviceInfo.h>
|
||||||
|
|
||||||
namespace scripting {
|
namespace scripting {
|
||||||
|
|
||||||
|
|
|
@ -634,7 +634,7 @@ HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
||||||
for (auto inputDevice : inputDevices) {
|
for (auto inputDevice : inputDevices) {
|
||||||
if (((headsetOn || !aecEnabled) && inputDevice.deviceName() == VOICE_RECOGNITION) ||
|
if (((headsetOn || !aecEnabled) && inputDevice.deviceName() == VOICE_RECOGNITION) ||
|
||||||
((!headsetOn && aecEnabled) && inputDevice.deviceName() == VOICE_COMMUNICATION)) {
|
((!headsetOn && aecEnabled) && inputDevice.deviceName() == VOICE_COMMUNICATION)) {
|
||||||
return inputDevice;
|
return HifiAudioDeviceInfo(inputDevice,false,QAudio::AudioInput);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2025,11 +2025,11 @@ void AudioClient::checkInputTimeout() {
|
||||||
|
|
||||||
void AudioClient::setHeadsetPluggedIn(bool pluggedIn) {
|
void AudioClient::setHeadsetPluggedIn(bool pluggedIn) {
|
||||||
#if defined(Q_OS_ANDROID)
|
#if defined(Q_OS_ANDROID)
|
||||||
if (pluggedIn == !_isHeadsetPluggedIn && !_inputDeviceInfo.isNull()) {
|
if (pluggedIn == !_isHeadsetPluggedIn && !_inputDeviceInfo.getDevice().isNull()) {
|
||||||
QAndroidJniObject brand = QAndroidJniObject::getStaticObjectField<jstring>("android/os/Build", "BRAND");
|
QAndroidJniObject brand = QAndroidJniObject::getStaticObjectField<jstring>("android/os/Build", "BRAND");
|
||||||
// some samsung phones needs more time to shutdown the previous input device
|
// some samsung phones needs more time to shutdown the previous input device
|
||||||
if (brand.toString().contains("samsung", Qt::CaseInsensitive)) {
|
if (brand.toString().contains("samsung", Qt::CaseInsensitive)) {
|
||||||
switchInputToAudioDevice(QAudioDeviceInfo(), true);
|
switchInputToAudioDevice(HifiAudioDeviceInfo(), true);
|
||||||
QThread::msleep(200);
|
QThread::msleep(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,10 +33,9 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
HifiAudioDeviceInfo(QAudioDeviceInfo deviceInfo, bool isDefault, QAudio::Mode mode) :
|
HifiAudioDeviceInfo(QAudioDeviceInfo deviceInfo, bool isDefault, QAudio::Mode mode) :
|
||||||
|
_audioDeviceInfo(deviceInfo),
|
||||||
_isDefault(isDefault),
|
_isDefault(isDefault),
|
||||||
_mode(mode),
|
_mode(mode){
|
||||||
_audioDeviceInfo(deviceInfo){
|
|
||||||
|
|
||||||
setDeviceName(deviceInfo.deviceName());
|
setDeviceName(deviceInfo.deviceName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue