diff options
| author | Glenn Rice <glennricster@gmail.com> | 2011-02-04 04:54:25 +0000 |
|---|---|---|
| committer | Glenn Rice <glennricster@gmail.com> | 2011-02-04 04:54:25 +0000 |
| commit | d5f6d2bbae57e972d8ecc9b7a3d5684ca637dbb7 (patch) | |
| tree | c81f9fdc03c161078920fb131cbb06709feb67e4 /Source/Core | |
| parent | 9c1a182cca73b4dbb68ad1c401c737ce32602df0 (diff) | |
Change the audio sample rate setting to a numerical value. Fixes issue 4045. You may have to change the setting once after this commit to update your ini file from the string that was saved there before.
Update translation pot file to reflect recent gui changes, and update a few of the languages.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7059 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/AudioCommon/Src/AudioCommonConfig.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/AudioCommon/Src/AudioCommonConfig.h | 2 | ||||
| -rw-r--r-- | Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp | 9 | ||||
| -rw-r--r-- | Source/Core/DolphinWX/Src/ConfigMain.cpp | 10 |
4 files changed, 10 insertions, 13 deletions
diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp index 3eb2fbaa6c..6a8a22f5e5 100644 --- a/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp +++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.cpp @@ -42,7 +42,7 @@ void AudioCommonConfig::Load() #else file.Get("Config", "Backend", &sBackend, BACKEND_NULLSOUND); #endif - file.Get("Config", "Frequency", &sFrequency, "48,000 Hz"); + file.Get("Config", "Frequency", &sFrequency, 48000); file.Get("Config", "Volume", &m_Volume, 100); } diff --git a/Source/Core/AudioCommon/Src/AudioCommonConfig.h b/Source/Core/AudioCommon/Src/AudioCommonConfig.h index 71ad76602b..c5f2efe645 100644 --- a/Source/Core/AudioCommon/Src/AudioCommonConfig.h +++ b/Source/Core/AudioCommon/Src/AudioCommonConfig.h @@ -38,7 +38,7 @@ struct AudioCommonConfig bool m_EnableJIT; int m_Volume; std::string sBackend; - std::string sFrequency; + int sFrequency; // Load from given file void Load(); diff --git a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp index c2f4d08c84..ac3b06e0f8 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/DSPHLE.cpp @@ -192,16 +192,11 @@ u16 DSPHLE::DSP_WriteControlRegister(unsigned short _Value) { if (!Temp.DSPHalt && Temp.DSPInit) { - unsigned int AISampleRate, DACSampleRate, BackendSampleRate; + unsigned int AISampleRate, DACSampleRate; AudioInterface::Callback_GetSampleRate(AISampleRate, DACSampleRate); - std::string frequency = ac_Config.sFrequency; - if (frequency == "48,000 Hz") - BackendSampleRate = 48000; - else - BackendSampleRate = 32000; soundStream = AudioCommon::InitSoundStream( - new HLEMixer(this, AISampleRate, DACSampleRate, BackendSampleRate), m_hWnd); + new HLEMixer(this, AISampleRate, DACSampleRate, ac_Config.sFrequency), m_hWnd); if(!soundStream) PanicAlert("Error starting up sound stream"); // Mixer is initialized m_InitMixer = true; diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 5ef4e19f4a..404942456f 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -397,7 +397,7 @@ void CConfigMain::InitializeGUIValues() EnableDTKMusic->SetValue(ac_Config.m_EnableDTKMusic ? true : false); EnableThrottle->SetValue(ac_Config.m_EnableThrottle ? true : false); FrequencySelection->SetSelection( - FrequencySelection->FindString(wxString::FromAscii(ac_Config.sFrequency.c_str()))); + FrequencySelection->FindString(wxString::Format(_("%d Hz"), ac_Config.sFrequency))); // add backends to the list AddAudioBackends(); @@ -717,8 +717,8 @@ void CConfigMain::CreateGUIControls() BackendSelection = new wxChoice(AudioPage, ID_BACKEND, wxDefaultPosition, wxDefaultSize, wxArrayBackends, 0, wxDefaultValidator, wxEmptyString); FrequencySelection = new wxChoice(AudioPage, ID_FREQUENCY); - FrequencySelection->Append(_("48,000 Hz")); - FrequencySelection->Append(_("32,000 Hz")); + FrequencySelection->Append(wxString::Format(_("%d Hz"), 48000)); + FrequencySelection->Append(wxString::Format(_("%d Hz"), 32000)); // Create sizer and add items to dialog wxStaticBoxSizer *sbAudioSettings = new wxStaticBoxSizer(wxVERTICAL, AudioPage, _("Sound Settings")); @@ -1069,7 +1069,9 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event) ac_Config.m_EnableDTKMusic = EnableDTKMusic->GetValue(); ac_Config.m_EnableThrottle = EnableThrottle->GetValue(); ac_Config.sBackend = BackendSelection->GetStringSelection().mb_str(); - ac_Config.sFrequency = FrequencySelection->GetStringSelection().mb_str(); + long int frequency; + FrequencySelection->GetStringSelection().ToLong(&frequency); + ac_Config.sFrequency = frequency; ac_Config.Update(); break; } |
