mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 15:13:09 +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 "AudioFileWav.h"
|
||||
#include <shared/ReadWriteLockable.h>
|
||||
#include "HifiAudioDeviceInfo.h"
|
||||
#include <HifiAudioDeviceInfo.h>
|
||||
|
||||
using MutedGetter = std::function<bool()>;
|
||||
using MutedSetter = std::function<void(bool)>;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <QAbstractListModel>
|
||||
#include <QAudioDeviceInfo>
|
||||
|
||||
#include "HifiAudioDeviceInfo.h"
|
||||
#include <HifiAudioDeviceInfo.h>
|
||||
|
||||
namespace scripting {
|
||||
|
||||
|
|
|
@ -634,7 +634,7 @@ HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
|||
for (auto inputDevice : inputDevices) {
|
||||
if (((headsetOn || !aecEnabled) && inputDevice.deviceName() == VOICE_RECOGNITION) ||
|
||||
((!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) {
|
||||
#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");
|
||||
// some samsung phones needs more time to shutdown the previous input device
|
||||
if (brand.toString().contains("samsung", Qt::CaseInsensitive)) {
|
||||
switchInputToAudioDevice(QAudioDeviceInfo(), true);
|
||||
switchInputToAudioDevice(HifiAudioDeviceInfo(), true);
|
||||
QThread::msleep(200);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,10 +33,9 @@ public:
|
|||
}
|
||||
|
||||
HifiAudioDeviceInfo(QAudioDeviceInfo deviceInfo, bool isDefault, QAudio::Mode mode) :
|
||||
_audioDeviceInfo(deviceInfo),
|
||||
_isDefault(isDefault),
|
||||
_mode(mode),
|
||||
_audioDeviceInfo(deviceInfo){
|
||||
|
||||
_mode(mode){
|
||||
setDeviceName(deviceInfo.deviceName());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue