GTK : Added an option to allow a sound sample rate of 48 000 Hz (finally ...)
This commit is contained in:
parent
6d394b2d9f
commit
9383abc719
|
@ -40,7 +40,7 @@ extern bool stopState; // TODO: silence sound when true
|
|||
|
||||
int const SOUND_CLOCK_TICKS_ = 167772; // 1/100 second
|
||||
|
||||
static u16 soundFinalWave [1470];
|
||||
static u16 soundFinalWave [1600];
|
||||
long soundSampleRate = 44100;
|
||||
bool soundInterpolation = true;
|
||||
bool soundPaused = true;
|
||||
|
|
|
@ -98,7 +98,7 @@ bool SoundSDL::init(long sampleRate)
|
|||
{
|
||||
SDL_AudioSpec audio;
|
||||
|
||||
_bufferLen = sampleRate / 15;
|
||||
_bufferLen = sampleRate * 4 / 60;
|
||||
|
||||
audio.freq = sampleRate;
|
||||
audio.format = AUDIO_S16SYS;
|
||||
|
|
|
@ -60,15 +60,18 @@ void SoundConfigDialog::vSetConfig(Config::Section * _poConfig, VBA::Window * _p
|
|||
long iSoundSampleRate = m_poConfig->oGetKey<long>("sample_rate");
|
||||
switch (iSoundSampleRate)
|
||||
{
|
||||
default:
|
||||
case 44100:
|
||||
m_poRateComboBox->set_active(2);
|
||||
case 11025:
|
||||
m_poRateComboBox->set_active(0);
|
||||
break;
|
||||
case 22050:
|
||||
m_poRateComboBox->set_active(1);
|
||||
break;
|
||||
case 11025:
|
||||
m_poRateComboBox->set_active(0);
|
||||
default:
|
||||
case 44100:
|
||||
m_poRateComboBox->set_active(2);
|
||||
break;
|
||||
case 48000:
|
||||
m_poRateComboBox->set_active(3);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -120,6 +123,9 @@ void SoundConfigDialog::vOnRateChanged()
|
|||
default:
|
||||
m_poConfig->vSetKey("sample_rate", 44100);
|
||||
break;
|
||||
case 3: // 48 KHz
|
||||
m_poConfig->vSetKey("sample_rate", 48000);
|
||||
break;
|
||||
}
|
||||
|
||||
m_poWindow->vApplyConfigSoundSampleRate();
|
||||
|
|
|
@ -35,7 +35,10 @@
|
|||
<col id="0">22 KHz</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0">44 KHz</col>
|
||||
<col id="0">44.1 KHz</col>
|
||||
</row>
|
||||
<row>
|
||||
<col id="0">48 KHz</col>
|
||||
</row>
|
||||
</data>
|
||||
</object>
|
||||
|
|
|
@ -92,7 +92,7 @@ Window::Window(GtkWindow * _pstWindow, const Glib::RefPtr<Xml> & _poXml) :
|
|||
m_iSaveTypeMin (SaveAuto),
|
||||
m_iSaveTypeMax (SaveNone),
|
||||
m_iSoundSampleRateMin(11025),
|
||||
m_iSoundSampleRateMax(44100),
|
||||
m_iSoundSampleRateMax(48000),
|
||||
m_fSoundVolumeMin (0.50f),
|
||||
m_fSoundVolumeMax (2.00f),
|
||||
m_iEmulatorTypeMin(EmulatorAuto),
|
||||
|
|
Loading…
Reference in New Issue