From 83ad086cafc967ec7a26d88a11b0fb6fb42e7e57 Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Thu, 23 Feb 2006 19:26:14 +0000 Subject: [PATCH] Fixed mkv parsing and a few other minor stuff Originally committed to SVN as r125. --- core/changelog.txt | 4 +++- core/frame_main.cpp | 3 +++ core/frame_main.h | 5 +++++ core/frame_main_events.cpp | 26 +++++++++++++++++++++++++- core/mkv_wrap.cpp | 8 +++----- core/subs_grid.cpp | 13 ++++--------- 6 files changed, 43 insertions(+), 16 deletions(-) diff --git a/core/changelog.txt b/core/changelog.txt index aea0f0c2e..09354d4c5 100644 --- a/core/changelog.txt +++ b/core/changelog.txt @@ -45,7 +45,9 @@ Please visit http://aegisub.net to download latest version - Aegisub will now dump the stack to stack.txt when it crashes with a fatal exception, which might or might not work. (AMZ) - Audio display in SSA mode will no longer ignore clicks if it wasn't focused (AMZ) - The font override button in the subtitles edit box can now modify font size, italics, bold and underline as well as font face (no strikeout, as wx does not provide an interface to access that data). (AMZ) -- Now requires Avisynth 2.5.6a or later, added an option to override it to config.dat (Myrsloik) +- Now requires Avisynth 2.5.6a or later, added an option ("allow ancient avisynth") to override it to config.dat. (Myrsloik) +- Added reading of keyframe and timecode data from Matroska files (which are still not recommended, due to their dependency on DirectShowSource). (AMZ) +- Added forums and bugtracker to Help menu. (AMZ) = 1.09 beta - 2006.01.16 =========================== diff --git a/core/frame_main.cpp b/core/frame_main.cpp index 5d63db80a..7859714c5 100644 --- a/core/frame_main.cpp +++ b/core/frame_main.cpp @@ -314,7 +314,10 @@ void FrameMain::InitMenu() { AppendBitmapMenuItem (helpMenu,Menu_Help_Contents, _("&Contents...\t") + Hotkeys.GetText(_T("Help")), _("Help topics"), wxBITMAP(contents_button)); helpMenu->AppendSeparator(); helpMenu->Append(Menu_Help_Website, _("&Website..."), _("Visit Aegisub's official website")); + helpMenu->Append(Menu_Help_Forums, _("&Forums..."), _("Visit Aegisub's forums")); + helpMenu->Append(Menu_Help_BugTracker, _("&Bug tracker..."), _("Visit Aegisub's bug tracker")); AppendBitmapMenuItem (helpMenu,Menu_Help_IRCChannel, _("&IRC channel..."), _("Visit Aegisub's official IRC channel"), wxBITMAP(irc_button)); + helpMenu->AppendSeparator(); helpMenu->Append(Menu_Help_About, _("&About..."), _("About Aegisub")); MenuBar->Append(helpMenu, _("&Help")); diff --git a/core/frame_main.h b/core/frame_main.h index 72a022403..1c5f920b0 100644 --- a/core/frame_main.h +++ b/core/frame_main.h @@ -131,6 +131,8 @@ private: void OnAbout (wxCommandEvent &event); void OnContents (wxCommandEvent &event); void OnWebsite (wxCommandEvent &event); + void OnForums (wxCommandEvent &event); + void OnBugTracker (wxCommandEvent &event); void OnIRCChannel (wxCommandEvent &event); void OnOpenProject (wxCommandEvent &event); @@ -312,6 +314,9 @@ enum { Menu_Help_Contents, Menu_Help_IRCChannel, Menu_Help_Website, + Menu_Help_Forums, + Menu_Help_BugTracker, + Menu_Help_Check_Updates, Menu_Help_About, Menu_Subs_Snap_Start_To_Video, diff --git a/core/frame_main_events.cpp b/core/frame_main_events.cpp index 293bb9ba4..be0479ab5 100644 --- a/core/frame_main_events.cpp +++ b/core/frame_main_events.cpp @@ -174,6 +174,8 @@ BEGIN_EVENT_TABLE(FrameMain, wxFrame) EVT_MENU(Menu_Help_Contents, FrameMain::OnContents) EVT_MENU(Menu_Help_Website, FrameMain::OnWebsite) + EVT_MENU(Menu_Help_Forums, FrameMain::OnForums) + EVT_MENU(Menu_Help_BugTracker, FrameMain::OnBugTracker) EVT_MENU(Menu_Help_IRCChannel, FrameMain::OnIRCChannel) EVT_MENU(Menu_Help_About, FrameMain::OnAbout) @@ -394,7 +396,29 @@ void FrameMain::OnContents(wxCommandEvent& WXUNUSED(event)) { void FrameMain::OnWebsite(wxCommandEvent& WXUNUSED(event)) { wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html")); if (type) { - wxString command = type->GetOpenCommand(_T("http://aegisub.net/")); + wxString command = type->GetOpenCommand(_T("http://www.aegisub.net/")); + if (!command.empty()) wxExecute(command); + } +} + + +/////////////// +// Open forums +void FrameMain::OnForums(wxCommandEvent& WXUNUSED(event)) { + wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html")); + if (type) { + wxString command = type->GetOpenCommand(_T("http://www.malakith.net/aegisub/")); + if (!command.empty()) wxExecute(command); + } +} + + +/////////////////// +// Open bugtracker +void FrameMain::OnBugTracker(wxCommandEvent& WXUNUSED(event)) { + wxFileType *type = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html")); + if (type) { + wxString command = type->GetOpenCommand(_T("http://www.malakith.net/aegibug/")); if (!command.empty()) wxExecute(command); } } diff --git a/core/mkv_wrap.cpp b/core/mkv_wrap.cpp index ed4391d47..048d6a9dc 100644 --- a/core/mkv_wrap.cpp +++ b/core/mkv_wrap.cpp @@ -156,11 +156,9 @@ void MatroskaWrapper::Parse() { int frameN = 0; while (mkv_ReadFrame(file,0,&rt,&startTime,&endTime,&filePos,&frameSize,&frameFlags) == 0) { // Read value - double curTime = double(startTime) / timecodeScale; - if (!(frameFlags & FRAME_GAP)) { - frames.push_back(MkvFrame((frameFlags & FRAME_KF) != 0,curTime)); - frameN++; - } + double curTime = double(startTime) / 1000000.0; + frames.push_back(MkvFrame((frameFlags & FRAME_KF) != 0,curTime)); + frameN++; // Cancelled? if (canceled) { diff --git a/core/subs_grid.cpp b/core/subs_grid.cpp index e188dd00d..c611d0635 100644 --- a/core/subs_grid.cpp +++ b/core/subs_grid.cpp @@ -216,23 +216,17 @@ void SubtitlesGrid::OnKeyDown(wxKeyEvent &event) { if (n_found >= 1) { // Copy if (Hotkeys.IsPressed(_T("Copy"))) { - wxCommandEvent dummy; - OnCopyLines(dummy); - return; + CopyLines(GetSelection()); } // Cut if (Hotkeys.IsPressed(_T("Cut"))) { - wxCommandEvent dummy; - OnCutLines(dummy); - return; + CutLines(GetSelection()); } // Paste if (Hotkeys.IsPressed(_T("Paste"))) { - wxCommandEvent dummy; - OnPasteLines(dummy); - return; + PasteLines(GetFirstSelRow()); } // Delete @@ -774,6 +768,7 @@ void SubtitlesGrid::PasteLines(int n) { if (inserted > 0) { // Commit UpdateMaps(); + AdjustScrollbar(); ass->FlagAsModified(); CommitChanges();