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.video_sync_enabled = true;
m_settings.audio_backend = AudioBackend::Default;
m_settings.audio_backend = AudioBackend::Cubeb;
m_settings.audio_sync_enabled = true;
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);
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);
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)];
}
static std::array<const char*, 3> s_audio_backend_names = {{"Null", "Default", "Cubeb"}};
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_names = {{"Null", "Cubeb", "SDL"}};
static std::array<const char*, 3> s_audio_backend_display_names = {{"Null (No Output)", "Cubeb", "SDL"}};
std::optional<AudioBackend> Settings::ParseAudioBackend(const char* str)
{

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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