mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-12 09:38:20 +00:00
SDL: Use a configurable output device.
This commit is contained in:
parent
141258c366
commit
8751316051
@ -778,6 +778,7 @@ static ConfigSetting soundSettings[] = {
|
||||
ConfigSetting("AudioResampler", &g_Config.bAudioResampler, true, true, true),
|
||||
ConfigSetting("GlobalVolume", &g_Config.iGlobalVolume, VOLUME_MAX, true, true),
|
||||
ConfigSetting("AltSpeedVolume", &g_Config.iAltSpeedVolume, -1, true, true),
|
||||
ConfigSetting("AudioDevice", &g_Config.sAudioDevice, "", true, false),
|
||||
|
||||
ConfigSetting(false),
|
||||
};
|
||||
|
@ -197,6 +197,7 @@ public:
|
||||
int iGlobalVolume;
|
||||
int iAltSpeedVolume;
|
||||
bool bExtraAudioBuffering; // For bluetooth
|
||||
std::string sAudioDevice;
|
||||
|
||||
// UI
|
||||
bool bShowDebuggerOnLoad;
|
||||
|
@ -196,7 +196,16 @@ static int mainInternal(QApplication &a, MainAudioDeviceID &audioDev) {
|
||||
fmt.callback = &mixaudio;
|
||||
fmt.userdata = (void *)0;
|
||||
|
||||
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &ret_fmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
|
||||
audioDev = 0;
|
||||
if (!g_Config.sAudioDevice.empty()) {
|
||||
audioDev = SDL_OpenAudioDevice(g_Config.sAudioDevice.c_str(), 0, &fmt, &ret_fmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
|
||||
if (audioDev <= 0) {
|
||||
WLOG("Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str());
|
||||
}
|
||||
}
|
||||
if (audioDev <= 0) {
|
||||
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &ret_fmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
|
||||
}
|
||||
if (audioDev <= 0) {
|
||||
ELOG("Failed to open audio: %s", SDL_GetError());
|
||||
} else {
|
||||
|
@ -582,7 +582,16 @@ int main(int argc, char *argv[]) {
|
||||
fmt.callback = &mixaudio;
|
||||
fmt.userdata = (void *)0;
|
||||
|
||||
SDL_AudioDeviceID audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &ret_fmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
|
||||
SDL_AudioDeviceID audioDev = 0;
|
||||
if (!g_Config.sAudioDevice.empty()) {
|
||||
audioDev = SDL_OpenAudioDevice(g_Config.sAudioDevice.c_str(), 0, &fmt, &ret_fmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
|
||||
if (audioDev <= 0) {
|
||||
WLOG("Failed to open preferred audio device %s", g_Config.sAudioDevice.c_str());
|
||||
}
|
||||
}
|
||||
if (audioDev <= 0) {
|
||||
audioDev = SDL_OpenAudioDevice(nullptr, 0, &fmt, &ret_fmt, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
|
||||
}
|
||||
if (audioDev <= 0) {
|
||||
ELOG("Failed to open audio: %s", SDL_GetError());
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user