get WTL out of dsp_hle

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1902 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2009-01-17 21:42:43 +00:00
parent 5994897d9a
commit 9cb25d6ba2
9 changed files with 110 additions and 242 deletions

View File

@ -15,66 +15,70 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "resource.h"
#include "Config.h"
#include "ConfigDlg.h"
LRESULT
CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
BEGIN_EVENT_TABLE(ConfigDialog, wxDialog)
EVT_BUTTON(wxID_OK, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_HLE_AUDIO, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_DTK_MUSIC, ConfigDialog::SettingsChanged)
EVT_CHECKBOX(ID_ENABLE_THROTTLE, ConfigDialog::SettingsChanged)
END_EVENT_TABLE()
ConfigDialog::ConfigDialog(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style)
: wxDialog(parent, id, title, position, size, style)
{
// Load config settings
g_Config.Load();
// Center window
//CenterWindow(this->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);
}