From 7842ccbeb12bb0f20807eb5a5c9bf7f599b84f10 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 15 Jul 2011 04:25:23 +0000 Subject: [PATCH] Kill SubtitlesGrid::SetVideoToSubs Originally committed to SVN as r5470. --- aegisub/src/command/video.cpp | 8 ++++++-- aegisub/src/dialog_search_replace.cpp | 5 +++-- aegisub/src/subs_grid.cpp | 14 -------------- aegisub/src/subs_grid.h | 3 --- 4 files changed, 9 insertions(+), 21 deletions(-) diff --git a/aegisub/src/command/video.cpp b/aegisub/src/command/video.cpp index 16c811224..14cd02ff3 100644 --- a/aegisub/src/command/video.cpp +++ b/aegisub/src/command/video.cpp @@ -445,7 +445,9 @@ struct video_jump_end : public validator_video_loaded { STR_HELP("Jumps the video to the end frame of current subtitle.") void operator()(agi::Context *c) { - c->subsGrid->SetVideoToSubs(false); + if (AssDialogue *active_line = c->selectionController->GetActiveLine()) { + c->videoController->JumpToTime(active_line->End.GetMS(), agi::vfr::END); + } } }; @@ -457,7 +459,9 @@ struct video_jump_start : public validator_video_loaded { STR_HELP("Jumps the video to the start frame of current subtitle.") void operator()(agi::Context *c) { - c->subsGrid->SetVideoToSubs(true); + if (AssDialogue *active_line = c->selectionController->GetActiveLine()) { + c->videoController->JumpToTime(active_line->Start.GetMS()); + } } }; diff --git a/aegisub/src/dialog_search_replace.cpp b/aegisub/src/dialog_search_replace.cpp index bb61b759e..7ef7a8e0b 100644 --- a/aegisub/src/dialog_search_replace.cpp +++ b/aegisub/src/dialog_search_replace.cpp @@ -41,9 +41,10 @@ #include #endif -#include "compat.h" #include "ass_dialogue.h" #include "ass_file.h" +#include "command/command.h" +#include "compat.h" #include "dialog_search_replace.h" #include "include/aegisub/context.h" #include "frame_main.h" @@ -458,7 +459,7 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) { // Update video if (updateVideo) { - context->subsGrid->SetVideoToSubs(true); + (*cmd::get("video/jump/start"))(context); } else if (DoReplace) Modified = true; diff --git a/aegisub/src/subs_grid.cpp b/aegisub/src/subs_grid.cpp index 8d3fc207e..376278ea2 100644 --- a/aegisub/src/subs_grid.cpp +++ b/aegisub/src/subs_grid.cpp @@ -662,20 +662,6 @@ void SubtitlesGrid::SetSubsToVideo(bool start) { } } -void SubtitlesGrid::SetVideoToSubs(bool start) { - wxArrayInt sel = GetSelection(); - if (sel.Count() == 0) return; - AssDialogue *cur = GetDialogue(sel[0]); - if (cur) { - if (start) - context->videoController->JumpToTime(cur->Start.GetMS()); - else - context->videoController->JumpToTime(cur->End.GetMS(), agi::vfr::END); - } -} - - - /// @brief Retrieve a list of selected lines in the actual ASS file (ie. not as displayed in the grid but as represented in the file) /// @return /// diff --git a/aegisub/src/subs_grid.h b/aegisub/src/subs_grid.h index f37492c67..c2902475a 100644 --- a/aegisub/src/subs_grid.h +++ b/aegisub/src/subs_grid.h @@ -78,9 +78,6 @@ public: SubtitlesGrid(wxWindow *parent, agi::Context *context, const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS, const wxString& name = wxPanelNameStr); ~SubtitlesGrid(); - /// @brief Jump to the start/end time of the current subtitle line - /// @param start Start vs. End time - void SetVideoToSubs(bool start); /// @brief Set the start/end time of the current subtitle line to the current frame /// @param start Start vs. End time void SetSubsToVideo(bool start);