Make AssStyle::UpdateData and GetSSAText less weird

This commit is contained in:
Thomas Goyne 2012-11-30 20:02:46 -08:00
parent 56993f7f5e
commit f337db86d3

View file

@ -172,12 +172,10 @@ AssStyle::AssStyle(wxString rawData, int version)
} }
void AssStyle::UpdateData() { void AssStyle::UpdateData() {
wxString final;
name.Replace(",", ";"); name.Replace(",", ";");
font.Replace(",", ";"); font.Replace(",", ";");
final = wxString::Format("Style: %s,%s,%g,%s,%s,%s,%s,%d,%d,%d,%d,%g,%g,%g,%g,%d,%g,%g,%i,%i,%i,%i,%i", SetEntryData(wxString::Format("Style: %s,%s,%g,%s,%s,%s,%s,%d,%d,%d,%d,%g,%g,%g,%g,%d,%g,%g,%i,%i,%i,%i,%i",
name, font, fontsize, name, font, fontsize,
primary.GetAssStyleFormatted(), primary.GetAssStyleFormatted(),
secondary.GetAssStyleFormatted(), secondary.GetAssStyleFormatted(),
@ -187,29 +185,18 @@ void AssStyle::UpdateData() {
(underline?-1:0),(strikeout?-1:0), (underline?-1:0),(strikeout?-1:0),
scalex,scaley,spacing,angle, scalex,scaley,spacing,angle,
borderstyle,outline_w,shadow_w,alignment, borderstyle,outline_w,shadow_w,alignment,
Margin[0],Margin[1],Margin[2],encoding); Margin[0],Margin[1],Margin[2],encoding));
SetEntryData(final);
} }
wxString AssStyle::GetSSAText() const { wxString AssStyle::GetSSAText() const {
wxString output; return wxString::Format("Style: %s,%s,%g,%s,%s,0,%s,%d,%d,%d,%g,%g,%d,%d,%d,%d,0,%i",
int align = AssToSsa(alignment); name, font, fontsize,
wxString n = name;
n.Replace(",", ";");
wxString f = font;
f.Replace(",", ";");
output = wxString::Format("Style: %s,%s,%g,%s,%s,0,%s,%d,%d,%d,%g,%g,%d,%d,%d,%d,0,%i",
n, f, fontsize,
primary.GetSsaFormatted(), primary.GetSsaFormatted(),
secondary.GetSsaFormatted(), secondary.GetSsaFormatted(),
shadow.GetSsaFormatted(), shadow.GetSsaFormatted(),
(bold? -1 : 0), (italic ? -1 : 0), (bold? -1 : 0), (italic ? -1 : 0),
borderstyle,outline_w,shadow_w,align, borderstyle,outline_w,shadow_w,AssToSsa(alignment),
Margin[0],Margin[1],Margin[2],encoding); Margin[0],Margin[1],Margin[2],encoding);
return output;
} }
AssEntry *AssStyle::Clone() const { AssEntry *AssStyle::Clone() const {