diff --git a/Source/Plugins/Plugin_DSP_HLE/Plugin_DSP_HLE.vcproj b/Source/Plugins/Plugin_DSP_HLE/Plugin_DSP_HLE.vcproj index c3eddb379d..3c6c47af4b 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Plugin_DSP_HLE.vcproj +++ b/Source/Plugins/Plugin_DSP_HLE/Plugin_DSP_HLE.vcproj @@ -1,7 +1,7 @@ - - - - - - @@ -749,10 +735,6 @@ RelativePath=".\Src\Debugger\File.h" > - - GetParent()); - CenterWindow(GetParent()); + CenterOnParent(); - // Get button handles - m_buttonEnableHLEAudio = GetDlgItem(IDC_ENABLE_HLE_AUDIO); - m_buttonEnableDTKMusic = GetDlgItem(IDC_ENABLE_DTK_MUSIC); - m_buttonEnableThrottle = GetDlgItem(IDC_ENABLE_THROTTLE); + m_OK = new wxButton(this, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + + // Create items + m_buttonEnableHLEAudio = new wxCheckBox(this, ID_ENABLE_HLE_AUDIO, wxT("Enable HLE Audio"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_buttonEnableDTKMusic = new wxCheckBox(this, ID_ENABLE_DTK_MUSIC, wxT("Enable DTK Music"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_buttonEnableThrottle = new wxCheckBox(this, ID_ENABLE_THROTTLE, wxT("Enable Other Audio (Throttle)"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); // Update checkboxes - m_buttonEnableHLEAudio.SetCheck(g_Config.m_EnableHLEAudio ? BST_CHECKED : BST_UNCHECKED); - m_buttonEnableDTKMusic.SetCheck(g_Config.m_EnableDTKMusic ? BST_CHECKED : BST_UNCHECKED); - m_buttonEnableThrottle.SetCheck(g_Config.m_EnableThrottle ? BST_CHECKED : BST_UNCHECKED); + m_buttonEnableHLEAudio->SetValue(g_Config.m_EnableHLEAudio ? true : false); + m_buttonEnableDTKMusic->SetValue(g_Config.m_EnableDTKMusic ? true : false); + m_buttonEnableThrottle->SetValue(g_Config.m_EnableThrottle ? true : false); // Add tooltips - CToolTipCtrl ToolTips; - ToolTips.Create(m_hWnd); - ToolTips.Activate(true); - ToolTips.SetMaxTipWidth(220); // limit the width - ToolTips.SetDelayTime(TTDT_AUTOPOP, 20 * 1000); // give us time to read it - CToolInfo tiHLE(TTF_SUBCLASS, m_buttonEnableHLEAudio, 0, NULL, - "This is the most common sound type"); - CToolInfo tiDTK(TTF_SUBCLASS, m_buttonEnableDTKMusic, 0, NULL, - "This is sometimes used to play music tracks from the disc"); - CToolInfo tiOther(TTF_SUBCLASS, m_buttonEnableThrottle, 0, NULL, - "This is sometimes used together with pre-rendered movies. Disabling this" - " also disables the speed throttle that is causes. Meaning that" - " there will be no upper limit on your FPS."); - ToolTips.AddTool(tiHLE); - ToolTips.AddTool(tiDTK); - ToolTips.AddTool(tiOther); + m_buttonEnableHLEAudio->SetToolTip(wxT("This is the most common sound type")); + m_buttonEnableDTKMusic->SetToolTip(wxT("This is sometimes used to play music tracks from the disc")); + m_buttonEnableThrottle->SetToolTip(wxT("This is sometimes used together with pre-rendered movies.\n" + "Disabling this also disables the speed throttle which this causes,\n" + "meaning that there will be no upper limit on your FPS.")); - return(TRUE); + // Create sizer and add items to dialog + wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL); + wxStaticBoxSizer *sbSettings = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Sound Settings")); + sbSettings->Add(m_buttonEnableHLEAudio, 0, wxALL, 5); + sbSettings->Add(m_buttonEnableDTKMusic, 0, wxALL, 5); + sbSettings->Add(m_buttonEnableThrottle, 0, wxALL, 5); + sMain->Add(sbSettings, 0, wxEXPAND|wxALL, 5); + wxBoxSizer *sButtons = new wxBoxSizer(wxHORIZONTAL); + sButtons->Add(150, 0); // Lazy way to make the dialog as wide as we want it + sButtons->Add(m_OK, 0, wxALL, 5); + sMain->Add(sButtons, 0, wxEXPAND); + this->SetSizerAndFit(sMain); } - -LRESULT -CConfigDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) +ConfigDialog::~ConfigDialog() { - // Save settings - if (wID == IDOK) - { - g_Config.m_EnableHLEAudio = (m_buttonEnableHLEAudio.GetCheck() == BST_CHECKED) ? true : false; - g_Config.m_EnableDTKMusic = (m_buttonEnableDTKMusic.GetCheck() == BST_CHECKED) ? true : false; - g_Config.m_EnableThrottle = (m_buttonEnableThrottle.GetCheck() == BST_CHECKED) ? true : false; - g_Config.Save(); - } - - EndDialog(wID); - g_Config.Save(); - return(0); +} + +void ConfigDialog::SettingsChanged(wxCommandEvent& event) +{ + g_Config.m_EnableHLEAudio = m_buttonEnableHLEAudio->GetValue(); + g_Config.m_EnableDTKMusic = m_buttonEnableDTKMusic->GetValue(); + g_Config.m_EnableThrottle = m_buttonEnableThrottle->GetValue(); + g_Config.Save(); + + if (event.GetId() == wxID_OK) + EndModal(wxID_OK); } diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.h b/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.h index 330ba53ef8..f8d4d05b0f 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/ConfigDlg.h @@ -15,32 +15,43 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#pragma once +#ifndef __DSP_HLE_CONFIGDIALOG_h__ +#define __DSP_HLE_CONFIGDIALOG_h__ -class CConfigDlg - : public CDialogImpl +#include +#include +#include +#include + +class ConfigDialog : public wxDialog { - public: +public: + ConfigDialog(wxWindow *parent, + wxWindowID id = 1, + const wxString &title = wxT("Dolphin DSP-HLE Plugin Settings"), + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_DIALOG_STYLE); + virtual ~ConfigDialog(); - enum { IDD = IDD_SETTINGS }; +private: + DECLARE_EVENT_TABLE(); - BEGIN_MSG_MAP(CConfigDlg) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - COMMAND_ID_HANDLER(IDOK, OnCloseCmd) - COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd) - END_MSG_MAP() + wxButton *m_OK; + wxCheckBox *m_buttonEnableHLEAudio; + wxCheckBox *m_buttonEnableDTKMusic; + wxCheckBox *m_buttonEnableThrottle; - private: + enum + { + wxID_OK, + ID_ENABLE_HLE_AUDIO, + ID_ENABLE_DTK_MUSIC, + ID_ENABLE_THROTTLE + }; - CButton m_buttonEnableHLEAudio; - CButton m_buttonEnableDTKMusic; - CButton m_buttonEnableThrottle; - - // Handler prototypes (uncomment arguments if needed): - // LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) - // LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) - // LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/) - - LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/); - LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/); + void OnOK(wxCommandEvent& event); + void SettingsChanged(wxCommandEvent& event); }; + +#endif //__DSP_HLE_CONFIGDIALOG_h__ diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h index 2a50d97bc5..45e077c2c7 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h @@ -143,7 +143,7 @@ class CDebugger : public wxDialog std::vector all_all_files, all_files, gc_files, wii_files; - // WARNING: Make sure these are not also elsewhere, for example in resource.h. + // WARNING: Make sure these are not also elsewhere enum { IDC_CHECK0 = 2000, diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/SConscript b/Source/Plugins/Plugin_DSP_HLE/Src/SConscript index f8eda6a748..364588a459 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/SConscript +++ b/Source/Plugins/Plugin_DSP_HLE/Src/SConscript @@ -32,6 +32,7 @@ dspenv = env.Clone() if dspenv['HAVE_WX']: files += [ + 'ConfigDlg.cpp', 'Debugger/Debugger.cpp', 'Debugger/PBView.cpp', 'Debugger/Mails.cpp', diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp index a2f7d6b182..9e00656858 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/main.cpp @@ -22,7 +22,15 @@ #include #include "Globals.h" // Local + +#ifdef _WIN32 + #include "PCHW/DSoundStream.h" +#else + #include "PCHW/AOSoundStream.h" +#endif + #if defined(HAVE_WX) && HAVE_WX + #include "ConfigDlg.h" #include "Debugger/File.h" // For file logging #include "Debugger/Debugger.h" // For the CDebugger class CDebugger* m_frame; @@ -31,20 +39,9 @@ #include "ConsoleWindow.h" // Common: For the Windows console #include "ChunkFile.h" #include "WaveFile.h" - -#include "resource.h" -#ifdef _WIN32 - #include "PCHW/DSoundStream.h" - #include "ConfigDlg.h" -#else - #include "PCHW/AOSoundStream.h" -#endif #include "PCHW/Mixer.h" #include "DSPHandler.h" #include "Config.h" - - - /////////////////////////////// @@ -222,9 +219,10 @@ void SetDllGlobals(PLUGIN_GLOBALS* _pPluginGlobals) { void DllConfig(HWND _hParent) { -#ifdef _WIN32 - CConfigDlg configDlg; - configDlg.DoModal(_hParent); +#if defined(HAVE_WX) && HAVE_WX + // (shuffle2) TODO: reparent dlg with DolphinApp + ConfigDialog dlg(NULL); + dlg.ShowModal(); #endif } @@ -241,11 +239,11 @@ void Initialize(void *init) gpName = g_dspInitialize.pName(); // save the game name globally for (u32 i = 0; i < gpName.length(); ++i) // and fix it { - Console::Print(L"%c", gpName[i]); + Console::Print("%c", gpName[i]); std::cout << gpName[i]; if (gpName[i] == ':') gpName[i] = ' '; } - Console::Print(L"\n"); + Console::Print("\n"); #endif CDSPHandler::CreateInstance(); diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/resource.h b/Source/Plugins/Plugin_DSP_HLE/Src/resource.h deleted file mode 100644 index a5315a0ee6..0000000000 --- a/Source/Plugins/Plugin_DSP_HLE/Src/resource.h +++ /dev/null @@ -1,19 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by resource.rc -// -#define IDD_SETTINGS 101 -#define IDC_ENABLE_HLE_AUDIO 1000 -#define IDC_ENABLE_DTK_MUSIC 1001 -#define IDC_ENABLE_THROTTLE 1002 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 103 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1011 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/resource.rc b/Source/Plugins/Plugin_DSP_HLE/Src/resource.rc deleted file mode 100644 index 890ff66866..0000000000 --- a/Source/Plugins/Plugin_DSP_HLE/Src/resource.rc +++ /dev/null @@ -1,103 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_SETTINGS DIALOGEX 0, 0, 157, 86 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Dolphin DSP-HLE Plugin Settings" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,45,65,50,14 - PUSHBUTTON "Cancel",IDCANCEL,101,65,50,14 - GROUPBOX "&Sound settings",IDC_STATIC,7,7,144,57 - CONTROL "&Enable HLE Audio",IDC_ENABLE_HLE_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,22,84,8 - CONTROL "Enab&le DTK Music",IDC_ENABLE_DTK_MUSIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,36,90,8 - CONTROL "Enable Other Audio",IDC_ENABLE_THROTTLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,50,94,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_SETTINGS, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 151 - VERTGUIDE, 13 - TOPMARGIN, 7 - BOTTOMMARGIN, 79 - HORZGUIDE, 31 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/stdafx.h b/Source/Plugins/Plugin_DSP_HLE/Src/stdafx.h index 7ec343bdd8..e2a6f180d1 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/stdafx.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/stdafx.h @@ -26,10 +26,4 @@ #include #include -// WTL -#include -#include -#include -#include - #endif