SPU2: Cleanup. Remove a few unused variables, and make a few local that didn't need to be in classes, renaming them accordingly.

This commit is contained in:
Shanoah Alkire 2020-10-03 18:12:38 -07:00
parent 655748f2d9
commit 7ca2385da2
2 changed files with 41 additions and 42 deletions

View File

@ -29,13 +29,14 @@ MixerTab::MixerTab(wxWindow* parent)
// Mixing Settings // Mixing Settings
top_box->Add(new wxStaticText(this, wxID_ANY, "Interpolation"), wxSizerFlags().Centre()); top_box->Add(new wxStaticText(this, wxID_ANY, "Interpolation"), wxSizerFlags().Centre());
m_interpolation.Add("Nearest (Fastest/bad quality)"); wxArrayString interpolation_entries;
m_interpolation.Add("Linear (Simple/okay sound)"); interpolation_entries.Add("Nearest (Fastest/bad quality)");
m_interpolation.Add("Cubic (Artificial highs)"); interpolation_entries.Add("Linear (Simple/okay sound)");
m_interpolation.Add("Hermite (Better highs)"); interpolation_entries.Add("Cubic (Artificial highs)");
m_interpolation.Add("Catmull-Rom (PS2-like/slow)"); interpolation_entries.Add("Hermite (Better highs)");
interpolation_entries.Add("Catmull-Rom (PS2-like/slow)");
m_inter_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_interpolation); m_inter_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, interpolation_entries);
effect_check = new wxCheckBox(this, wxID_ANY, "Disable Effects Processing (Speedup)"); effect_check = new wxCheckBox(this, wxID_ANY, "Disable Effects Processing (Speedup)");
dealias_check = new wxCheckBox(this, wxID_ANY, "Use the de-alias filter (Overemphasizes the highs) "); dealias_check = new wxCheckBox(this, wxID_ANY, "Use the de-alias filter (Overemphasizes the highs) ");
@ -54,11 +55,13 @@ MixerTab::MixerTab(wxWindow* parent)
m_audio_box = new wxBoxSizer(wxVERTICAL); m_audio_box = new wxBoxSizer(wxVERTICAL);
m_audio_box->Add(new wxStaticText(this, wxID_ANY, "Audio Expansion Mode"), wxSizerFlags().Centre()); m_audio_box->Add(new wxStaticText(this, wxID_ANY, "Audio Expansion Mode"), wxSizerFlags().Centre());
m_audio.Add("Stereo (None, Default)");
m_audio.Add("Quadrafonic"); wxArrayString audio_entries;
m_audio.Add("Surround 5.1"); audio_entries.Add("Stereo (None, Default)");
m_audio.Add("Surround 7.1"); audio_entries.Add("Quadrafonic");
m_audio_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_audio); audio_entries.Add("Surround 5.1");
audio_entries.Add("Surround 7.1");
m_audio_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, audio_entries);
m_audio_box->Add(m_audio_select, wxSizerFlags().Expand()); m_audio_box->Add(m_audio_select, wxSizerFlags().Expand());
top_box->Add(m_inter_select, wxSizerFlags().Centre()); top_box->Add(m_inter_select, wxSizerFlags().Centre());
@ -110,10 +113,12 @@ SyncTab::SyncTab(wxWindow* parent)
auto* top_box = new wxBoxSizer(wxVERTICAL); auto* top_box = new wxBoxSizer(wxVERTICAL);
top_box->Add(new wxStaticText(this, wxID_ANY, "Synchronization"), wxSizerFlags().Centre()); top_box->Add(new wxStaticText(this, wxID_ANY, "Synchronization"), wxSizerFlags().Centre());
m_sync.Add("TimeStretch (Recommended)");
m_sync.Add("Async Mix (Breaks some games!)"); wxArrayString sync_entries;
m_sync.Add("None (Audio can skip.)"); sync_entries.Add("TimeStretch (Recommended)");
m_sync_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_sync); sync_entries.Add("Async Mix (Breaks some games!)");
sync_entries.Add("None (Audio can skip.)");
m_sync_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, sync_entries);
auto* adv_box = new wxStaticBoxSizer(wxVERTICAL, this, "Advanced"); auto* adv_box = new wxStaticBoxSizer(wxVERTICAL, this, "Advanced");
@ -352,12 +357,14 @@ Dialog::Dialog()
// Module // Module
module_box->Add(new wxStaticText(this, wxID_ANY, "Module"), wxSizerFlags().Centre()); module_box->Add(new wxStaticText(this, wxID_ANY, "Module"), wxSizerFlags().Centre());
m_module.Add("No Sound (Emulate SPU2 only)");
wxArrayString module_entries;
module_entries.Add("No Sound (Emulate SPU2 only)");
#ifdef SPU2X_PORTAUDIO #ifdef SPU2X_PORTAUDIO
m_module.Add("PortAudio (Cross-platform)"); module_entries.Add("PortAudio (Cross-platform)");
#endif #endif
m_module.Add("SDL Audio (Recommended for PulseAudio)"); module_entries.Add("SDL Audio (Recommended for PulseAudio)");
m_module_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_module); m_module_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, module_entries);
module_box->Add(m_module_select, wxSizerFlags().Centre()); module_box->Add(m_module_select, wxSizerFlags().Centre());
#ifdef SPU2X_PORTAUDIO #ifdef SPU2X_PORTAUDIO
@ -365,16 +372,18 @@ Dialog::Dialog()
m_portaudio_box = new wxBoxSizer(wxVERTICAL); m_portaudio_box = new wxBoxSizer(wxVERTICAL);
m_portaudio_text = new wxStaticText(this, wxID_ANY, "Portaudio API"); m_portaudio_text = new wxStaticText(this, wxID_ANY, "Portaudio API");
m_portaudio_box->Add(m_portaudio_text, wxSizerFlags().Centre()); m_portaudio_box->Add(m_portaudio_text, wxSizerFlags().Centre());
wxArrayString portaudio_entries;
#ifdef __linux__ #ifdef __linux__
m_portaudio.Add("ALSA (recommended)"); portaudio_entries.Add("ALSA (recommended)");
m_portaudio.Add("OSS (legacy)"); portaudio_entries.Add("OSS (legacy)");
m_portaudio.Add("JACK"); portaudio_entries.Add("JACK");
#elif defined(__APPLE__) #elif defined(__APPLE__)
m_portaudio.Add("CoreAudio"); portaudio_entries.Add("CoreAudio");
#else #else
m_portaudio.Add("OSS"); portaudio_entries.Add("OSS");
#endif #endif
m_portaudio_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_portaudio); m_portaudio_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, portaudio_entries);
m_portaudio_box->Add(m_portaudio_select, wxSizerFlags().Centre()); m_portaudio_box->Add(m_portaudio_select, wxSizerFlags().Centre());
#endif #endif
@ -383,10 +392,11 @@ Dialog::Dialog()
m_sdl_text = new wxStaticText(this, wxID_ANY, "SDL API"); m_sdl_text = new wxStaticText(this, wxID_ANY, "SDL API");
m_sdl_box->Add(m_sdl_text, wxSizerFlags().Centre()); m_sdl_box->Add(m_sdl_text, wxSizerFlags().Centre());
wxArrayString sdl_entries;
for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i) for (int i = 0; i < SDL_GetNumAudioDrivers(); ++i)
m_sdl.Add(SDL_GetAudioDriver(i)); sdl_entries.Add(SDL_GetAudioDriver(i));
m_sdl_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_sdl); m_sdl_select = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, sdl_entries);
m_sdl_box->Add(m_sdl_select, wxSizerFlags().Centre()); m_sdl_box->Add(m_sdl_select, wxSizerFlags().Centre());
#ifdef SPU2X_PORTAUDIO #ifdef SPU2X_PORTAUDIO

View File

@ -30,13 +30,10 @@
class MixerTab : public wxPanel class MixerTab : public wxPanel
{ {
public: public:
wxArrayString m_interpolation; wxChoice* m_inter_select, *m_audio_select;
wxChoice* m_inter_select;
wxCheckBox *effect_check, *dealias_check; wxCheckBox *effect_check, *dealias_check;
wxSlider *m_latency_slider, *m_volume_slider; wxSlider *m_latency_slider, *m_volume_slider;
wxArrayString m_audio; wxStaticBoxSizer *m_volume_box, *m_latency_box;
wxChoice* m_audio_select;
wxStaticBoxSizer *m_mix_box, *m_volume_box, *m_latency_box;
wxBoxSizer* m_audio_box; wxBoxSizer* m_audio_box;
MixerTab(wxWindow* parent); MixerTab(wxWindow* parent);
@ -49,12 +46,8 @@ public:
class SyncTab : public wxPanel class SyncTab : public wxPanel
{ {
public: public:
wxStaticBoxSizer* m_sync_box;
wxArrayString m_sync;
wxChoice* m_sync_select; wxChoice* m_sync_select;
wxButton* launch_adv_dialog; wxButton* launch_adv_dialog, *reset_button;
wxButton* reset_button;
wxSpinCtrl *seq_spin, *seek_spin, *overlap_spin; wxSpinCtrl *seq_spin, *seek_spin, *overlap_spin;
SyncTab(wxWindow* parent); SyncTab(wxWindow* parent);
@ -71,7 +64,6 @@ public:
wxCheckBox* debug_check; wxCheckBox* debug_check;
wxButton* launch_debug_dialog; wxButton* launch_debug_dialog;
wxBoxSizer* m_together_box;
wxStaticBoxSizer *m_console_box, *m_log_only_box, *dump_box; wxStaticBoxSizer *m_console_box, *m_log_only_box, *dump_box;
wxCheckBox* show_check; wxCheckBox* show_check;
wxCheckBox *key_check, *voice_check, *dma_check, *autodma_check, *buffer_check, *adpcm_check; wxCheckBox *key_check, *voice_check, *dma_check, *autodma_check, *buffer_check, *adpcm_check;
@ -87,11 +79,8 @@ public:
class Dialog : public wxDialog class Dialog : public wxDialog
{ {
wxBoxSizer *m_top_box, *m_left_box, *m_right_box; wxBoxSizer *m_top_box, *m_portaudio_box, *m_sdl_box;
wxBoxSizer *m_portaudio_box, *m_sdl_box;
wxStaticBoxSizer* m_output_box; wxStaticBoxSizer* m_output_box;
wxArrayString m_module, m_portaudio, m_sdl;
wxChoice *m_module_select, *m_portaudio_select, *m_sdl_select; wxChoice *m_module_select, *m_portaudio_select, *m_sdl_select;
wxStaticText *m_portaudio_text, *m_sdl_text; wxStaticText *m_portaudio_text, *m_sdl_text;