mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 07:47:30 +02:00
fixing android build, I removed a function thinking it was unused. also added android ifdef guards for name since default does to exist on that device. Simplified getting a default device
This commit is contained in:
parent
8d7c28fe83
commit
7fbce46e30
3 changed files with 11 additions and 8 deletions
|
@ -121,10 +121,7 @@ void AudioClient::checkDevices() {
|
|||
auto outputDevices = getAvailableDevices(QAudio::AudioOutput);
|
||||
|
||||
auto defInput = defaultAudioDeviceForMode(QAudio::AudioInput);
|
||||
defInput.setIsDefault(true);
|
||||
|
||||
auto defOutput = defaultAudioDeviceForMode(QAudio::AudioOutput);
|
||||
defOutput.setIsDefault(true);
|
||||
|
||||
//add the pseudo device to the list of devices
|
||||
inputDevices.push_front(defInput);
|
||||
|
@ -613,8 +610,8 @@ HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
|||
}
|
||||
#endif
|
||||
// fallback for failed lookup is the default device
|
||||
return (mode == QAudio::AudioInput) ? HifiAudioDeviceInfo(QAudioDeviceInfo::defaultInputDevice(), false, QAudio::AudioInput) :
|
||||
HifiAudioDeviceInfo(QAudioDeviceInfo::defaultOutputDevice(), false, QAudio::AudioOutput);
|
||||
return (mode == QAudio::AudioInput) ? HifiAudioDeviceInfo(QAudioDeviceInfo::defaultInputDevice(), true, QAudio::AudioInput) :
|
||||
HifiAudioDeviceInfo(QAudioDeviceInfo::defaultOutputDevice(), true, QAudio::AudioOutput);
|
||||
}
|
||||
|
||||
bool AudioClient::getNamedAudioDeviceForModeExists(QAudio::Mode mode, const QString& deviceName) {
|
||||
|
@ -1017,6 +1014,10 @@ bool AudioClient::switchAudioDevice(QAudio::Mode mode, const HifiAudioDeviceInfo
|
|||
}
|
||||
}
|
||||
|
||||
bool AudioClient::switchAudioDevice(QAudio::Mode mode, const QString& deviceName) {
|
||||
return switchAudioDevice(mode, getNamedAudioDeviceForMode(mode, deviceName));
|
||||
}
|
||||
|
||||
void AudioClient::configureReverb() {
|
||||
ReverbParameters p;
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ public slots:
|
|||
|
||||
// calling with a null QAudioDevice will use the system default
|
||||
bool switchAudioDevice(QAudio::Mode mode, const HifiAudioDeviceInfo& deviceInfo = HifiAudioDeviceInfo());
|
||||
|
||||
bool switchAudioDevice(QAudio::Mode mode, const QString& deviceName);
|
||||
// Qt opensles plugin is not able to detect when the headset is plugged in
|
||||
void setHeadsetPluggedIn(bool pluggedIn);
|
||||
|
||||
|
|
|
@ -40,10 +40,12 @@ public:
|
|||
void setIsDefault(bool isDefault = false) { _isDefault = isDefault; }
|
||||
void setDevice(QAudioDeviceInfo devInfo);
|
||||
QString deviceName() const {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
return _audioDeviceInfo.deviceName();
|
||||
#endif
|
||||
if (_isDefault) {
|
||||
return "default";
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return _audioDeviceInfo.deviceName();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue