Merge pull request #13229 from shenweip/UsbMic

Add basic Microphone support on Windows.
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2020-08-01 19:26:35 +02:00
commit 45b05b386b
15 files changed
+754 -70

No files matched your search

+13
View File
@@ -60,6 +60,7 @@
#include "Core/TextureReplacer.h"
#include "Core/WebServer.h"
#include "Core/HLE/sceUsbCam.h"
#include "Core/HLE/sceUsbMic.h"
#include "GPU/Common/PostShader.h"
#include "android/jni/TestRunner.h"
#include "GPU/GPUInterface.h"
@@ -547,6 +548,13 @@ void GameSettingsScreen::CreateViews() {
}
#endif
std::vector<std::string> micList = Microphone::getDeviceList();
if (micList.size() >= 1) {
audioSettings->Add(new ItemHeader(gr->T("Microphone")));
PopupMultiChoiceDynamic *MicChoice = audioSettings->Add(new PopupMultiChoiceDynamic(&g_Config.sMicDevice, gr->T("Microphone Device"), micList, nullptr, screenManager()));
MicChoice->OnChoice.Handle(this, &GameSettingsScreen::OnMicDeviceChange);
}
#if defined(SDL)
std::vector<std::string> audioDeviceList;
SplitString(System_GetProperty(SYSPROP_AUDIO_DEVICE_LIST), '\0', audioDeviceList);
@@ -1312,6 +1320,11 @@ UI::EventReturn GameSettingsScreen::OnCameraDeviceChange(UI::EventParams& e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnMicDeviceChange(UI::EventParams& e) {
Microphone::onMicDeviceChange();
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnAudioDevice(UI::EventParams &e) {
auto a = GetI18NCategory("Audio");
if (g_Config.sAudioDevice == a->T("Auto")) {