Applied demi's patch to fix default timing duration.

Originally committed to SVN as r1339.
This commit is contained in:
Rodrigo Braz Monteiro 2007-07-03 06:43:57 +00:00
parent 075bb0184c
commit e64f9b2cfe
5 changed files with 12 additions and 9 deletions

View file

@ -1181,7 +1181,7 @@ void AudioDisplay::CommitChanges (bool nextLine) {
AssDialogue *def = new AssDialogue;
def->Start = 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;
grid->InsertLine(def,line_n,true);
}
@ -2256,3 +2256,4 @@ void AudioDisplay::OnLoseFocus(wxFocusEvent &event) {
}
}

View file

@ -847,7 +847,7 @@ void SubsEditBox::Commit(bool stay) {
if (next >= nrows) {
AssDialogue *newline = new AssDialogue;
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->UpdateData();
grid->InsertLine(newline,next-1,true,true);
@ -1293,3 +1293,4 @@ void SubsEditBox::OnButtonCommit(wxCommandEvent &event) {
Commit(wxGetMouseState().ControlDown());
}

View file

@ -416,7 +416,7 @@ void SubtitlesGrid::OnInsertBefore (wxCommandEvent &event) {
def->Start = GetDialogue(n-1)->End;
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;
// Insert it
@ -440,13 +440,13 @@ void SubtitlesGrid::OnInsertAfter (wxCommandEvent &event) {
if (n == nrows-1) {
def->Start = 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 {
def->Start = GetDialogue(n)->End;
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;
// Insert it
@ -468,7 +468,7 @@ void SubtitlesGrid::OnInsertBeforeVideo (wxCommandEvent &event) {
AssDialogue *def = new AssDialogue;
int video_ms = VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN(),true);
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;
// Insert it
@ -490,7 +490,7 @@ void SubtitlesGrid::OnInsertAfterVideo (wxCommandEvent &event) {
AssDialogue *def = new AssDialogue;
int video_ms = VFR_Output.GetTimeAtFrame(VideoContext::Get()->GetFrameN(),true);
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;
// Insert it

View file

@ -39,6 +39,7 @@
#include "subtitle_format_ttxt.h"
#include "ass_time.h"
#include "ass_file.h"
#include "options.h"
///////////////////
@ -337,7 +338,7 @@ void TTXTSubtitleFormat::ConvertToTTXT () {
// Insert blank line at the end
AssDialogue *diag = new AssDialogue();
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->Style = _T("Default");
diag->Comment = false;

View file

@ -164,7 +164,7 @@ void TXTSubtitleFormat::ReadFile(wxString filename,wxString encoding) { using na
line->Style = _T("Default");
line->StartMS = 0;
line->Start.SetMS(0);
line->End.SetMS(5000);
line->End.SetMS(Options.AsInt(_T("Timing Default Duration")));
Line->push_back(line);
}
}