Rename 'Default' audio backend to 'SDL'

This commit is contained in:
Connor McLaughlin 2020-02-16 00:14:35 +09:00
parent d17f0a3923
commit 1e009133ae
8 changed files with 20 additions and 14 deletions

View file

@ -681,7 +681,7 @@ void HostInterface::SetDefaultSettings()
m_settings.display_fullscreen = false; m_settings.display_fullscreen = false;
m_settings.video_sync_enabled = true; m_settings.video_sync_enabled = true;
m_settings.audio_backend = AudioBackend::Default; m_settings.audio_backend = AudioBackend::Cubeb;
m_settings.audio_sync_enabled = true; m_settings.audio_sync_enabled = true;
m_settings.bios_path = GetUserDirectoryRelativePath("bios/scph1001.bin"); m_settings.bios_path = GetUserDirectoryRelativePath("bios/scph1001.bin");

View file

@ -29,7 +29,7 @@ void Settings::Load(SettingsInterface& si)
video_sync_enabled = si.GetBoolValue("Display", "VSync", true); video_sync_enabled = si.GetBoolValue("Display", "VSync", true);
audio_backend = audio_backend =
ParseAudioBackend(si.GetStringValue("Audio", "Backend", "Default").c_str()).value_or(AudioBackend::Default); ParseAudioBackend(si.GetStringValue("Audio", "Backend", "Cubeb").c_str()).value_or(AudioBackend::Cubeb);
audio_sync_enabled = si.GetBoolValue("Audio", "Sync", true); audio_sync_enabled = si.GetBoolValue("Audio", "Sync", true);
bios_path = si.GetStringValue("BIOS", "Path", "scph1001.bin"); bios_path = si.GetStringValue("BIOS", "Path", "scph1001.bin");
@ -203,8 +203,8 @@ const char* Settings::GetRendererDisplayName(GPURenderer renderer)
return s_gpu_renderer_display_names[static_cast<int>(renderer)]; return s_gpu_renderer_display_names[static_cast<int>(renderer)];
} }
static std::array<const char*, 3> s_audio_backend_names = {{"Null", "Default", "Cubeb"}}; static std::array<const char*, 3> s_audio_backend_names = {{"Null", "Cubeb", "SDL"}};
static std::array<const char*, 3> s_audio_backend_display_names = {{"Null (No Output)", "Default", "Cubeb"}}; static std::array<const char*, 3> s_audio_backend_display_names = {{"Null (No Output)", "Cubeb", "SDL"}};
std::optional<AudioBackend> Settings::ParseAudioBackend(const char* str) std::optional<AudioBackend> Settings::ParseAudioBackend(const char* str)
{ {

View file

@ -50,7 +50,7 @@ struct Settings
bool display_fullscreen = false; bool display_fullscreen = false;
bool video_sync_enabled = true; bool video_sync_enabled = true;
AudioBackend audio_backend = AudioBackend::Default; AudioBackend audio_backend = AudioBackend::Cubeb;
bool audio_sync_enabled = true; bool audio_sync_enabled = true;
struct DebugSettings struct DebugSettings

View file

@ -52,8 +52,8 @@ enum class GPURenderer : u8
enum class AudioBackend : u8 enum class AudioBackend : u8
{ {
Null, Null,
Default,
Cubeb, Cubeb,
SDL,
Count Count
}; };

View file

@ -252,13 +252,12 @@ std::unique_ptr<AudioStream> QtHostInterface::CreateAudioStream(AudioBackend bac
{ {
switch (backend) switch (backend)
{ {
case AudioBackend::Default:
case AudioBackend::Cubeb:
return AudioStream::CreateCubebAudioStream();
case AudioBackend::Null: case AudioBackend::Null:
return AudioStream::CreateNullAudioStream(); return AudioStream::CreateNullAudioStream();
case AudioBackend::Cubeb:
return AudioStream::CreateCubebAudioStream();
default: default:
return nullptr; return nullptr;
} }

View file

@ -93,7 +93,7 @@ bool SDLHostInterface::CreateDisplay()
std::unique_ptr<HostDisplay> display; std::unique_ptr<HostDisplay> display;
#ifdef WIN32 #ifdef WIN32
display = UseOpenGLRenderer() ? OpenGLHostDisplay::Create(m_window, debug_device) : display = UseOpenGLRenderer() ? OpenGLHostDisplay::Create(m_window, debug_device) :
D3D11HostDisplay::Create(m_window, debug_device); D3D11HostDisplay::Create(m_window, debug_device);
#else #else
display = OpenGLHostDisplay::Create(m_window, debug_device); display = OpenGLHostDisplay::Create(m_window, debug_device);
#endif #endif
@ -162,7 +162,7 @@ void SDLHostInterface::ReleaseHostDisplay()
std::unique_ptr<AudioStream> SDLHostInterface::CreateAudioStream(AudioBackend backend) std::unique_ptr<AudioStream> SDLHostInterface::CreateAudioStream(AudioBackend backend)
{ {
switch (m_settings.audio_backend) switch (backend)
{ {
case AudioBackend::Null: case AudioBackend::Null:
return AudioStream::CreateNullAudioStream(); return AudioStream::CreateNullAudioStream();
@ -170,8 +170,8 @@ std::unique_ptr<AudioStream> SDLHostInterface::CreateAudioStream(AudioBackend ba
case AudioBackend::Cubeb: case AudioBackend::Cubeb:
return AudioStream::CreateCubebAudioStream(); return AudioStream::CreateCubebAudioStream();
case AudioBackend::Default: case AudioBackend::SDL:
return std::make_unique<SDLAudioStream>(); return SDLAudioStream::Create();
default: default:
return nullptr; return nullptr;

View file

@ -12,6 +12,11 @@ SDLAudioStream::~SDLAudioStream()
SDLAudioStream::CloseDevice(); SDLAudioStream::CloseDevice();
} }
std::unique_ptr<SDLAudioStream> SDLAudioStream::Create()
{
return std::make_unique<SDLAudioStream>();
}
bool SDLAudioStream::OpenDevice() bool SDLAudioStream::OpenDevice()
{ {
DebugAssert(!m_is_open); DebugAssert(!m_is_open);

View file

@ -8,6 +8,8 @@ public:
SDLAudioStream(); SDLAudioStream();
~SDLAudioStream(); ~SDLAudioStream();
static std::unique_ptr<SDLAudioStream> Create();
protected: protected:
bool OpenDevice() override; bool OpenDevice() override;
void PauseDevice(bool paused) override; void PauseDevice(bool paused) override;