Kill SubtitlesGrid::SetVideoToSubs

Originally committed to SVN as r5470.
This commit is contained in:
Thomas Goyne 2011-07-15 04:25:23 +00:00
parent e75ea7d2e8
commit 7842ccbeb1
4 changed files with 9 additions and 21 deletions

View file

@ -445,7 +445,9 @@ struct video_jump_end : public validator_video_loaded {
STR_HELP("Jumps the video to the end frame of current subtitle.") STR_HELP("Jumps the video to the end frame of current subtitle.")
void operator()(agi::Context *c) { 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.") STR_HELP("Jumps the video to the start frame of current subtitle.")
void operator()(agi::Context *c) { void operator()(agi::Context *c) {
c->subsGrid->SetVideoToSubs(true); if (AssDialogue *active_line = c->selectionController->GetActiveLine()) {
c->videoController->JumpToTime(active_line->Start.GetMS());
}
} }
}; };

View file

@ -41,9 +41,10 @@
#include <wx/string.h> #include <wx/string.h>
#endif #endif
#include "compat.h"
#include "ass_dialogue.h" #include "ass_dialogue.h"
#include "ass_file.h" #include "ass_file.h"
#include "command/command.h"
#include "compat.h"
#include "dialog_search_replace.h" #include "dialog_search_replace.h"
#include "include/aegisub/context.h" #include "include/aegisub/context.h"
#include "frame_main.h" #include "frame_main.h"
@ -458,7 +459,7 @@ void SearchReplaceEngine::ReplaceNext(bool DoReplace) {
// Update video // Update video
if (updateVideo) { if (updateVideo) {
context->subsGrid->SetVideoToSubs(true); (*cmd::get("video/jump/start"))(context);
} }
else if (DoReplace) Modified = true; else if (DoReplace) Modified = true;

View file

@ -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) /// @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 /// @return
/// ///

View file

@ -78,9 +78,6 @@ public:
SubtitlesGrid(wxWindow *parent, agi::Context *context, const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS, const wxString& name = wxPanelNameStr); SubtitlesGrid(wxWindow *parent, agi::Context *context, const wxSize& size = wxDefaultSize, long style = wxWANTS_CHARS, const wxString& name = wxPanelNameStr);
~SubtitlesGrid(); ~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 /// @brief Set the start/end time of the current subtitle line to the current frame
/// @param start Start vs. End time /// @param start Start vs. End time
void SetSubsToVideo(bool start); void SetSubsToVideo(bool start);