From 064085b41c72e779a805c939e55358bfd7cccaa6 Mon Sep 17 00:00:00 2001 From: tmkk Date: Sat, 23 Feb 2019 14:52:11 +0900 Subject: [PATCH] macosx: change default value for SoundInputRate and macSoundBuffer_ms, and apply the new value when running 1.59 for the first time --- macosx/mac-os.mm | 4 ++-- macosx/mac-prefs.cpp | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/macosx/mac-os.mm b/macosx/mac-os.mm index 5cafd9d3..3ea95f0b 100644 --- a/macosx/mac-os.mm +++ b/macosx/mac-os.mm @@ -126,7 +126,7 @@ long drawingMethod = kDrawingOpenGL; int videoMode = VIDEOMODE_SMOOTH; SInt32 macSoundVolume = 80; // % -uint32 macSoundBuffer_ms = 100; // ms +uint32 macSoundBuffer_ms = 80; // ms uint32 macSoundInterval_ms = 16; // ms bool8 macSoundLagEnable = false; uint16 aueffect = 0; @@ -3032,7 +3032,7 @@ static void Initialize (void) Settings.SixteenBitSound = true; Settings.Stereo = true; Settings.SoundPlaybackRate = 32000; - Settings.SoundInputRate = 32000; + Settings.SoundInputRate = 31950; Settings.SupportHiRes = true; Settings.Transparency = true; Settings.AutoDisplayMessages = true; diff --git a/macosx/mac-prefs.cpp b/macosx/mac-prefs.cpp index 2b9bc6b7..f72b43ca 100755 --- a/macosx/mac-prefs.cpp +++ b/macosx/mac-prefs.cpp @@ -258,6 +258,12 @@ void SavePrefs (void) CFRelease(mref); } + sref = (CFStringRef) CFDictionaryGetValue(CFBundleGetInfoDictionary(CFBundleGetMainBundle()), CFSTR("CFBundleShortVersionString")); + if (sref) + { + CFPreferencesSetAppValue(CFSTR("LastVersionUsed"), sref, kCFPreferencesCurrentApplication); + } + CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication); } @@ -301,6 +307,13 @@ void LoadPrefs (void) CFRelease(mref); } + + sref = (CFStringRef) CFPreferencesCopyAppValue(CFSTR("LastVersionUsed"), kCFPreferencesCurrentApplication); + if (!sref) { + Settings.SoundInputRate = 31950; + macSoundBuffer_ms = 80; + } + else CFRelease(sref); } void ConfigurePreferences (void)