Win32: remove sync options from movie dialog; fix KEYUP handling for modifier keys; send CUSTKEYUP for background keypresses

This commit is contained in:
OV2 2011-05-07 22:24:37 +02:00
parent 0f6e8c3721
commit f505626dda
4 changed files with 43 additions and 69 deletions

View File

@ -185,10 +185,8 @@
#define MOVIE_OPT_NOSAVEDATA (1 << 2)
#define MOVIE_SYNC_DATA_EXISTS 0x01
#define MOVIE_SYNC_OBSOLETE 0x02
#define MOVIE_SYNC_LEFTRIGHT 0x04
#define MOVIE_SYNC_VOLUMEENVX 0x08
#define MOVIE_SYNC_FAKEMUTE 0x10
#define MOVIE_SYNC_SYNCSOUND 0x20
#define MOVIE_SYNC_HASROMINFO 0x40
#define MOVIE_SYNC_NOCPUSHUTDOWN 0x80
#define MOVIE_MAX_METADATA 512

View File

@ -364,13 +364,13 @@ BEGIN
RTEXT "Description",IDC_STATIC,7,103,70,12,SS_CENTERIMAGE
END
IDD_OPENMOVIE DIALOGEX 0, 0, 304, 223
IDD_OPENMOVIE DIALOGEX 0, 0, 304, 166
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Play Movie"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,187,200,50,14
PUSHBUTTON "Cancel",IDCANCEL,246,200,50,14
DEFPUSHBUTTON "OK",IDOK,187,149,50,14
PUSHBUTTON "Cancel",IDCANCEL,246,149,50,14
EDITTEXT IDC_MOVIE_PATH,7,18,230,13,ES_AUTOHSCROLL
LTEXT "Movie File",IDC_STATIC,7,7,33,8
PUSHBUTTON "&Browse...",IDC_BROWSE_MOVIE,248,17,48,14
@ -382,54 +382,45 @@ BEGIN
LTEXT "LENGTH",IDC_MOVIE_LENGTH,71,64,81,8
LTEXT "FRAMES",IDC_MOVIE_FRAMES,71,73,81,8
LTEXT "RERECORD",IDC_MOVIE_RERECORD,71,82,81,8
LTEXT "Author Info:",IDC_LABEL_MOVIEINFOBOX,30,99,38,8
LTEXT "Author Info:",IDC_LABEL_MOVIEINFOBOX,30,123,38,8
CONTROL "Open Read-Only",IDC_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,7,69,10
LTEXT "Static",IDC_MOVIE_METADATA,70,99,226,21,WS_BORDER
GROUPBOX "Record Options",IDC_LABEL_STARTSETTINGS,7,133,77,61
CONTROL "Record from now",IDC_RECORD_NOW,"Button",BS_AUTORADIOBUTTON | WS_DISABLED | WS_GROUP | WS_TABSTOP,11,169,70,10
CONTROL "Record from reset",IDC_RECORD_RESET,"Button",BS_AUTORADIOBUTTON | WS_DISABLED | WS_TABSTOP,11,154,72,10
CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,98,142,45,10
CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,98,162,45,10
CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,98,152,45,10
CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,98,172,45,10
CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,98,183,45,10
GROUPBOX "Record Controllers",IDC_LABEL_CONTROLLERSETTINGS,89,133,69,61
GROUPBOX "Emulator Sync Settings",IDC_LABEL_SYNCSETTINGS,163,133,133,61
CONTROL "Allow Left+Right / Up+Down",IDC_ALLOWLEFTRIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,153,118,11
CONTROL "Sync samples with sound CPU",IDC_SYNC_TO_SOUND_CPU,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,166,117,10
LTEXT " ",IDC_LOADEDFROMMOVIE,169,124,127,8
LTEXT "Static",IDC_MOVIE_METADATA,70,123,226,21,WS_BORDER
GROUPBOX "Record Options",IDC_LABEL_STARTSETTINGS,204,54,95,41
CONTROL "Record from now",IDC_RECORD_NOW,"Button",BS_AUTORADIOBUTTON | WS_DISABLED | WS_GROUP | WS_TABSTOP,208,76,70,10
CONTROL "Record from reset",IDC_RECORD_RESET,"Button",BS_AUTORADIOBUTTON | WS_DISABLED | WS_TABSTOP,208,64,72,10
CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,18,106,45,10
CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,116,106,45,10
CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,67,106,45,10
CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,165,106,45,10
CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,214,106,45,10
GROUPBOX "Record Controllers",IDC_LABEL_CONTROLLERSETTINGS,12,95,272,25
LTEXT "Movie's ROM: CRC32=Unknown, Name=Unknown",IDC_MOVIEROMINFO,8,35,1024,8
LTEXT "Current ROM: CRC32=Unknown, Name=Unknown",IDC_CURRENTROMINFO,9,43,287,9
LTEXT " ",IDC_PLAYWARN,10,203,167,15
LTEXT " ",IDC_PLAYWARN,10,149,167,15
END
IDD_CREATEMOVIE DIALOGEX 0, 0, 303, 150
IDD_CREATEMOVIE DIALOGEX 0, 0, 303, 118
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Record Movie"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
DEFPUSHBUTTON "OK",IDOK,187,129,50,14
PUSHBUTTON "Cancel",IDCANCEL,246,129,50,14
DEFPUSHBUTTON "OK",IDOK,187,96,50,14
PUSHBUTTON "Cancel",IDCANCEL,246,96,50,14
EDITTEXT IDC_MOVIE_PATH,7,18,230,13,ES_AUTOHSCROLL
LTEXT "Movie File",IDC_STATIC,7,7,33,8
PUSHBUTTON "&Browse...",IDC_BROWSE_MOVIE,248,17,48,14
GROUPBOX "Record Options",IDC_LABEL_STARTSETTINGS,7,38,77,61
CONTROL "Record from now",IDC_RECORD_NOW,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,11,65,70,10
CONTROL "Record from reset",IDC_RECORD_RESET,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,11,52,72,10
CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,47,45,10
CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,67,45,10
CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,57,45,10
CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,77,45,10
CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,98,87,45,10
GROUPBOX "Record Controllers",IDC_LABEL_CONTROLLERSETTINGS,89,38,69,61
EDITTEXT IDC_MOVIE_METADATA,67,105,229,14,ES_AUTOHSCROLL
LTEXT "Author Info:",IDC_STATIC,18,108,43,8,0,WS_EX_RIGHT
GROUPBOX "Emulator Sync Settings",IDC_LABEL_SYNCSETTINGS,163,38,133,61
CONTROL "Allow Left+Right / Up+Down",IDC_ALLOWLEFTRIGHT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,62,118,10
CONTROL "Sync samples with sound CPU",IDC_SYNC_TO_SOUND_CPU,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,172,75,117,10
CONTROL "Clear SRAM",IDC_CLEARSRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,83,70,10
GROUPBOX "Record Options",IDC_LABEL_STARTSETTINGS,7,50,77,61
CONTROL "Record from now",IDC_RECORD_NOW,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,11,77,70,10
CONTROL "Record from reset",IDC_RECORD_RESET,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,11,64,72,10
CONTROL "Joypad 1",IDC_JOY1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,59,45,10
CONTROL "Joypad 3",IDC_JOY3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,79,45,10
CONTROL "Joypad 2",IDC_JOY2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,69,45,10
CONTROL "Joypad 4",IDC_JOY4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,89,45,10
CONTROL "Joypad 5",IDC_JOY5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,106,99,45,10
GROUPBOX "Record Controllers",IDC_LABEL_CONTROLLERSETTINGS,97,50,69,61
EDITTEXT IDC_MOVIE_METADATA,67,34,229,14,ES_AUTOHSCROLL
LTEXT "Author Info:",IDC_STATIC,18,37,43,8,0,WS_EX_RIGHT
CONTROL "Clear SRAM",IDC_CLEARSRAM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,95,70,10
END
IDD_KEYCUSTOM DIALOGEX 0, 0, 349, 203
@ -654,12 +645,11 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 297
TOPMARGIN, 7
BOTTOMMARGIN, 219
BOTTOMMARGIN, 162
HORZGUIDE, 31
HORZGUIDE, 55
HORZGUIDE, 120
HORZGUIDE, 133
HORZGUIDE, 191
END
IDD_CREATEMOVIE, DIALOG
@ -667,7 +657,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 296
TOPMARGIN, 7
BOTTOMMARGIN, 143
BOTTOMMARGIN, 111
HORZGUIDE, 31
HORZGUIDE, 38
HORZGUIDE, 99

View File

@ -272,7 +272,6 @@
#define HOTKEYS_LABEL_2_5 TEXT("Sprites Layer")
#define HOTKEYS_LABEL_2_6 TEXT("Clipping Windows")
#define HOTKEYS_LABEL_2_7 TEXT("Transparency")
#define HOTKEYS_LABEL_2_8 TEXT("HDMA Emulation")
#define HOTKEYS_LABEL_2_10 TEXT("Switch Controllers")
#define HOTKEYS_LABEL_2_11 TEXT("Joypad Swap")
#define HOTKEYS_LABEL_2_12 TEXT("Reset Game")
@ -396,7 +395,6 @@
#define WINPROC_TURBOMODE_ON "Fast-Forward Activated"
#define WINPROC_TURBOMODE_OFF "Fast-Forward Deactivated"
#define WINPROC_TURBOMODE_TEXT "Fast-Forward"
#define WINPROC_HDMA_TEXT "HDMA emulation"
#define WINPROC_BG1 "BG#1" //Background Layers
#define WINPROC_BG2 "BG#2"
#define WINPROC_BG3 "BG#3"

View File

@ -1454,11 +1454,11 @@ LRESULT CALLBACK WinProc(
case WM_CUSTKEYUP:
{
int modifiers = 0;
if(GetAsyncKeyState(VK_MENU))
if(GetAsyncKeyState(VK_MENU) || wParam == VK_MENU)
modifiers |= CUSTKEY_ALT_MASK;
if(GetAsyncKeyState(VK_CONTROL))
if(GetAsyncKeyState(VK_CONTROL)|| wParam == VK_CONTROL)
modifiers |= CUSTKEY_CTRL_MASK;
if(GetAsyncKeyState(VK_SHIFT))
if(GetAsyncKeyState(VK_SHIFT)|| wParam == VK_SHIFT)
modifiers |= CUSTKEY_SHIFT_MASK;
if(wParam == CustomKeys.FastForward.key
@ -2687,7 +2687,11 @@ VOID CALLBACK HotkeyTimer( UINT idEvent, UINT uMsg, DWORD dwUser, DWORD dw1, DWO
PostMessage(GUI.hWnd, WM_CUSTKEYDOWN, (WPARAM)(i),(LPARAM)(NULL));
}
else
joyState[i] = 0;
if(joyState[i])
{
joyState[i] = 0;
PostMessage(GUI.hWnd, WM_CUSTKEYUP, (WPARAM)(i),(LPARAM)(NULL));
}
}
counter++;
}
@ -7765,7 +7769,8 @@ static void set_hotkeyinfo(HWND hDlg)
SendDlgItemMessage(hDlg,IDC_HOTKEY5,WM_USER+44,CustomKeys.BGL5.key,CustomKeys.BGL5.modifiers);
SendDlgItemMessage(hDlg,IDC_HOTKEY6,WM_USER+44,CustomKeys.ClippingWindows.key,CustomKeys.ClippingWindows.modifiers);
SendDlgItemMessage(hDlg,IDC_HOTKEY7,WM_USER+44,CustomKeys.Transparency.key,CustomKeys.Transparency.modifiers);
// SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,CustomKeys.HDMA.key,CustomKeys.HDMA.modifiers);
SendDlgItemMessage(hDlg,IDC_HOTKEY8,WM_USER+44,0,0);
SendDlgItemMessage(hDlg,IDC_HOTKEY9,WM_USER+44,0,0);
SendDlgItemMessage(hDlg,IDC_HOTKEY10,WM_USER+44,CustomKeys.SwitchControllers.key,CustomKeys.SwitchControllers.modifiers);
SendDlgItemMessage(hDlg,IDC_HOTKEY11,WM_USER+44,CustomKeys.JoypadSwap.key,CustomKeys.JoypadSwap.modifiers);
SendDlgItemMessage(hDlg,IDC_HOTKEY12,WM_USER+44,CustomKeys.ResetGame.key,CustomKeys.ResetGame.modifiers);
@ -7829,7 +7834,7 @@ static void set_hotkeyinfo(HWND hDlg)
SetDlgItemText(hDlg,IDC_LABEL_HK5,HOTKEYS_LABEL_2_5);
SetDlgItemText(hDlg,IDC_LABEL_HK6,HOTKEYS_LABEL_2_6);
SetDlgItemText(hDlg,IDC_LABEL_HK7,HOTKEYS_LABEL_2_7);
SetDlgItemText(hDlg,IDC_LABEL_HK8,HOTKEYS_LABEL_2_8);
SetDlgItemText(hDlg,IDC_LABEL_HK8,INPUTCONFIG_LABEL_UNUSED);
SetDlgItemText(hDlg,IDC_LABEL_HK9,INPUTCONFIG_LABEL_UNUSED);
SetDlgItemText(hDlg,IDC_LABEL_HK10,HOTKEYS_LABEL_2_10);
SetDlgItemText(hDlg,IDC_LABEL_HK11,HOTKEYS_LABEL_2_11);
@ -10188,8 +10193,6 @@ static void set_movieinfo(const TCHAR* path, HWND hDlg)
// if(m.SyncFlags & MOVIE_SYNC_DATA_EXISTS)
{
SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_LEFTRIGHT)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, (m.SyncFlags & MOVIE_SYNC_SYNCSOUND)!=0 ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0);
// SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T(MOVIE_LABEL_SYNC_DATA_FROM_MOVIE));
}
@ -10330,10 +10333,6 @@ INT_PTR CALLBACK DlgOpenMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(LOWORD(wParam))
{
case IDC_ALLOWLEFTRIGHT:
case IDC_SYNC_TO_SOUND_CPU:
SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), TEXT(""));
break;
case IDC_BROWSE_MOVIE:
{
OPENFILENAME ofn;
@ -10389,8 +10388,6 @@ INT_PTR CALLBACK DlgOpenMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
GetDlgItemText(hDlg, IDC_MOVIE_PATH, op->Path, MAX_PATH);
SetCurrentDirectory(movieDirectory);
}
Settings.UpAndDown = IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT);
Settings.SoundSync = IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU);
EndDialog(hDlg, 1);
return true;
@ -10458,10 +10455,6 @@ INT_PTR CALLBACK DlgCreateMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
SetWindowText(GetDlgItem(hDlg, IDC_MOVIE_PATH), filename);
}
SendDlgItemMessage(hDlg,IDC_ALLOWLEFTRIGHT,BM_SETCHECK, Settings.UpAndDown ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0);
SendDlgItemMessage(hDlg,IDC_SYNC_TO_SOUND_CPU,BM_SETCHECK, Settings.SoundSync ? (WPARAM)BST_CHECKED : (WPARAM)BST_UNCHECKED, 0);
SetWindowText(GetDlgItem(hDlg, IDC_LOADEDFROMMOVIE), _T(""));
//EnableWindow(GetDlgItem(hDlg, IDC_SYNC_TO_SOUND_CPU), Settings.SoundDriver<1||Settings.SoundDriver>3); // can't sync sound to CPU unless using "Snes9x DirectSound" driver
SendDlgItemMessage(hDlg,IDC_RECORD_RESET,BM_SETCHECK, (WPARAM)(GUI.MovieStartFromReset ? BST_CHECKED : BST_UNCHECKED), 0);
@ -10540,12 +10533,7 @@ INT_PTR CALLBACK DlgCreateMovie(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lPara
else
GUI.MovieStartFromReset = FALSE;
Settings.UpAndDown = IsDlgButtonChecked(hDlg, IDC_ALLOWLEFTRIGHT);
Settings.SoundSync = IsDlgButtonChecked(hDlg, IDC_SYNC_TO_SOUND_CPU);
op->SyncFlags = MOVIE_SYNC_DATA_EXISTS | MOVIE_SYNC_HASROMINFO;
if(Settings.UpAndDown) op->SyncFlags |= MOVIE_SYNC_LEFTRIGHT;
if(Settings.SoundSync) op->SyncFlags |= MOVIE_SYNC_SYNCSOUND;
if(IsDlgButtonChecked(hDlg, IDC_CLEARSRAM) && IsDlgButtonChecked(hDlg, IDC_RECORD_RESET) && existsSRAM())
{