ADDED gbSoundDeclicking option

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@675 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
spacy51 2008-08-31 20:03:39 +00:00
parent c6c57e2594
commit b3d8dd9a8a
8 changed files with 52 additions and 27 deletions

View File

@ -12,8 +12,10 @@ AudioCoreSettingsDlg::AudioCoreSettingsDlg(CWnd* pParent /*=NULL*/)
: CDialog(AudioCoreSettingsDlg::IDD, pParent) : CDialog(AudioCoreSettingsDlg::IDD, pParent)
, m_enabled( false ) , m_enabled( false )
, m_surround( false ) , m_surround( false )
, m_declicking( false )
, m_echo( 0.0f ) , m_echo( 0.0f )
, m_stereo( 0.0f ) , m_stereo( 0.0f )
, m_volume( 0.0f )
, toolTip( NULL ) , toolTip( NULL )
{ {
} }
@ -32,10 +34,12 @@ void AudioCoreSettingsDlg::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_ECHO, echo); DDX_Control(pDX, IDC_ECHO, echo);
DDX_Control(pDX, IDC_STEREO, stereo); DDX_Control(pDX, IDC_STEREO, stereo);
DDX_Control(pDX, IDC_VOLUME, volume); DDX_Control(pDX, IDC_VOLUME, volume);
DDX_Control(pDX, IDC_DECLICKING, declicking);
if( pDX->m_bSaveAndValidate == TRUE ) { if( pDX->m_bSaveAndValidate == TRUE ) {
m_enabled = BST_CHECKED == enhance_sound.GetCheck(); m_enabled = BST_CHECKED == enhance_sound.GetCheck();
m_surround = BST_CHECKED == surround.GetCheck(); m_surround = BST_CHECKED == surround.GetCheck();
m_declicking = BST_CHECKED == declicking.GetCheck();
m_echo = (float)echo.GetPos() / 100.0f; m_echo = (float)echo.GetPos() / 100.0f;
m_stereo = (float)stereo.GetPos() / 100.0f; m_stereo = (float)stereo.GetPos() / 100.0f;
m_volume = (float)volume.GetPos() / 100.0f; m_volume = (float)volume.GetPos() / 100.0f;
@ -85,6 +89,11 @@ BOOL AudioCoreSettingsDlg::OnTtnNeedText(UINT id, NMHDR *pNMHDR, LRESULT *pResul
_tcscpy_s( buf, _countof( buf ), res.GetString() ); _tcscpy_s( buf, _countof( buf ), res.GetString() );
t3->lpszText = buf; t3->lpszText = buf;
break; break;
case IDC_DECLICKING:
res.LoadString( IDS_TOOLTIP_DECLICKING );
_tcscpy_s( buf, _countof( buf ), res.GetString() );
t3->lpszText = buf;
break;
default: default:
i_provided_tooltip_with_text = FALSE; i_provided_tooltip_with_text = FALSE;
break; break;
@ -112,12 +121,15 @@ BOOL AudioCoreSettingsDlg::OnInitDialog()
toolTip->AddTool( GetDlgItem( IDC_DEFAULT_VOLUME ) ); toolTip->AddTool( GetDlgItem( IDC_DEFAULT_VOLUME ) );
toolTip->AddTool( GetDlgItem( IDC_ENHANCE_SOUND ) ); toolTip->AddTool( GetDlgItem( IDC_ENHANCE_SOUND ) );
toolTip->AddTool( GetDlgItem( IDC_SURROUND ) ); toolTip->AddTool( GetDlgItem( IDC_SURROUND ) );
toolTip->AddTool( GetDlgItem( IDC_DECLICKING ) );
toolTip->Activate( TRUE ); toolTip->Activate( TRUE );
enhance_sound.SetCheck( m_enabled ? BST_CHECKED : BST_UNCHECKED ); enhance_sound.SetCheck( m_enabled ? BST_CHECKED : BST_UNCHECKED );
surround.SetCheck( m_surround ? BST_CHECKED : BST_UNCHECKED ); surround.SetCheck( m_surround ? BST_CHECKED : BST_UNCHECKED );
declicking.SetCheck( m_declicking ? BST_CHECKED : BST_UNCHECKED );
echo.SetRange( 0, 100 ); echo.SetRange( 0, 100 );
echo.SetPos( (int)( m_echo * 100.0f ) ); echo.SetPos( (int)( m_echo * 100.0f ) );

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "stdafx.h" #include "stdafx.h"
#include "afxwin.h"
// AudioCoreSettingsDlg dialog // AudioCoreSettingsDlg dialog
@ -12,6 +13,7 @@ class AudioCoreSettingsDlg : public CDialog
public: public:
bool m_enabled; bool m_enabled;
bool m_surround; bool m_surround;
bool m_declicking;
float m_echo; float m_echo;
float m_stereo; float m_stereo;
float m_volume; float m_volume;
@ -35,6 +37,7 @@ protected:
private: private:
CButton enhance_sound; CButton enhance_sound;
CButton surround; CButton surround;
CButton declicking;
CSliderCtrl echo; CSliderCtrl echo;
CSliderCtrl stereo; CSliderCtrl stereo;
CSliderCtrl volume; CSliderCtrl volume;

View File

@ -423,7 +423,7 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config) ON_COMMAND(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnOutputapiXaudio2config)
ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config) ON_UPDATE_COMMAND_UI(ID_OUTPUTAPI_XAUDIO2CONFIG, &MainWnd::OnUpdateOutputapiXaudio2config)
ON_WM_ENTERSIZEMOVE() ON_WM_ENTERSIZEMOVE()
ON_COMMAND(ID_AUDIO_CORE_SETTINGS, &MainWnd::OnAudioEffects) ON_COMMAND(ID_AUDIO_CORE_SETTINGS, &MainWnd::OnAudioCoreSettings)
END_MESSAGE_MAP() END_MESSAGE_MAP()

View File

@ -388,5 +388,5 @@ public:
DECLARE_MESSAGE_MAP() DECLARE_MESSAGE_MAP()
afx_msg void OnEnterSizeMove(); afx_msg void OnEnterSizeMove();
afx_msg void OnAudioEffects(); afx_msg void OnAudioCoreSettings();
}; };

View File

@ -800,7 +800,7 @@ void MainWnd::OnUpdateOptionsEmulatorBmpformat(CCmdUI* pCmdUI)
pCmdUI->SetCheck(theApp.captureFormat == 1); pCmdUI->SetCheck(theApp.captureFormat == 1);
} }
void MainWnd::OnAudioEffects() void MainWnd::OnAudioCoreSettings()
{ {
AudioCoreSettingsDlg dlg; AudioCoreSettingsDlg dlg;
@ -809,6 +809,7 @@ void MainWnd::OnAudioEffects()
dlg.m_echo = gb_effects_config.echo; dlg.m_echo = gb_effects_config.echo;
dlg.m_stereo = gb_effects_config.stereo; dlg.m_stereo = gb_effects_config.stereo;
dlg.m_volume = soundGetVolume(); dlg.m_volume = soundGetVolume();
dlg.m_declicking = gbSoundGetDeclicking();
if( IDOK == dlg.DoModal() ) { if( IDOK == dlg.DoModal() ) {
gb_effects_config_t _new; gb_effects_config_t _new;
@ -821,6 +822,8 @@ void MainWnd::OnAudioEffects()
gbSoundConfigEffects( _new ); gbSoundConfigEffects( _new );
soundSetVolume( dlg.m_volume ); soundSetVolume( dlg.m_volume );
gbSoundSetDeclicking( dlg.m_declicking );
} }
} }

View File

@ -1595,6 +1595,8 @@ void VBA::loadSettings()
gb_effects_config.echo = (float)regQueryDwordValue( "gbSoundEffectsEcho", 20 ) / 100.0f; gb_effects_config.echo = (float)regQueryDwordValue( "gbSoundEffectsEcho", 20 ) / 100.0f;
gb_effects_config.stereo = (float)regQueryDwordValue( "gbSoundEffectsStereo", 15 ) / 100.0f; gb_effects_config.stereo = (float)regQueryDwordValue( "gbSoundEffectsStereo", 15 ) / 100.0f;
gbSoundSetDeclicking( 1 == regQueryDwordValue( "gbSoundDeclicking", 1 ) );
tripleBuffering = regQueryDwordValue("tripleBuffering", false) ? true : false; tripleBuffering = regQueryDwordValue("tripleBuffering", false) ? true : false;
#ifndef NO_D3D #ifndef NO_D3D
@ -2590,6 +2592,8 @@ void VBA::saveSettings()
regSetDwordValue( "gbSoundEffectsEcho", (DWORD)( gb_effects_config.echo * 100.0f ) ); regSetDwordValue( "gbSoundEffectsEcho", (DWORD)( gb_effects_config.echo * 100.0f ) );
regSetDwordValue( "gbSoundEffectsStereo", (DWORD)( gb_effects_config.stereo * 100.0f ) ); regSetDwordValue( "gbSoundEffectsStereo", (DWORD)( gb_effects_config.stereo * 100.0f ) );
regSetDwordValue( "gbSoundDeclicking", gbSoundGetDeclicking() ? 1 : 0 );
regSetDwordValue("tripleBuffering", tripleBuffering); regSetDwordValue("tripleBuffering", tripleBuffering);
#ifndef NO_D3D #ifndef NO_D3D

View File

@ -1167,30 +1167,30 @@ BEGIN
RTEXT "Device:",IDC_STATIC,6,6,48,12 RTEXT "Device:",IDC_STATIC,6,6,48,12
END END
IDD_AUDIO_CORE_SETTINGS DIALOGEX 0, 0, 256, 144 IDD_AUDIO_CORE_SETTINGS DIALOGEX 0, 0, 168, 211
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Audio Core Settings" CAPTION "Audio Core Settings"
FONT 8, "MS Shell Dlg", 400, 0, 0x1 FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN BEGIN
DEFPUSHBUTTON "OK",IDOK,150,126,48,14 DEFPUSHBUTTON "OK",IDOK,60,192,48,14
PUSHBUTTON "Cancel",IDCANCEL,204,126,48,14 PUSHBUTTON "Cancel",IDCANCEL,114,192,48,14
GROUPBOX "Game Boy only",IDC_STATIC,6,6,126,114 GROUPBOX "Game Boy only",IDC_STATIC,6,54,156,132
CONTROL "Enhance sound",IDC_ENHANCE_SOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,18,65,10 CONTROL "Enhance sound",IDC_ENHANCE_SOUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,66,65,10
CONTROL "Surround",IDC_SURROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,30,45,10 CONTROL "Surround",IDC_SURROUND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,78,45,10
GROUPBOX "Echo",IDC_STATIC,24,42,102,36 GROUPBOX "Echo",IDC_STATIC,24,102,132,36
CONTROL "",IDC_ECHO,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS | WS_TABSTOP,30,54,90,12 CONTROL "",IDC_ECHO,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS | WS_TABSTOP,30,114,120,12
LTEXT "None",IDC_STATIC,30,66,36,8,SS_CENTERIMAGE LTEXT "None",IDC_STATIC,30,126,36,8,SS_CENTERIMAGE
RTEXT "Lots",IDC_STATIC,84,66,36,8,SS_CENTERIMAGE RTEXT "Lots",IDC_STATIC,114,126,36,8,SS_CENTERIMAGE
GROUPBOX "Stereo",IDC_STATIC,24,78,102,36 GROUPBOX "Stereo",IDC_STATIC,24,144,132,36
CONTROL "",IDC_STEREO,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS | WS_TABSTOP,30,90,90,12 CONTROL "",IDC_STEREO,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS | WS_TABSTOP,30,156,120,12
LTEXT "Center",IDC_STATIC,30,102,36,8,SS_CENTERIMAGE LTEXT "Center",IDC_STATIC,30,168,36,8,SS_CENTERIMAGE
RTEXT "Left/Right",IDC_STATIC,84,102,36,8,SS_CENTERIMAGE RTEXT "Left/Right",IDC_STATIC,114,168,36,8,SS_CENTERIMAGE
GROUPBOX "Game Boy Advance only",IDC_STATIC,138,6,114,114 GROUPBOX "Volume",IDC_STATIC,6,6,156,42
GROUPBOX "Volume",IDC_STATIC,144,18,102,42 CONTROL "",IDC_VOLUME,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS | WS_TABSTOP,12,18,144,12
CONTROL "",IDC_VOLUME,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | TBS_TOOLTIPS | WS_TABSTOP,150,30,90,12 LTEXT "Mute",IDC_STATIC,12,30,48,12,SS_CENTERIMAGE
LTEXT "Mute",IDC_STATIC,150,42,18,12,SS_CENTERIMAGE RTEXT "Maximum",IDC_STATIC,108,30,48,12,SS_CENTERIMAGE
RTEXT "Max",IDC_STATIC,222,42,18,12,SS_CENTERIMAGE PUSHBUTTON "Default",IDC_DEFAULT_VOLUME,66,30,36,12,BS_NOTIFY
PUSHBUTTON "Default",IDC_DEFAULT_VOLUME,174,42,42,12,BS_NOTIFY CONTROL "Declicking",IDC_DECLICKING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,24,90,47,10
END END
@ -1546,9 +1546,9 @@ BEGIN
IDD_AUDIO_CORE_SETTINGS, DIALOG IDD_AUDIO_CORE_SETTINGS, DIALOG
BEGIN BEGIN
LEFTMARGIN, 7 LEFTMARGIN, 7
RIGHTMARGIN, 249 RIGHTMARGIN, 161
TOPMARGIN, 7 TOPMARGIN, 7
BOTTOMMARGIN, 137 BOTTOMMARGIN, 204
END END
END END
#endif // APSTUDIO_INVOKED #endif // APSTUDIO_INVOKED
@ -1835,15 +1835,14 @@ BEGIN
BEGIN BEGIN
POPUP "&Throttle" POPUP "&Throttle"
BEGIN BEGIN
MENUITEM "No throttle", ID_OPTIONS_FRAMESKIP_THROTTLE_NOTHROTTLE
MENUITEM "25%", ID_OPTIONS_FRAMESKIP_THROTTLE_25 MENUITEM "25%", ID_OPTIONS_FRAMESKIP_THROTTLE_25
MENUITEM "50%", ID_OPTIONS_FRAMESKIP_THROTTLE_50 MENUITEM "50%", ID_OPTIONS_FRAMESKIP_THROTTLE_50
MENUITEM "100%", ID_OPTIONS_FRAMESKIP_THROTTLE_100 MENUITEM "100%", ID_OPTIONS_FRAMESKIP_THROTTLE_100
MENUITEM "150%", ID_OPTIONS_FRAMESKIP_THROTTLE_150 MENUITEM "150%", ID_OPTIONS_FRAMESKIP_THROTTLE_150
MENUITEM "200%", ID_OPTIONS_FRAMESKIP_THROTTLE_200 MENUITEM "200%", ID_OPTIONS_FRAMESKIP_THROTTLE_200
MENUITEM "&Other...", ID_OPTIONS_FRAMESKIP_THROTTLE_OTHER MENUITEM "&Other...", ID_OPTIONS_FRAMESKIP_THROTTLE_OTHER
MENUITEM "No throttle", ID_OPTIONS_FRAMESKIP_THROTTLE_NOTHROTTLE
END END
MENUITEM SEPARATOR
POPUP "&Frame Skip" POPUP "&Frame Skip"
BEGIN BEGIN
MENUITEM "&No frame skip", ID_OPTIONS_VIDEO_FRAMESKIP_0 MENUITEM "&No frame skip", ID_OPTIONS_VIDEO_FRAMESKIP_0
@ -1857,6 +1856,7 @@ BEGIN
MENUITEM "&8 frames", ID_OPTIONS_VIDEO_FRAMESKIP_8 MENUITEM "&8 frames", ID_OPTIONS_VIDEO_FRAMESKIP_8
MENUITEM "&9 frames", ID_OPTIONS_VIDEO_FRAMESKIP_9 MENUITEM "&9 frames", ID_OPTIONS_VIDEO_FRAMESKIP_9
END END
MENUITEM SEPARATOR
MENUITEM "Turbo mode", ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE MENUITEM "Turbo mode", ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE
END END
MENUITEM SEPARATOR MENUITEM SEPARATOR
@ -2220,6 +2220,7 @@ BEGIN
IDS_TOOLTIP_DEFAULT_VOLUME "Reset to default volume (100%)." IDS_TOOLTIP_DEFAULT_VOLUME "Reset to default volume (100%)."
IDS_TOOLTIP_ENHANCE_SOUND "Enable the following sound enhancements." IDS_TOOLTIP_ENHANCE_SOUND "Enable the following sound enhancements."
IDS_TOOLTIP_SURROUND "Inverts the phase of some channels, making it sound as if sound is coming from behind." IDS_TOOLTIP_SURROUND "Inverts the phase of some channels, making it sound as if sound is coming from behind."
IDS_TOOLTIP_DECLICKING "When enabled, clicks are reduced by using GBA sound hardware. Note that clicks are normal for GB and GBC sound hardware."
END END
STRINGTABLE STRINGTABLE

View File

@ -49,6 +49,7 @@
#define IDS_UNSUPPORTED_GAMESHARK_CODE 43 #define IDS_UNSUPPORTED_GAMESHARK_CODE 43
#define IDS_TOOLTIP_ENHANCE_SOUND 43 #define IDS_TOOLTIP_ENHANCE_SOUND 43
#define IDS_TOOLTIP_SURROUND 44 #define IDS_TOOLTIP_SURROUND 44
#define IDS_TOOLTIP_DECLICKING 45
#define IDI_MAINICON 101 #define IDI_MAINICON 101
#define IDD_REGISTERS 102 #define IDD_REGISTERS 102
#define IDD_DEBUG 103 #define IDD_DEBUG 103
@ -550,6 +551,7 @@
#define IDC_SLIDER2 1291 #define IDC_SLIDER2 1291
#define IDC_VOLUME 1291 #define IDC_VOLUME 1291
#define IDC_DEFAULT_VOLUME 1292 #define IDC_DEFAULT_VOLUME 1292
#define IDC_DECLICKING 1293
#define IDS_OAL_NODEVICE 2000 #define IDS_OAL_NODEVICE 2000
#define IDS_OAL_NODLL 2001 #define IDS_OAL_NODLL 2001
#define IDS_AVI_CANNOT_CREATE_AVI 2002 #define IDS_AVI_CANNOT_CREATE_AVI 2002