diff --git a/plugins/spu2-x/src/Linux/Alsa.cpp b/plugins/spu2-x/src/Linux/Alsa.cpp index f7ad0122e5..5e493fee49 100644 --- a/plugins/spu2-x/src/Linux/Alsa.cpp +++ b/plugins/spu2-x/src/Linux/Alsa.cpp @@ -250,6 +250,10 @@ public: { } + void SetApiSettings(wxString api) + { + } + void WriteSettings() const { } diff --git a/plugins/spu2-x/src/Linux/Config.cpp b/plugins/spu2-x/src/Linux/Config.cpp index 1db5b449b2..b41f38039b 100644 --- a/plugins/spu2-x/src/Linux/Config.cpp +++ b/plugins/spu2-x/src/Linux/Config.cpp @@ -44,11 +44,13 @@ int Interpolation = 1; bool EffectsDisabled = false; int ReverbBoost = 0; bool postprocess_filter_enabled = 1; +bool _visual_debug_enabled = false; // windows only feature // OUTPUT u32 OutputModule = 0; int SndOutLatencyMS = 300; int SynchMode = 0; // Time Stretch, Async or Disabled +static u32 OutputAPI = 0; /*****************************************************************************/ @@ -135,6 +137,7 @@ void DisplayDialog() GtkWidget *output_frame, *output_box; GtkWidget *mod_label, *mod_box; + GtkWidget *api_label, *api_box; GtkWidget *latency_label, *latency_slide; GtkWidget *sync_label, *sync_box; GtkWidget *advanced_button; @@ -179,6 +182,14 @@ void DisplayDialog() //gtk_combo_box_append_text(GTK_COMBO_BOX(mod_box), "2 - Alsa (probably doesn't work)"); gtk_combo_box_set_active(GTK_COMBO_BOX(mod_box), OutputModule); + api_label = gtk_label_new ("PortAudio API:"); + api_box = gtk_combo_box_new_text (); + // In order to keep it the menu light, I only put linux major api + gtk_combo_box_append_text(GTK_COMBO_BOX(api_box), "0 - ALSA (recommended)"); + gtk_combo_box_append_text(GTK_COMBO_BOX(api_box), "1 - OSS (legacy)"); + gtk_combo_box_append_text(GTK_COMBO_BOX(api_box), "2 - JACK"); + gtk_combo_box_set_active(GTK_COMBO_BOX(api_box), OutputAPI); + latency_label = gtk_label_new ("Latency:"); latency_slide = gtk_hscale_new_with_range(LATENCY_MIN, LATENCY_MAX, 5); gtk_range_set_value(GTK_RANGE(latency_slide), SndOutLatencyMS); @@ -214,6 +225,8 @@ void DisplayDialog() gtk_container_add(GTK_CONTAINER(output_box), mod_label); gtk_container_add(GTK_CONTAINER(output_box), mod_box); + gtk_container_add(GTK_CONTAINER(output_box), api_label); + gtk_container_add(GTK_CONTAINER(output_box), api_box); gtk_container_add(GTK_CONTAINER(output_box), sync_label); gtk_container_add(GTK_CONTAINER(output_box), sync_box); gtk_container_add(GTK_CONTAINER(output_box), latency_label); @@ -248,6 +261,16 @@ void DisplayDialog() if (gtk_combo_box_get_active(GTK_COMBO_BOX(mod_box)) != -1) OutputModule = gtk_combo_box_get_active(GTK_COMBO_BOX(mod_box)); + if (gtk_combo_box_get_active(GTK_COMBO_BOX(api_box)) != -1) { + OutputAPI = gtk_combo_box_get_active(GTK_COMBO_BOX(api_box)); + switch(OutputAPI) { + case 0: PortaudioOut->SetApiSettings(L"ALSA"); break; + case 1: PortaudioOut->SetApiSettings(L"OSS"); break; + case 2: PortaudioOut->SetApiSettings(L"JACK"); break; + default: PortaudioOut->SetApiSettings(L"Unknown"); + } + } + SndOutLatencyMS = gtk_range_get_value(GTK_RANGE(latency_slide)); if (gtk_combo_box_get_active(GTK_COMBO_BOX(sync_box)) != -1) diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index 9b70060edb..c79378c7cc 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -417,6 +417,7 @@ EXPORT_C_(s32) SPU2open(void *pDsp) else gsWindowHandle = 0; +#ifdef _MSC_VER #ifdef PCSX2_DEVBUILD // Define may not be needed but not tested yet. Better make sure. if( IsDevBuild && VisualDebug() ) { @@ -432,6 +433,7 @@ EXPORT_C_(s32) SPU2open(void *pDsp) DestroyWindow(hDebugDialog); debugDialogOpen=0; } +#endif #endif IsOpened = true; diff --git a/plugins/spu2-x/src/SndOut.cpp b/plugins/spu2-x/src/SndOut.cpp index edf2d71f01..4db6f77678 100644 --- a/plugins/spu2-x/src/SndOut.cpp +++ b/plugins/spu2-x/src/SndOut.cpp @@ -74,6 +74,10 @@ public: { } + void SetApiSettings(wxString api) + { + } + void WriteSettings() const { } diff --git a/plugins/spu2-x/src/SndOut.h b/plugins/spu2-x/src/SndOut.h index 9d863eb34d..a8a97d1a02 100644 --- a/plugins/spu2-x/src/SndOut.h +++ b/plugins/spu2-x/src/SndOut.h @@ -471,6 +471,9 @@ public: // Loads settings from the INI file for this driver virtual void ReadSettings()=0; + // Set output API for this driver + virtual void SetApiSettings(wxString api) =0; + // Saves settings to the INI file for this driver virtual void WriteSettings() const=0; diff --git a/plugins/spu2-x/src/SndOut_Portaudio.cpp b/plugins/spu2-x/src/SndOut_Portaudio.cpp index dd69f988af..0b50074de4 100644 --- a/plugins/spu2-x/src/SndOut_Portaudio.cpp +++ b/plugins/spu2-x/src/SndOut_Portaudio.cpp @@ -294,6 +294,13 @@ public: CfgReadStr( L"PORTAUDIO", L"HostApi", api, L"Unknown" ); CfgReadStr( L"PORTAUDIO", L"Device", m_Device, L"default" ); + SetApiSettings(api); + + m_WasapiExclusiveMode = CfgReadBool( L"PORTAUDIO", L"Wasapi_Exclusive_Mode", false); + } + + void SetApiSettings(wxString api) + { m_ApiId = -1; if(api == L"InDevelopment") m_ApiId = paInDevelopment; /* use while developing support for a new host API */ if(api == L"DirectSound") m_ApiId = paDirectSound; @@ -309,8 +316,6 @@ public: if(api == L"JACK") m_ApiId = paJACK; if(api == L"WASAPI") m_ApiId = paWASAPI; if(api == L"AudioScienceHPI") m_ApiId = paAudioScienceHPI; - - m_WasapiExclusiveMode = CfgReadBool( L"PORTAUDIO", L"Wasapi_Exclusive_Mode", false); } void WriteSettings() const diff --git a/plugins/spu2-x/src/Windows/SndOut_DSound.cpp b/plugins/spu2-x/src/Windows/SndOut_DSound.cpp index 6f97233453..0d68bb9474 100644 --- a/plugins/spu2-x/src/Windows/SndOut_DSound.cpp +++ b/plugins/spu2-x/src/Windows/SndOut_DSound.cpp @@ -463,6 +463,10 @@ public: Clampify( m_NumBuffers, (u8)3, (u8)8 ); } + void SetApiSettings(wxString api) + { + } + void WriteSettings() const { CfgWriteStr( L"DSOUNDOUT", L"Device", m_Device.empty() ? L"default" : m_Device ); diff --git a/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp b/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp index 8db3063a61..aef73db26a 100644 --- a/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp +++ b/plugins/spu2-x/src/Windows/SndOut_XAudio2.cpp @@ -395,6 +395,10 @@ public: { } + void SetApiSettings(wxString api) + { + } + void WriteSettings() const { } diff --git a/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp b/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp index fa1c36f977..45817ee5aa 100644 --- a/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp +++ b/plugins/spu2-x/src/Windows/SndOut_waveOut.cpp @@ -315,6 +315,10 @@ public: { } + void SetApiSettings(wxString api) + { + } + void WriteSettings() const { }