2008-08-16 21:58:07 +00:00
|
|
|
// Copyright (C) 2003-2008 Dolphin Project.
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, version 2.0.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License 2.0 for more details.
|
|
|
|
|
|
|
|
// A copy of the GPL 2.0 should have been included with the program.
|
|
|
|
// If not, see http://www.gnu.org/licenses/
|
|
|
|
|
|
|
|
// 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*/)
|
|
|
|
{
|
2008-11-21 02:53:54 +00:00
|
|
|
// Load config settings
|
2008-08-16 21:58:07 +00:00
|
|
|
g_Config.Load();
|
2008-11-21 02:53:54 +00:00
|
|
|
|
|
|
|
// Center window
|
2008-08-16 21:58:07 +00:00
|
|
|
//CenterWindow(this->GetParent());
|
|
|
|
CenterWindow(GetParent());
|
2008-11-21 02:53:54 +00:00
|
|
|
|
|
|
|
// Get button handles
|
2008-08-16 21:58:07 +00:00
|
|
|
m_buttonEnableHLEAudio = GetDlgItem(IDC_ENABLE_HLE_AUDIO);
|
|
|
|
m_buttonEnableDTKMusic = GetDlgItem(IDC_ENABLE_DTK_MUSIC);
|
2008-11-21 02:53:54 +00:00
|
|
|
m_buttonEnableThrottle = GetDlgItem(IDC_ENABLE_THROTTLE);
|
2008-08-16 21:58:07 +00:00
|
|
|
m_buttonAntiGap = GetDlgItem(IDC_ANTIGAP);
|
|
|
|
m_buttonDumpSamples = GetDlgItem(IDC_DUMPSAMPLES);
|
|
|
|
m_editDumpSamplePath = GetDlgItem(IDC_SAMPLEDUMPPATH);
|
|
|
|
m_comboSampleRate = GetDlgItem(IDC_SAMPLERATE);
|
|
|
|
|
2008-11-21 02:53:54 +00:00
|
|
|
// Update checkboxes
|
2008-08-16 21:58:07 +00:00
|
|
|
m_buttonEnableHLEAudio.SetCheck(g_Config.m_EnableHLEAudio ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
m_buttonEnableDTKMusic.SetCheck(g_Config.m_EnableDTKMusic ? BST_CHECKED : BST_UNCHECKED);
|
2008-11-21 02:53:54 +00:00
|
|
|
m_buttonEnableThrottle.SetCheck(g_Config.m_EnableThrottle ? BST_CHECKED : BST_UNCHECKED);
|
2008-08-16 21:58:07 +00:00
|
|
|
m_buttonAntiGap.SetCheck(g_Config.m_AntiGap ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
m_buttonDumpSamples.SetCheck(g_Config.m_DumpSamples ? BST_CHECKED : BST_UNCHECKED);
|
|
|
|
m_editDumpSamplePath.SetWindowText(g_Config.m_szSamplePath.c_str());
|
|
|
|
m_comboSampleRate.AddString("44100");
|
|
|
|
m_comboSampleRate.AddString("48000");
|
|
|
|
m_comboSampleRate.SetCurSel(g_Config.m_SampleRate == 44100 ? 0 : 1);
|
|
|
|
|
2008-11-22 16:46:12 +00:00
|
|
|
// Add tooltips
|
|
|
|
CToolTipCtrl ToolTips;
|
|
|
|
ToolTips.Create(m_hWnd);
|
|
|
|
ToolTips.Activate(true);
|
|
|
|
ToolTips.SetMaxTipWidth(200); // 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);
|
|
|
|
|
2008-08-16 21:58:07 +00:00
|
|
|
return(TRUE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LRESULT
|
|
|
|
CConfigDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
|
|
|
{
|
2008-11-21 02:53:54 +00:00
|
|
|
// Save settings
|
2008-08-16 21:58:07 +00:00
|
|
|
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;
|
2008-11-21 02:53:54 +00:00
|
|
|
g_Config.m_EnableThrottle = (m_buttonEnableThrottle.GetCheck() == BST_CHECKED) ? true : false;
|
2008-08-16 21:58:07 +00:00
|
|
|
g_Config.m_DumpSamples = (m_buttonDumpSamples.GetCheck() == BST_CHECKED) ? true : false;
|
|
|
|
g_Config.m_AntiGap = (m_buttonAntiGap.GetCheck() == BST_CHECKED) ? true : false;
|
|
|
|
char temp[MAX_PATH];
|
|
|
|
m_editDumpSamplePath.GetWindowText(temp, MAX_PATH);
|
|
|
|
g_Config.m_szSamplePath = temp;
|
|
|
|
g_Config.m_SampleRate = (m_comboSampleRate.GetCurSel() == 0 ? 44100 : 48000);
|
|
|
|
g_Config.Save();
|
|
|
|
}
|
|
|
|
|
|
|
|
EndDialog(wID);
|
|
|
|
g_Config.Save();
|
|
|
|
return(0);
|
|
|
|
}
|