diff --git a/changelog.txt b/changelog.txt index d1cad559..9d257da3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,5 @@ ---version 2.0.4 yet to be released--- +23-nov-2008 - adelikat - movie subtitle system installed 22-nov-2008 - adelikat - win32 - added help menu item to TASEdit and Hex Editor, Minor TASEdit clean up 22-nov-2008 - adelikat - win32 - fixed so that turbo works with VBlank sync settings 21-nov-2008 - qfox - Lua - added joypad.write and joypad.get for naming consistency. Added plane display toggle for lua: FCEU.fceu_setrenderplanes(sprites, background) which accepts two boolean args and toggles the drawing of those planes from Lua. Changed movie.framecount() to always return a number, even when no movie is playing. Should return the same number as in view; the number of frames since last reset, if no movie is playing. diff --git a/src/drivers/win/replay.cpp b/src/drivers/win/replay.cpp index 268e15cf..cf398691 100644 --- a/src/drivers/win/replay.cpp +++ b/src/drivers/win/replay.cpp @@ -14,6 +14,9 @@ static bool stopframeWasEditedByUser = false; //the comments contained in the currently-displayed movie static std::vector currComments; +//the subtitles contained in the currently-displayed movie +static std::vector currSubtitles; + extern FCEUGI *GameInfo; //retains the state of the readonly checkbox and stopframe value @@ -219,6 +222,7 @@ void UpdateReplayDialog(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg,IDOK),TRUE); EnableWindow(GetDlgItem(hwndDlg,IDC_BUTTON_METADATA),TRUE); currComments = info.comments; + currSubtitles = info.subtitles; doClear = 0; } @@ -311,6 +315,50 @@ BOOL CALLBACK ReplayMetadataDialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, L lvc.cx = listRect.right - 100; ListView_InsertColumn(hwndList, colidx++, &lvc); + + //Display the Subtitles into the Metadata as well + for(uint32 i=0;i 0) //If no subtitles, don't bother with this heading + { + string Heading = "SUBTITLES"; + std::wstring& rHeading = mbstowcs(Heading); + + LVITEM lvSubtitle; + lvSubtitle.iItem = 0; + lvSubtitle.mask = LVIF_TEXT; + lvSubtitle.iSubItem = 0; + lvSubtitle.pszText = (LPSTR)rHeading.c_str(); + SendMessageW(hwndList, LVM_INSERTITEMW, 0, (LPARAM)&lvSubtitle); + } + + //Display the comments in the movie data for(uint32 i=0;i #ifdef CREATE_AVI #include "drivers/videolog/nesvideos-piece.h" @@ -35,12 +36,12 @@ using namespace std; - #define MOVIE_VERSION 3 extern char FileBase[]; -using namespace std; +std::vector subtitleFrames; +std::vector subtitleMessages; //TODO - remove the synchack stuff from the replay gui and require it to be put into the fm2 file //which the user would have already converted from fcm @@ -350,6 +351,8 @@ void MovieData::installValue(std::string& key, std::string& val) installBool(val,binaryFlag); else if(key == "comment") comments.push_back(mbstowcs(val)); + else if (key == "subtitle") + subtitles.push_back(val); //mbstowcs(val)); else if(key == "savestate") { int len = Base64StringToBytesLength(val); @@ -379,6 +382,9 @@ int MovieData::dump(std::ostream *os, bool binary) for(uint32 i=0;istream, INT_MAX, false); + LoadSubtitles(); delete fp; //fully reload the game to reinitialize everything before playing any movie @@ -1168,6 +1175,47 @@ bool FCEUI_MovieGetInfo(FCEUFILE* fp, MOVIE_INFO& info, bool skipFrameCount) info.name_of_rom_used = md.romFilename; info.rerecord_count = md.rerecordCount; info.comments = md.comments; + info.subtitles = md.subtitles; return true; } + +//This function creates an array of frame numbers and corresponding strings for displaying subtitles +void LoadSubtitles(void) +{ + + extern std::vector subtitles; + for(uint32 i=0;i comments; + std::vector subtitles; } MOVIE_INFO; @@ -159,6 +160,7 @@ public: std::vector savestate; std::vector records; std::vector comments; + std::vector subtitles; //this is the RERECORD COUNT. please rename variable. int rerecordCount; FCEU_Guid guid; @@ -243,4 +245,9 @@ bool FCEUI_GetMovieToggleReadOnly(); void FCEUI_MovieToggleFrameDisplay(); void FCEUI_ToggleInputDisplay(void); +void LoadSubtitles(void); +void ProcessSubtitles(void); + + + #endif //__MOVIE_H_