mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 09:59:20 +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 outputDevices = getAvailableDevices(QAudio::AudioOutput);
|
||||||
|
|
||||||
auto defInput = defaultAudioDeviceForMode(QAudio::AudioInput);
|
auto defInput = defaultAudioDeviceForMode(QAudio::AudioInput);
|
||||||
defInput.setIsDefault(true);
|
|
||||||
|
|
||||||
auto defOutput = defaultAudioDeviceForMode(QAudio::AudioOutput);
|
auto defOutput = defaultAudioDeviceForMode(QAudio::AudioOutput);
|
||||||
defOutput.setIsDefault(true);
|
|
||||||
|
|
||||||
//add the pseudo device to the list of devices
|
//add the pseudo device to the list of devices
|
||||||
inputDevices.push_front(defInput);
|
inputDevices.push_front(defInput);
|
||||||
|
@ -613,8 +610,8 @@ HifiAudioDeviceInfo defaultAudioDeviceForMode(QAudio::Mode mode) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
// fallback for failed lookup is the default device
|
// fallback for failed lookup is the default device
|
||||||
return (mode == QAudio::AudioInput) ? HifiAudioDeviceInfo(QAudioDeviceInfo::defaultInputDevice(), false, QAudio::AudioInput) :
|
return (mode == QAudio::AudioInput) ? HifiAudioDeviceInfo(QAudioDeviceInfo::defaultInputDevice(), true, QAudio::AudioInput) :
|
||||||
HifiAudioDeviceInfo(QAudioDeviceInfo::defaultOutputDevice(), false, QAudio::AudioOutput);
|
HifiAudioDeviceInfo(QAudioDeviceInfo::defaultOutputDevice(), true, QAudio::AudioOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AudioClient::getNamedAudioDeviceForModeExists(QAudio::Mode mode, const QString& deviceName) {
|
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() {
|
void AudioClient::configureReverb() {
|
||||||
ReverbParameters p;
|
ReverbParameters p;
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ public slots:
|
||||||
|
|
||||||
// calling with a null QAudioDevice will use the system default
|
// 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 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
|
// Qt opensles plugin is not able to detect when the headset is plugged in
|
||||||
void setHeadsetPluggedIn(bool pluggedIn);
|
void setHeadsetPluggedIn(bool pluggedIn);
|
||||||
|
|
||||||
|
|
|
@ -40,10 +40,12 @@ public:
|
||||||
void setIsDefault(bool isDefault = false) { _isDefault = isDefault; }
|
void setIsDefault(bool isDefault = false) { _isDefault = isDefault; }
|
||||||
void setDevice(QAudioDeviceInfo devInfo);
|
void setDevice(QAudioDeviceInfo devInfo);
|
||||||
QString deviceName() const {
|
QString deviceName() const {
|
||||||
|
#if defined(Q_OS_ANDROID)
|
||||||
|
return _audioDeviceInfo.deviceName();
|
||||||
|
#endif
|
||||||
if (_isDefault) {
|
if (_isDefault) {
|
||||||
return "default";
|
return "default";
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return _audioDeviceInfo.deviceName();
|
return _audioDeviceInfo.deviceName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue