forked from mia/Aegisub
Applied demi's patch to fix default timing duration.
Originally committed to SVN as r1339.
This commit is contained in:
parent
075bb0184c
commit
e64f9b2cfe
5 changed files with 12 additions and 9 deletions
|
@ -1181,7 +1181,7 @@ void AudioDisplay::CommitChanges (bool nextLine) {
|
||||||
AssDialogue *def = new AssDialogue;
|
AssDialogue *def = new AssDialogue;
|
||||||
def->Start = grid->GetDialogue(line_n)->End;
|
def->Start = grid->GetDialogue(line_n)->End;
|
||||||
def->End = grid->GetDialogue(line_n)->End;
|
def->End = grid->GetDialogue(line_n)->End;
|
||||||
def->End.SetMS(def->End.GetMS()+5000);
|
def->End.SetMS(def->End.GetMS()+Options.AsInt(_T("Timing Default Duration")));
|
||||||
def->Style = grid->GetDialogue(line_n)->Style;
|
def->Style = grid->GetDialogue(line_n)->Style;
|
||||||
grid->InsertLine(def,line_n,true);
|
grid->InsertLine(def,line_n,true);
|
||||||
}
|
}
|
||||||
|
@ -2256,3 +2256,4 @@ void AudioDisplay::OnLoseFocus(wxFocusEvent &event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -847,7 +847,7 @@ void SubsEditBox::Commit(bool stay) {
|
||||||
if (next >= nrows) {
|
if (next >= nrows) {
|
||||||
AssDialogue *newline = new AssDialogue;
|
AssDialogue *newline = new AssDialogue;
|
||||||
newline->Start = cur->End;
|
newline->Start = cur->End;
|
||||||
newline->End.SetMS(cur->End.GetMS()+5000);
|
newline->End.SetMS(cur->End.GetMS()+Options.AsInt(_T("Timing Default Duration")));
|
||||||
newline->Style = cur->Style;
|
newline->Style = cur->Style;
|
||||||
newline->UpdateData();
|
newline->UpdateData();
|
||||||
grid->InsertLine(newline,next-1,true,true);
|
grid->InsertLine(newline,next-1,true,true);
|
||||||
|
@ -1293,3 +1293,4 @@ void SubsEditBox::OnButtonCommit(wxCommandEvent &event) {
|
||||||
Commit(wxGetMouseState().ControlDown());
|
Commit(wxGetMouseState().ControlDown());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -416,7 +416,7 @@ void SubtitlesGrid::OnInsertBefore (wxCommandEvent &event) {
|
||||||
def->Start = GetDialogue(n-1)->End;
|
def->Start = GetDialogue(n-1)->End;
|
||||||
def->End = GetDialogue(n)->Start;
|
def->End = GetDialogue(n)->Start;
|
||||||
}
|
}
|
||||||
if (def->End.GetMS() < def->Start.GetMS()) def->End.SetMS(def->Start.GetMS()+5000);
|
if (def->End.GetMS() < def->Start.GetMS()) def->End.SetMS(def->Start.GetMS()+Options.AsInt(_T("Timing Default Duration")));
|
||||||
def->Style = GetDialogue(n)->Style;
|
def->Style = GetDialogue(n)->Style;
|
||||||
|
|
||||||
// Insert it
|
// Insert it
|
||||||
|
@ -440,13 +440,13 @@ void SubtitlesGrid::OnInsertAfter (wxCommandEvent &event) {
|
||||||
if (n == nrows-1) {
|
if (n == nrows-1) {
|
||||||
def->Start = GetDialogue(n)->End;
|
def->Start = GetDialogue(n)->End;
|
||||||
def->End = GetDialogue(n)->End;
|
def->End = GetDialogue(n)->End;
|
||||||
def->End.SetMS(def->End.GetMS()+5000);
|
def->End.SetMS(def->End.GetMS()+Options.AsInt(_T("Timing Default Duration")));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
def->Start = GetDialogue(n)->End;
|
def->Start = GetDialogue(n)->End;
|
||||||
def->End = GetDialogue(n+1)->Start;
|
def->End = GetDialogue(n+1)->Start;
|
||||||
}
|
}
|
||||||
if (def->End.GetMS() < def->Start.GetMS()) def->End.SetMS(def->Start.GetMS()+5000);
|
if (def->End.GetMS() < def->Start.GetMS()) def->End.SetMS(def->Start.GetMS()+Options.AsInt(_T("Timing Default Duration")));
|
||||||
def->Style = GetDialogue(n)->Style;
|
def->Style = GetDialogue(n)->Style;
|
||||||
|
|
||||||
// Insert it
|
// Insert it
|
||||||
|
@ -468,7 +468,7 @@ void SubtitlesGrid::OnInsertBeforeVideo (wxCommandEvent &event) {
|
||||||
AssDialogue *def = new AssDialogue;
|
AssDialogue *def = new AssDialogue;
|
||||||
int video_ms = VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN(),true);
|
int video_ms = VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN(),true);
|
||||||
def->Start.SetMS(video_ms);
|
def->Start.SetMS(video_ms);
|
||||||
def->End.SetMS(video_ms+5000);
|
def->End.SetMS(video_ms+Options.AsInt(_T("Timing Default Duration")));
|
||||||
def->Style = GetDialogue(n)->Style;
|
def->Style = GetDialogue(n)->Style;
|
||||||
|
|
||||||
// Insert it
|
// Insert it
|
||||||
|
@ -490,7 +490,7 @@ void SubtitlesGrid::OnInsertAfterVideo (wxCommandEvent &event) {
|
||||||
AssDialogue *def = new AssDialogue;
|
AssDialogue *def = new AssDialogue;
|
||||||
int video_ms = VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN(),true);
|
int video_ms = VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN(),true);
|
||||||
def->Start.SetMS(video_ms);
|
def->Start.SetMS(video_ms);
|
||||||
def->End.SetMS(video_ms+5000);
|
def->End.SetMS(video_ms+Options.AsInt(_T("Timing Default Duration")));
|
||||||
def->Style = GetDialogue(n)->Style;
|
def->Style = GetDialogue(n)->Style;
|
||||||
|
|
||||||
// Insert it
|
// Insert it
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "subtitle_format_ttxt.h"
|
#include "subtitle_format_ttxt.h"
|
||||||
#include "ass_time.h"
|
#include "ass_time.h"
|
||||||
#include "ass_file.h"
|
#include "ass_file.h"
|
||||||
|
#include "options.h"
|
||||||
|
|
||||||
|
|
||||||
///////////////////
|
///////////////////
|
||||||
|
@ -337,7 +338,7 @@ void TTXTSubtitleFormat::ConvertToTTXT () {
|
||||||
// Insert blank line at the end
|
// Insert blank line at the end
|
||||||
AssDialogue *diag = new AssDialogue();
|
AssDialogue *diag = new AssDialogue();
|
||||||
diag->Start = lastTime;
|
diag->Start = lastTime;
|
||||||
diag->End.SetMS(lastTime.GetMS()+5000);
|
diag->End.SetMS(lastTime.GetMS()+Options.AsInt(_T("Timing Default Duration")));
|
||||||
diag->group = _T("[Events]");
|
diag->group = _T("[Events]");
|
||||||
diag->Style = _T("Default");
|
diag->Style = _T("Default");
|
||||||
diag->Comment = false;
|
diag->Comment = false;
|
||||||
|
|
|
@ -164,7 +164,7 @@ void TXTSubtitleFormat::ReadFile(wxString filename,wxString encoding) { using na
|
||||||
line->Style = _T("Default");
|
line->Style = _T("Default");
|
||||||
line->StartMS = 0;
|
line->StartMS = 0;
|
||||||
line->Start.SetMS(0);
|
line->Start.SetMS(0);
|
||||||
line->End.SetMS(5000);
|
line->End.SetMS(Options.AsInt(_T("Timing Default Duration")));
|
||||||
Line->push_back(line);
|
Line->push_back(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue