public override void Execute() { Settings.Audio_PlaybackEnabled = audioPage.Items[0].SelectedOptionIndex == 1; Settings.Audio_PlaybackVolume = audioPage.Items[1].SelectedOptionIndex; Settings.Audio_PlaybackFrequency = audioPage.Items[2].SelectedOptionIndex == 0 ? 44100 : 48000; Settings.Audio_playback_sq1_enabled = audioPage.Items[3].SelectedOptionIndex == 1; Settings.Audio_playback_sq2_enabled = audioPage.Items[4].SelectedOptionIndex == 1; Settings.Audio_playback_dmc_enabled = audioPage.Items[5].SelectedOptionIndex == 1; Settings.Audio_playback_trl_enabled = audioPage.Items[6].SelectedOptionIndex == 1; Settings.Audio_playback_noz_enabled = audioPage.Items[7].SelectedOptionIndex == 1; // Apply on provider !! Program.AUDIO.Enabled = Settings.Audio_PlaybackEnabled; Program.AUDIO.Volume = Settings.Audio_PlaybackVolume; NesEmu.SetupSoundPlayback(Program.AUDIO, Settings.Audio_PlaybackEnabled, Settings.Audio_PlaybackFrequency); NesEmu.audio_playback_dmc_enabled = Settings.Audio_playback_dmc_enabled; NesEmu.audio_playback_noz_enabled = Settings.Audio_playback_noz_enabled; NesEmu.audio_playback_sq1_enabled = Settings.Audio_playback_sq1_enabled; NesEmu.audio_playback_sq2_enabled = Settings.Audio_playback_sq2_enabled; NesEmu.audio_playback_trl_enabled = Settings.Audio_playback_trl_enabled; Settings.SaveSettings(); Program.SelectRoom("settings"); }
private static void InitializeAudio() { AUDIO = new SDLAudio(); NesEmu.SetupSoundPlayback(AUDIO, Settings.Audio_PlaybackEnabled, Settings.Audio_PlaybackFrequency); NesEmu.audio_playback_dmc_enabled = Settings.Audio_playback_dmc_enabled; NesEmu.audio_playback_noz_enabled = Settings.Audio_playback_noz_enabled; NesEmu.audio_playback_sq1_enabled = Settings.Audio_playback_sq1_enabled; NesEmu.audio_playback_sq2_enabled = Settings.Audio_playback_sq2_enabled; NesEmu.audio_playback_trl_enabled = Settings.Audio_playback_trl_enabled; }