Added Enable Other Audio option to DSP HLE

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1233 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2008-11-21 02:53:54 +00:00
parent 8a77ca8189
commit f1e8b46c6c
9 changed files with 63 additions and 26 deletions

View File

@ -314,7 +314,7 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
GetHandle(),
_LocalCoreStartupParameter.m_strVideoPlugin.c_str(),
true, true
);
);
} // don't have any else, just ignore it
}

View File

@ -870,5 +870,9 @@
</File>
</Files>
<Globals>
<Global
Name="RESOURCE_FILE"
Value="Src\resource.rc"
/>
</Globals>
</VisualStudioProject>

View File

@ -43,33 +43,38 @@ void CConfig::Load()
IniFile file;
file.Load(FULL_CONFIG_DIR "DSP.ini");
file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true);
file.Get("Config", "EnableHLEAudio", &m_EnableHLEAudio, true); // Sound Settings
file.Get("Config", "EnableDTKMusic", &m_EnableDTKMusic, true);
file.Get("Config", "EnableThrottle", &m_EnableThrottle, true);
file.Get("Config", "Interpolation", &m_Interpolation, true);
file.Get("Config", "DumpSamples", &m_DumpSamples, false);
file.Get("Config", "AntiGap", &m_AntiGap, false);
file.Get("Config", "DumpSamples", &m_DumpSamples, false); // Sample Dumping
file.Get("Config", "DumpSampleMinLength", &m_DumpSampleMinLength, true);
#ifdef _WIN32
file.Get("Config", "DumpSamplePath", &m_szSamplePath, "C:\\");
#else
file.Get("Config", "DumpSamplePath", &m_szSamplePath, "/dev/null/");
#endif
file.Get("Config", "AntiGap", &m_AntiGap, false);
#endif
}
void CConfig::Save()
{
IniFile file;
file.Load(FULL_CONFIG_DIR "DSP.ini");
file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio);
file.Set("Config", "EnableHLEAudio", m_EnableHLEAudio); // Sound Settings
file.Set("Config", "EnableDTKMusic", m_EnableDTKMusic);
file.Set("Config", "EnableThrottle", m_EnableThrottle);
file.Set("Config", "Interpolation", m_Interpolation);
file.Set("Config", "DumpSamples", m_DumpSamples);
file.Set("Config", "AntiGap", m_AntiGap);
file.Set("Config", "DumpSamples", m_DumpSamples); // Sample Dumping
file.Set("Config", "DumpSampleMinLength", m_DumpSampleMinLength);
#ifdef _WIN32
file.Set("Config", "DumpSamplePath", m_szSamplePath);
#else
file.Set("Config", "DumpSamplePath", m_szSamplePath);
#endif
file.Set("Config", "AntiGap", m_AntiGap);
file.Save(FULL_CONFIG_DIR "DSP.ini");
}

View File

@ -25,6 +25,7 @@ struct CConfig
bool m_AntiGap;
bool m_EnableHLEAudio;
bool m_EnableDTKMusic;
bool m_EnableThrottle;
bool m_Interpolation;
bool m_DumpSamples;
std::string m_szSamplePath;

View File

@ -23,18 +23,26 @@
LRESULT
CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
// Load config settings
g_Config.Load();
// Center window
//CenterWindow(this->GetParent());
CenterWindow(GetParent());
// Get button handles
m_buttonEnableHLEAudio = GetDlgItem(IDC_ENABLE_HLE_AUDIO);
m_buttonEnableDTKMusic = GetDlgItem(IDC_ENABLE_DTK_MUSIC);
m_buttonEnableThrottle = GetDlgItem(IDC_ENABLE_THROTTLE);
m_buttonAntiGap = GetDlgItem(IDC_ANTIGAP);
m_buttonDumpSamples = GetDlgItem(IDC_DUMPSAMPLES);
m_editDumpSamplePath = GetDlgItem(IDC_SAMPLEDUMPPATH);
m_comboSampleRate = GetDlgItem(IDC_SAMPLERATE);
// 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_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());
@ -49,10 +57,12 @@ CConfigDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BO
LRESULT
CConfigDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// 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.m_DumpSamples = (m_buttonDumpSamples.GetCheck() == BST_CHECKED) ? true : false;
g_Config.m_AntiGap = (m_buttonAntiGap.GetCheck() == BST_CHECKED) ? true : false;
char temp[MAX_PATH];
@ -68,3 +78,10 @@ CConfigDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /
}
LRESULT CConfigDlg::OnBnClickedEnableSpeedThrottle(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: Add your control notification handler code here
return 0;
}

View File

@ -28,12 +28,14 @@ class CConfigDlg
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
COMMAND_HANDLER(IDC_ENABLE_SPEED_THROTTLE, BN_CLICKED, OnBnClickedEnableSpeedThrottle)
END_MSG_MAP()
private:
CButton m_buttonEnableHLEAudio;
CButton m_buttonEnableDTKMusic;
CButton m_buttonEnableThrottle;
CButton m_buttonDumpSamples;
CButton m_buttonAntiGap;
CEdit m_editDumpSamplePath;
@ -46,4 +48,6 @@ class CConfigDlg
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
public:
LRESULT OnBnClickedEnableSpeedThrottle(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
};

View File

@ -21,6 +21,7 @@
#include "../Config.h"
#include "../Globals.h"
#include "../DSPHandler.h"
#include "../Logging/Console.h"
#include "Thread.h"
#include "Mixer.h"
#include "FixedSizeQueue.h"
@ -99,12 +100,16 @@ void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate) {
static int acc=0;
#ifdef _WIN32
if (!GetAsyncKeyState(VK_TAB)) {
if (! (GetAsyncKeyState(VK_TAB)) && g_Config.m_EnableThrottle) {
/* This is only needed for non-AX sound, currently directly streamed and
DTK sound. For AX we call DSound_UpdateSound in AXTask() for example. */
while (queue_size > queue_maxlength / 2) {
DSound::DSound_UpdateSound();
Sleep(0);
}
} else {
wprintf("Tab");
return;
}
#else

View File

@ -9,14 +9,13 @@
#define IDC_SAMPLERATE 1001
#define IDC_EDIT1 1002
#define IDC_SAMPLEDUMPPATH 1002
//#define IDC_CHECK1 1003 // these conflicted with CDebugger
#define IDC_ENABLE_AUDIO 1003
#define IDC_ENABLE_HLE_AUDIO 1003
//#define IDC_CHECK2 1004
#define IDC_ENABLE_DTK_MUSIC 1004
#define IDC_DUMPSAMPLES 1005
#define IDC_SAMPLEMINLENGTH 1006
#define IDC_BROWSE 1007
#define IDC_ENABLE_THROTTLE 1008
#define IDC_ANTIGAP 1009
#define IDC_CHECK3 1010

View File

@ -52,24 +52,26 @@ END
// Dialog
//
IDD_SETTINGS DIALOGEX 0, 0, 241, 138
IDD_SETTINGS DIALOGEX 0, 0, 281, 147
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,129,116,50,14
PUSHBUTTON "Cancel",IDCANCEL,184,116,50,14
GROUPBOX "&Sound settings",IDC_STATIC,7,7,227,45
EDITTEXT IDC_SAMPLEDUMPPATH,13,89,155,13,ES_AUTOHSCROLL | WS_DISABLED
DEFPUSHBUTTON "OK",IDOK,171,126,50,14
PUSHBUTTON "Cancel",IDCANCEL,225,126,50,14
GROUPBOX "&Sound settings",IDC_STATIC,7,7,267,57
EDITTEXT IDC_SAMPLEDUMPPATH,13,99,192,13,ES_AUTOHSCROLL | WS_DISABLED
CONTROL "&Enable HLE Audio",IDC_ENABLE_HLE_AUDIO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,22,84,8
GROUPBOX "Sample d&umping",IDC_STATIC,7,59,227,51
GROUPBOX "Sample d&umping",IDC_STATIC,7,69,267,51
CONTROL "Enab&le DTK Music",IDC_ENABLE_DTK_MUSIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,36,102,8
CONTROL "&Dump all samples longer than",IDC_DUMPSAMPLES,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,13,73,105,9
EDITTEXT IDC_SAMPLEMINLENGTH,122,71,47,12,ES_AUTOHSCROLL | WS_DISABLED
LTEXT "seconds to:",IDC_STATIC,173,73,40,10
PUSHBUTTON "&Browse...",IDC_BROWSE,173,89,54,14
CONTROL "&Anti-gap (dangerous!)",IDC_ANTIGAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,22,96,9
CONTROL "&Reverb",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,122,36,89,10
CONTROL "&Dump all samples longer than",IDC_DUMPSAMPLES,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,13,83,105,9
EDITTEXT IDC_SAMPLEMINLENGTH,122,80,47,12,ES_AUTOHSCROLL | WS_DISABLED
LTEXT "seconds to:",IDC_STATIC,173,83,40,10
PUSHBUTTON "&Browse...",IDC_BROWSE,213,99,54,14
CONTROL "&Anti-gap (dangerous!)",IDC_ANTIGAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,147,22,96,9
CONTROL "&Reverb",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,147,36,89,10
CONTROL "Enable Other Audio (Speed Throttle)",IDC_ENABLE_THROTTLE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,50,132,10
END
IDD_ABOUT DIALOGEX 0, 0, 184, 65
@ -94,12 +96,12 @@ BEGIN
IDD_SETTINGS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 234
RIGHTMARGIN, 274
VERTGUIDE, 13
VERTGUIDE, 122
VERTGUIDE, 147
VERTGUIDE, 168
TOPMARGIN, 7
BOTTOMMARGIN, 131
BOTTOMMARGIN, 140
HORZGUIDE, 31
END