win32 - ripped out my failed add comment/subtitle function
This commit is contained in:
parent
e4b8c3b169
commit
26fdf49777
|
@ -328,9 +328,6 @@ BEGIN
|
||||||
MENUITEM "Play Movie from Beginning", FCEU_CONTEXT_PLAYMOVIEFROMBEGINNING
|
MENUITEM "Play Movie from Beginning", FCEU_CONTEXT_PLAYMOVIEFROMBEGINNING
|
||||||
MENUITEM "Stop Movie", FCEU_CONTEXT_STOPMOVIE
|
MENUITEM "Stop Movie", FCEU_CONTEXT_STOPMOVIE
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Insert Subtitle", FCEU_CONTEXT_INSERTSUBTITLE
|
|
||||||
MENUITEM "Insert Comment", FCEU_CONTEXT_INSERTCOMMENT
|
|
||||||
MENUITEM SEPARATOR
|
|
||||||
MENUITEM "&Help....", FCEU_CONTEXT_MOVIEHELP
|
MENUITEM "&Help....", FCEU_CONTEXT_MOVIEHELP
|
||||||
END
|
END
|
||||||
POPUP "Game+NoMovie"
|
POPUP "Game+NoMovie"
|
||||||
|
|
|
@ -1258,13 +1258,6 @@ LRESULT FAR PASCAL AppWndProc(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//Context Menus------------------------------------------------------
|
//Context Menus------------------------------------------------------
|
||||||
//Game+Movie
|
|
||||||
case FCEU_CONTEXT_INSERTSUBTITLE:
|
|
||||||
InsertSubtitle(hWnd);
|
|
||||||
break;
|
|
||||||
case FCEU_CONTEXT_INSERTCOMMENT:
|
|
||||||
InsertComment(hWnd);
|
|
||||||
break;
|
|
||||||
case FCEU_CONTEXT_MOVIEHELP:
|
case FCEU_CONTEXT_MOVIEHELP:
|
||||||
OpenHelpWindow(moviehelp);
|
OpenHelpWindow(moviehelp);
|
||||||
break;
|
break;
|
||||||
|
@ -1989,84 +1982,3 @@ void UpdateMenuHotkeys()
|
||||||
combined = "Code/Data Logger...\t" + combo;
|
combined = "Code/Data Logger...\t" + combo;
|
||||||
ChangeMenuItemText(MENU_CDLOGGER, combined);
|
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);
|
|
||||||
}
|
|
Loading…
Reference in New Issue