From dcb76739c878a0b43e1f7af1cfe00c901efe1f33 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Sun, 21 Feb 2010 08:04:45 +0000 Subject: [PATCH] Hack at spu2-x until it compiles in Linux, and is usable as a null plugin. (No, no sound yet, or configuration dialogs. It's a step in the right direction, though.) git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2616 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/spu2-x/src/Linux/AboutBox.cpp | 0 plugins/spu2-x/src/Linux/CfgHelpers.cpp | 0 plugins/spu2-x/src/Linux/Config.cpp | 2 +- plugins/spu2-x/src/Linux/ConfigDebug.cpp | 0 plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp | 8 ++ plugins/spu2-x/src/Linux/Dialogs.cpp | 58 ++++++++- plugins/spu2-x/src/Linux/Dialogs.h | 13 +- plugins/spu2-x/src/Linux/SPU2-X.cbp | 82 ++++++++++++- plugins/spu2-x/src/PS2E-spu2.cpp | 7 +- plugins/spu2-x/src/SndOut_Portaudio.cpp | 111 ++++++++++++------ plugins/spu2-x/src/spu2sys.cpp | 2 +- 11 files changed, 237 insertions(+), 46 deletions(-) create mode 100644 plugins/spu2-x/src/Linux/AboutBox.cpp create mode 100644 plugins/spu2-x/src/Linux/CfgHelpers.cpp create mode 100644 plugins/spu2-x/src/Linux/ConfigDebug.cpp diff --git a/plugins/spu2-x/src/Linux/AboutBox.cpp b/plugins/spu2-x/src/Linux/AboutBox.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/plugins/spu2-x/src/Linux/CfgHelpers.cpp b/plugins/spu2-x/src/Linux/CfgHelpers.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/plugins/spu2-x/src/Linux/Config.cpp b/plugins/spu2-x/src/Linux/Config.cpp index b5e802a1a5..45c667ee99 100644 --- a/plugins/spu2-x/src/Linux/Config.cpp +++ b/plugins/spu2-x/src/Linux/Config.cpp @@ -102,7 +102,7 @@ void WriteSettings() void configure() { ReadSettings(); -} +} void MessageBox(char const*, ...) { diff --git a/plugins/spu2-x/src/Linux/ConfigDebug.cpp b/plugins/spu2-x/src/Linux/ConfigDebug.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp index e7b8b5952f..f81694d880 100644 --- a/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp +++ b/plugins/spu2-x/src/Linux/ConfigSoundTouch.cpp @@ -22,6 +22,7 @@ #include "Global.h" #include "Dialogs.h" #include "Config.h" +#include "SoundTouch/SoundTouch.h" namespace SoundtouchCfg { @@ -32,6 +33,13 @@ void ClampValues() Clampify( OverlapMS, Overlap_Min, Overlap_Max ); } +void ApplySettings( soundtouch::SoundTouch& sndtouch ) +{ + sndtouch.setSetting( SETTING_SEQUENCE_MS, SequenceLenMS ); + sndtouch.setSetting( SETTING_SEEKWINDOW_MS, SeekWindowMS ); + sndtouch.setSetting( SETTING_OVERLAP_MS, OverlapMS ); +} + void ReadSettings() { //SequenceLenMS = CfgReadInt( L"SOUNDTOUCH", L"SequenceLengthMS", 63 ); diff --git a/plugins/spu2-x/src/Linux/Dialogs.cpp b/plugins/spu2-x/src/Linux/Dialogs.cpp index dfe8ea4b08..ada151fc74 100644 --- a/plugins/spu2-x/src/Linux/Dialogs.cpp +++ b/plugins/spu2-x/src/Linux/Dialogs.cpp @@ -15,4 +15,60 @@ * along with SPU2-X. If not, see . */ - // To be continued... \ No newline at end of file + // To be continued... + + #include "Dialogs.h" +#include +#include + +void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wstring& Data) +{ +} + +void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wstring& Data, int DataSize, const wchar_t* Default) +{ +} + + +void __forceinline SysMessage(const char *fmt, ...) +{ + va_list list; + char msg[512]; + + va_start(list, fmt); + vsprintf(msg, fmt, list); + va_end(list); + + if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0; + + GtkWidget *dialog; + dialog = gtk_message_dialog_new (NULL, + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + "%s", msg); + gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); +} + +void SysMessage(wchar_t const*, ...) +{ +} + +void DspUpdate() +{ +} + +s32 DspLoadLibrary(wchar_t* fileName, int modnum) +{ + return 0; +} + +void AboutBox() +{ + SysMessage("Yay: Aboutbox."); +} + +void CfgSetSettingsDir(const char* dir) +{ +} diff --git a/plugins/spu2-x/src/Linux/Dialogs.h b/plugins/spu2-x/src/Linux/Dialogs.h index d19ad49f8e..6e3b3970b2 100644 --- a/plugins/spu2-x/src/Linux/Dialogs.h +++ b/plugins/spu2-x/src/Linux/Dialogs.h @@ -18,7 +18,18 @@ #ifndef DIALOG_H_INCLUDED #define DIALOG_H_INCLUDED -#include "../Config.h" #include "../Global.h" +#include "../Config.h" + +extern void CfgSetSettingsDir(const char* dir); + +//extern void CfgWriteBool(const wchar_t* Section, const wchar_t* Name, bool Value); +//extern void CfgWriteInt(const wchar_t* Section, const wchar_t* Name, int Value); +extern void CfgWriteStr(const wchar_t* Section, const wchar_t* Name, const wstring& Data); + +//extern bool CfgReadBool(const wchar_t *Section,const wchar_t* Name, bool Default); +extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wstring& Data, int DataSize, const wchar_t* Default); +//extern void CfgReadStr(const wchar_t* Section, const wchar_t* Name, wchar_t* Data, int DataSize, const wchar_t* Default); +//extern int CfgReadInt(const wchar_t* Section, const wchar_t* Name,int Default); #endif diff --git a/plugins/spu2-x/src/Linux/SPU2-X.cbp b/plugins/spu2-x/src/Linux/SPU2-X.cbp index 971a9c1daa..af1377e9a3 100644 --- a/plugins/spu2-x/src/Linux/SPU2-X.cbp +++ b/plugins/spu2-x/src/Linux/SPU2-X.cbp @@ -13,7 +13,6 @@