mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user