forked from mia/Aegisub
Kill SubtitlesGrid::SetVideoToSubs
Originally committed to SVN as r5470.
This commit is contained in:
parent
e75ea7d2e8
commit
7842ccbeb1
4 changed files with 9 additions and 21 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -41,9 +41,10 @@
|
|||
#include <wx/string.h>
|
||||
#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;
|
||||
|
||||
|
|
|
@ -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
|
||||
///
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue