mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 22:15:46 -04:00
Settings: Add audio sync and additional cleanup
This commit is contained in:
@ -206,11 +206,11 @@ void HostInterface::UpdateSpeedLimiterState()
|
||||
{
|
||||
m_speed_limiter_enabled = m_settings.speed_limiter_enabled && !m_speed_limiter_temp_disabled;
|
||||
|
||||
const bool audio_sync_enabled = !m_system || m_paused || m_speed_limiter_enabled;
|
||||
const bool vsync_enabled = !m_system || m_paused || (m_speed_limiter_enabled && m_settings.gpu_vsync);
|
||||
const bool audio_sync_enabled = !m_system || m_paused || (m_speed_limiter_enabled && m_settings.audio_sync_enabled);
|
||||
const bool video_sync_enabled = !m_system || m_paused || (m_speed_limiter_enabled && m_settings.video_sync_enabled);
|
||||
Log_InfoPrintf("Syncing to %s%s", audio_sync_enabled ? "audio" : "",
|
||||
(m_speed_limiter_enabled && vsync_enabled) ? " and video" : "");
|
||||
(audio_sync_enabled && video_sync_enabled) ? " and video" : (video_sync_enabled ? "video" : ""));
|
||||
|
||||
m_audio_stream->SetSync(audio_sync_enabled);
|
||||
m_display->SetVSync(vsync_enabled);
|
||||
m_display->SetVSync(video_sync_enabled);
|
||||
}
|
||||
|
@ -13,9 +13,15 @@ Settings::Settings() = default;
|
||||
|
||||
void Settings::SetDefaults()
|
||||
{
|
||||
region = ConsoleRegion::Auto;
|
||||
|
||||
audio_sync_enabled = true;
|
||||
video_sync_enabled = true;
|
||||
speed_limiter_enabled = true;
|
||||
start_paused = false;
|
||||
|
||||
gpu_renderer = GPURenderer::HardwareOpenGL;
|
||||
gpu_resolution_scale = 1;
|
||||
gpu_vsync = true;
|
||||
gpu_true_color = true;
|
||||
|
||||
display_linear_filtering = true;
|
||||
@ -39,9 +45,13 @@ void Settings::Load(const char* filename)
|
||||
|
||||
region = ParseConsoleRegionName(ini.GetValue("Console", "Region", "NTSC-U")).value_or(ConsoleRegion::NTSC_U);
|
||||
|
||||
audio_sync_enabled = ini.GetBoolValue("General", "SyncToAudio", true);
|
||||
video_sync_enabled = ini.GetBoolValue("General", "SyncToVideo", true);
|
||||
speed_limiter_enabled = ini.GetBoolValue("General", "SpeedLimiterEnabled", true);
|
||||
start_paused = ini.GetBoolValue("General", "StartPaused", false);
|
||||
|
||||
gpu_renderer = ParseRendererName(ini.GetValue("GPU", "Renderer", "OpenGL")).value_or(GPURenderer::HardwareOpenGL);
|
||||
gpu_resolution_scale = static_cast<u32>(ini.GetLongValue("GPU", "ResolutionScale", 1));
|
||||
gpu_vsync = static_cast<u32>(ini.GetBoolValue("GPU", "VSync", true));
|
||||
gpu_true_color = ini.GetBoolValue("GPU", "TrueColor", false);
|
||||
|
||||
display_linear_filtering = ini.GetBoolValue("Display", "LinearFiltering", true);
|
||||
@ -64,9 +74,14 @@ bool Settings::Save(const char* filename) const
|
||||
|
||||
ini.SetValue("Console", "Region", GetConsoleRegionName(region));
|
||||
|
||||
ini.SetBoolValue("General", "SyncToAudio", audio_sync_enabled);
|
||||
ini.SetBoolValue("General", "SyncToVideo", video_sync_enabled);
|
||||
ini.SetBoolValue("General", "SpeedLimiterEnabled", speed_limiter_enabled);
|
||||
ini.SetBoolValue("General", "StartPaused", start_paused);
|
||||
|
||||
ini.SetValue("GPU", "Renderer", GetRendererName(gpu_renderer));
|
||||
ini.SetLongValue("GPU", "ResolutionScale", static_cast<long>(gpu_resolution_scale));
|
||||
ini.SetBoolValue("GPU", "VSync", gpu_vsync);
|
||||
ini.SetBoolValue("GPU", "VSync", video_sync_enabled);
|
||||
ini.SetBoolValue("GPU", "TrueColor", gpu_true_color);
|
||||
|
||||
ini.SetBoolValue("Display", "LinearFiltering", display_linear_filtering);
|
||||
|
@ -6,15 +6,16 @@ struct Settings
|
||||
{
|
||||
Settings();
|
||||
|
||||
ConsoleRegion region = ConsoleRegion::NTSC_U;
|
||||
ConsoleRegion region = ConsoleRegion::Auto;
|
||||
|
||||
bool start_paused = false;
|
||||
bool speed_limiter_enabled = true;
|
||||
bool audio_sync_enabled = true;
|
||||
bool video_sync_enabled = true;
|
||||
|
||||
GPURenderer gpu_renderer = GPURenderer::Software;
|
||||
u32 gpu_resolution_scale = 1;
|
||||
mutable u32 max_gpu_resolution_scale = 1;
|
||||
bool gpu_vsync = true;
|
||||
bool gpu_true_color = false;
|
||||
bool display_linear_filtering = true;
|
||||
bool display_fullscreen = false;
|
||||
|
Reference in New Issue
Block a user