mirror of https://github.com/odrling/Aegisub
Implement/fix #751 and update changelog a bit.
Originally committed to SVN as r2270.
This commit is contained in:
parent
eb5e8ea8a1
commit
30a9bdc17c
|
@ -4,6 +4,7 @@ Please visit http://aegisub.net to download latest version
|
|||
= 2.2.0 - 2008.xx.xx ===========================
|
||||
|
||||
- New Aegisub logo. (amz)
|
||||
- Icon redrawn and new high-resolution versions produced. (jfs)
|
||||
- The Automation 4 system has been introduced. This means lots of changes. (jfs)
|
||||
o The Lua engine is now based on Lua 5.1, which means a few new language features.
|
||||
o A Ruby 1.9-based scripting engine has been added (Pomyk)
|
||||
|
@ -98,6 +99,7 @@ Please visit http://aegisub.net to download latest version
|
|||
o Added very basic reading support for MPEG-4 Streaming Text (TTXT) subtitles. (amz)
|
||||
o Added full read-write support for MicroDVD subtitles (the most common .sub format). (amz)
|
||||
o Added support for writing Adobe Encore subtitles, both PAL and NTSC. (amz)
|
||||
o Added support for writing TranStation subtitle format. (amz/jfs)
|
||||
- Changes to main menu:
|
||||
o There are now new options, and most were moved around to have better organization. (amz/jfs)
|
||||
o General tweaks changes, such as better icons, and fixing of flickering and slowness. (amz)
|
||||
|
|
|
@ -92,8 +92,8 @@ void TranStationSubtitleFormat::WriteFile(wxString _filename,wxString encoding)
|
|||
// Get line data
|
||||
AssStyle *style = GetAssFile()->GetStyle(current->Style);
|
||||
int valign = 0;
|
||||
wxChar *halign = _T("C");
|
||||
wxChar *type = _T("N");
|
||||
wxChar *halign = _T(" "); // default is centered
|
||||
wxChar *type = _T("N"); // no special style
|
||||
if (style) {
|
||||
if (style->alignment >= 4) valign = 4;
|
||||
if (style->alignment >= 7) valign = 9;
|
||||
|
@ -102,15 +102,17 @@ void TranStationSubtitleFormat::WriteFile(wxString _filename,wxString encoding)
|
|||
if (style->italic) type = _T("I");
|
||||
}
|
||||
|
||||
// Hack: If an italics-tag (\i1) appears anywhere in the line,
|
||||
// make it all italics
|
||||
if (current->Text.Find(_T("\i1")) != wxNOT_FOUND)type = _T("I");
|
||||
|
||||
// Write header
|
||||
AssTime start = current->Start;
|
||||
AssTime end = current->End;
|
||||
// Subtract one frame duration from end time, since it is inclusive
|
||||
// Subtract half a frame duration from end time, since it is inclusive
|
||||
// and we otherwise run the risk of having two lines overlap in a
|
||||
// frame, when they should run right into each other.
|
||||
printf("Before adjusting end: %d fps=%f to subtract=%d\n", end.GetMS(), fps, (int)(500.0/fps));
|
||||
end.SetMS(end.GetMS() - (int)(500.0/fps));
|
||||
printf("After adjusting end: %d\n", end.GetMS());
|
||||
wxString header = wxString::Format(_T("SUB[%i%s%s "),valign,halign,type) + start.GetSMPTE(fps) + _T(">") + end.GetSMPTE(fps) + _T("]");
|
||||
file.WriteLineToFile(header);
|
||||
|
||||
|
@ -128,6 +130,9 @@ void TranStationSubtitleFormat::WriteFile(wxString _filename,wxString encoding)
|
|||
}
|
||||
}
|
||||
|
||||
// Every file must end with this line
|
||||
file.WriteLineToFile(_T("SUB["));
|
||||
|
||||
// Clean up
|
||||
ClearCopy();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue