From 26fdf497770d0db1ce903d132a522264702f145d Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 13 Dec 2008 01:55:04 +0000 Subject: [PATCH] win32 - ripped out my failed add comment/subtitle function --- src/drivers/win/res.rc | 3 -- src/drivers/win/window.cpp | 88 -------------------------------------- 2 files changed, 91 deletions(-) diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index f8db1ae5..9f0db8ff 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -328,9 +328,6 @@ BEGIN MENUITEM "Play Movie from Beginning", FCEU_CONTEXT_PLAYMOVIEFROMBEGINNING MENUITEM "Stop Movie", FCEU_CONTEXT_STOPMOVIE MENUITEM SEPARATOR - MENUITEM "Insert Subtitle", FCEU_CONTEXT_INSERTSUBTITLE - MENUITEM "Insert Comment", FCEU_CONTEXT_INSERTCOMMENT - MENUITEM SEPARATOR MENUITEM "&Help....", FCEU_CONTEXT_MOVIEHELP END POPUP "Game+NoMovie" diff --git a/src/drivers/win/window.cpp b/src/drivers/win/window.cpp index 29d6bbef..1a6de11e 100644 --- a/src/drivers/win/window.cpp +++ b/src/drivers/win/window.cpp @@ -1258,13 +1258,6 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam) break; //Context Menus------------------------------------------------------ - //Game+Movie - case FCEU_CONTEXT_INSERTSUBTITLE: - InsertSubtitle(hWnd); - break; - case FCEU_CONTEXT_INSERTCOMMENT: - InsertComment(hWnd); - break; case FCEU_CONTEXT_MOVIEHELP: OpenHelpWindow(moviehelp); break; @@ -1988,85 +1981,4 @@ void UpdateMenuHotkeys() combo = GetKeyComboName(FCEUD_CommandMapping[EMUCMD_TOOL_OPENCDLOGGER]); combined = "Code/Data Logger...\t" + combo; ChangeMenuItemText(MENU_CDLOGGER, combined); -} - -LRESULT CALLBACK InsertCommentSubtitleProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - - - - static int *success; - char message[128]; //Will contain the contents of the edit box - stringstream frame; //Converts current frame number to stringstream - frame << currFrameCounter; - string Subtitle; //Subtitle string - wstring Comment; //Comment string - - - switch (uMsg) - { - case WM_INITDIALOG: - { - if (CommentSubtitle) - SetDlgItemText(hDlg,INSERTCS_STATIC, "Insert Comment:"); - else - SetDlgItemText(hDlg, INSERTCS_STATIC, "Insert Subtitle:"); - success = (int*)lParam; - return true; - } - break; - - case WM_CLOSE: - case WM_DESTROY: - case WM_QUIT: - { - EndDialog(hDlg, 0); - return true; - } - - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case INSERTCS_IDOK: - { - if (CommentSubtitle) //Comment - { - GetDlgItemText(hDlg, INSERTCS_MESSAGE, message, 128); //Place the text in the edit box into message[128] - Comment = mbstowcs(message); - currMovieData.comments.push_back(Comment); - } - else //Subtitle - { - GetDlgItemText(hDlg, INSERTCS_MESSAGE, message, 128); //Place the text in the edit box into message[128] - Subtitle = frame.str() + " " + message; //Add frame number to beginning of message - FCEU_printf("%s",Subtitle.c_str()); //Debug, output string - //currMovieData.subtitles.push_back(Subtitle); - EndDialog(hDlg, 0); - return true; - break; - } - } - - case INSERTCS_IDCANCEL: - { - EndDialog(hDlg, 0); - return true; - break; - } - - } - } - return 0; -} -void InsertSubtitle(HWND main) -{ - //TODO: unless more commands are added these two functions can be consolidated to 1 with a bool argument - CommentSubtitle = false; - DialogBoxParam(fceu_hInstance, MAKEINTRESOURCE(INSERTCOMMENTSUBTITLE), main, (DLGPROC) InsertCommentSubtitleProc,(LPARAM) 0); -} - -void InsertComment(HWND main) -{ - CommentSubtitle = true; - DialogBoxParam(fceu_hInstance, MAKEINTRESOURCE(INSERTCOMMENTSUBTITLE), main, (DLGPROC) InsertCommentSubtitleProc,(LPARAM) 0); } \ No newline at end of file