Rename ASS -> Ass in symbol names

Most types and functions used Ass, but a decent number used ASS, so make
them consistent.
This commit is contained in:
Thomas Goyne 2012-10-11 18:52:36 -07:00
parent 006f820aea
commit c7fd04a739
37 changed files with 100 additions and 100 deletions

View file

@ -76,7 +76,7 @@ public:
wxString GetFileName(bool raw=false) const;
const wxString GetEntryData() const;
ASS_EntryType GetType() const { return ENTRY_ATTACHMENT; }
AssEntryType GetType() const { return ENTRY_ATTACHMENT; }
AssEntry *Clone() const;
AssAttachment(wxString const& name, wxString const& group);

View file

@ -173,8 +173,8 @@ wxString AssDialogue::GetData(bool ssa) const {
"%s: %s,%s,%s,%s,%s,%d,%d,%d,%s,%s",
Comment ? "Comment" : "Dialogue",
ssa ? "Marked=0" : wxString::Format("%01d", Layer),
Start.GetASSFormated(),
End.GetASSFormated(),
Start.GetAssFormated(),
End.GetAssFormated(),
s, a,
Margin[0], Margin[1], Margin[2],
e,
@ -270,7 +270,7 @@ std::vector<AssDialogueBlock*> AssDialogue::ParseTags() const {
return Blocks;
}
void AssDialogue::ParseASSTags() {
void AssDialogue::ParseAssTags() {
ClearBlocks();
Blocks = ParseTags();
}
@ -280,7 +280,7 @@ void AssDialogue::StripTags () {
}
void AssDialogue::StripTag (wxString tagName) {
ParseASSTags();
ParseAssTags();
wxString final;
// Look for blocks

View file

@ -41,7 +41,7 @@
#include "ass_entry.h"
#include "ass_time.h"
enum ASS_BlockType {
enum AssBlockType {
BLOCK_BASE,
BLOCK_PLAIN,
BLOCK_OVERRIDE,
@ -79,13 +79,13 @@ public:
AssDialogueBlock(wxString const& text) : text(text) { }
virtual ~AssDialogueBlock() { }
virtual ASS_BlockType GetType() const = 0;
virtual AssBlockType GetType() const = 0;
virtual wxString GetText() { return text; }
};
class AssDialogueBlockPlain : public AssDialogueBlock {
public:
ASS_BlockType GetType() const { return BLOCK_PLAIN; }
AssBlockType GetType() const { return BLOCK_PLAIN; }
AssDialogueBlockPlain(wxString const& text = wxString()) : AssDialogueBlock(text) { }
};
@ -93,7 +93,7 @@ class AssDialogueBlockDrawing : public AssDialogueBlock {
public:
int Scale;
ASS_BlockType GetType() const { return BLOCK_DRAWING; }
AssBlockType GetType() const { return BLOCK_DRAWING; }
AssDialogueBlockDrawing(wxString const& text, int scale) : AssDialogueBlock(text), Scale(scale) { }
void TransformCoords(int trans_x,int trans_y,double mult_x,double mult_y);
};
@ -105,7 +105,7 @@ public:
std::vector<AssOverrideTag*> Tags;
ASS_BlockType GetType() const { return BLOCK_OVERRIDE; }
AssBlockType GetType() const { return BLOCK_OVERRIDE; }
wxString GetText();
void ParseTags();
void AddTag(wxString const& tag);
@ -143,7 +143,7 @@ public:
/// Raw text data
wxString Text;
ASS_EntryType GetType() const { return ENTRY_DIALOGUE; }
AssEntryType GetType() const { return ENTRY_DIALOGUE; }
/// @brief Parse raw ASS data into everything else
/// @param data ASS line
@ -151,7 +151,7 @@ public:
bool Parse(wxString const& data);
/// Parse text as ASS to generate block information
void ParseASSTags();
void ParseAssTags();
/// Parse text as ASS and return block information
std::vector<AssDialogueBlock*> ParseTags() const;

View file

@ -47,7 +47,7 @@ class AssDialogue;
class AssStyle;
class AssAttachment;
enum ASS_EntryType {
enum AssEntryType {
ENTRY_BASE,
ENTRY_DIALOGUE,
ENTRY_STYLE,
@ -89,7 +89,7 @@ public:
virtual AssEntry *Clone() const;
/// Get this entry's fully-derived type
virtual ASS_EntryType GetType() const { return ENTRY_BASE; }
virtual AssEntryType GetType() const { return ENTRY_BASE; }
/// @brief Get this line's raw entry data in ASS format
virtual const wxString GetEntryData() const { return data; }

View file

@ -95,7 +95,7 @@ void AssFile::Load(const wxString &_filename, wxString charset, bool addToRecent
// Check if the file has at least one style and at least one dialogue line
for (entryIter it = temp.Line.begin(); it != temp.Line.end(); ++it) {
ASS_EntryType type = (*it)->GetType();
AssEntryType type = (*it)->GetType();
if (type == ENTRY_STYLE) found_style = true;
if (type == ENTRY_DIALOGUE) found_dialogue = true;
if (found_style && found_dialogue) break;

View file

@ -61,7 +61,7 @@ AssKaraoke::AssKaraoke(AssDialogue *line, bool auto_split, bool normalize)
void AssKaraoke::SetLine(AssDialogue *line, bool auto_split, bool normalize) {
active_line = line;
line->ParseASSTags();
line->ParseAssTags();
syls.clear();
Syllable syl;

View file

@ -123,17 +123,17 @@ void AssDialogueBlockOverride::ProcessParameters(AssDialogueBlockOverride::Proce
}
}
AssOverrideParamProto::AssOverrideParamProto(VariableDataType type,int opt,ASS_ParameterClass classi)
AssOverrideParamProto::AssOverrideParamProto(VariableDataType type,int opt,AssParameterClass classi)
: optional(opt)
, type(type)
, classification(classi)
{
}
void AssOverrideTagProto::AddParam(VariableDataType type, ASS_ParameterClass classi, int opt) {
void AssOverrideTagProto::AddParam(VariableDataType type, AssParameterClass classi, int opt) {
params.push_back(AssOverrideParamProto(type, opt, classi));
}
void AssOverrideTagProto::Set(wxString newName, VariableDataType type, ASS_ParameterClass classi, int opt) {
void AssOverrideTagProto::Set(wxString newName, VariableDataType type, AssParameterClass classi, int opt) {
name = newName;
params.push_back(AssOverrideParamProto(type, opt, classi));
}

View file

@ -41,7 +41,7 @@
#include "variable_data.h"
/// Type of parameter; probably only used by the resample tool
enum ASS_ParameterClass {
enum AssParameterClass {
PARCLASS_NORMAL,
PARCLASS_ABSOLUTE_SIZE,
PARCLASS_ABSOLUTE_POS_X,
@ -58,7 +58,7 @@ enum ASS_ParameterClass {
/// indicated number. Note that only arguments not at the end need to be marked
/// as optional; this is just to know which parameters to skip when there are
/// earlier optional arguments
enum ASS_ParameterOptional {
enum AssParameterOptional {
NOT_OPTIONAL = 0xFF,
OPTIONAL_1 = 0x01,
OPTIONAL_2 = 0x02,
@ -75,7 +75,7 @@ enum ASS_ParameterOptional {
class AssOverrideParameter : public VariableData {
public:
/// Type of parameter
ASS_ParameterClass classification;
AssParameterClass classification;
/// Is the parameter's value actually given?
bool omitted;
@ -96,9 +96,9 @@ struct AssOverrideParamProto {
VariableDataType type;
/// Semantic type of this parameter
ASS_ParameterClass classification;
AssParameterClass classification;
AssOverrideParamProto (VariableDataType type, int opt=NOT_OPTIONAL, ASS_ParameterClass classi=PARCLASS_NORMAL);
AssOverrideParamProto (VariableDataType type, int opt=NOT_OPTIONAL, AssParameterClass classi=PARCLASS_NORMAL);
};
/// DOCME
@ -115,13 +115,13 @@ struct AssOverrideTagProto {
/// @param type Data type of the parameter
/// @param classi Semantic type of the parameter
/// @param opt Situations in which this parameter is present
void AddParam(VariableDataType type, ASS_ParameterClass classi = PARCLASS_NORMAL, int opt = NOT_OPTIONAL);
void AddParam(VariableDataType type, AssParameterClass classi = PARCLASS_NORMAL, int opt = NOT_OPTIONAL);
/// @brief Convenience function for single-argument tags
/// @param name Name of the tag, with slash
/// @param type Data type of the parameter
/// @param classi Semantic type of the parameter
/// @param opt Situations in which this parameter is present
void Set(wxString name, VariableDataType type, ASS_ParameterClass classi = PARCLASS_NORMAL, int opt = NOT_OPTIONAL);
void Set(wxString name, VariableDataType type, AssParameterClass classi = PARCLASS_NORMAL, int opt = NOT_OPTIONAL);
};
/// DOCME

View file

@ -117,7 +117,7 @@ void AssColor::SetWXColor(const wxColor &color) {
/// @param stripped
/// @param isStyle
/// @return
wxString AssColor::GetASSFormatted(bool alpha,bool stripped,bool isStyle) const {
wxString AssColor::GetAssFormatted(bool alpha,bool stripped,bool isStyle) const {
wxString work;
if (!stripped) work += "&H";
if (alpha) work += wxString::Format("%02X",a);
@ -311,10 +311,10 @@ void AssStyle::UpdateData() {
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",
name, font, fontsize,
primary.GetASSFormatted(true,false,true),
secondary.GetASSFormatted(true,false,true),
outline.GetASSFormatted(true,false,true),
shadow.GetASSFormatted(true,false,true),
primary.GetAssFormatted(true,false,true),
secondary.GetAssFormatted(true,false,true),
outline.GetAssFormatted(true,false,true),
shadow.GetAssFormatted(true,false,true),
(bold? -1 : 0), (italic ? -1 : 0),
(underline?-1:0),(strikeout?-1:0),
scalex,scaley,spacing,angle,

View file

@ -61,7 +61,7 @@ struct AssColor {
wxColor GetWXColor() const; // Return as a wxColor
void SetWXColor(const wxColor &color); // Sets from a wxColor
void Parse(wxString const& value); // Parse SSA or ASS-style color
wxString GetASSFormatted(bool alpha,bool stripped=false,bool isStyle=false) const; // Gets color formated in ASS format
wxString GetAssFormatted(bool alpha,bool stripped=false,bool isStyle=false) const; // Gets color formated in ASS format
wxString GetSSAFormatted() const;
};
@ -108,7 +108,7 @@ public:
AssStyle& operator=(AssStyle const&);
wxString GetSSAText() const;
ASS_EntryType GetType() const { return ENTRY_STYLE; }
AssEntryType GetType() const { return ENTRY_STYLE; }
AssEntry *Clone() const;
/// Convert an ASS alignment to the equivalent SSA alignment

View file

@ -79,7 +79,7 @@ AssTime::AssTime(wxString const& text)
time = mid(0, time, 10 * 60 * 60 * 1000 - 1);
}
wxString AssTime::GetASSFormated(bool msPrecision) const {
wxString AssTime::GetAssFormated(bool msPrecision) const {
wxChar ret[] = {
'0' + GetTimeHours(),
':',

View file

@ -66,7 +66,7 @@ public:
/// Return the time as a string
/// @param ms Use milliseconds precision, for non-ASS formats
wxString GetASSFormated(bool ms=false) const;
wxString GetAssFormated(bool ms=false) const;
};
/// @class SmpteFormatter

View file

@ -968,7 +968,7 @@ void AudioDisplay::SetTrackCursor(int new_pos, bool show_time)
if (show_time)
{
AssTime new_label_time = TimeFromAbsoluteX(track_cursor_pos);
track_cursor_label = new_label_time.GetASSFormated();
track_cursor_label = new_label_time.GetAssFormated();
track_cursor_label_rect.x += new_pos - old_pos;
RefreshRect(track_cursor_label_rect, false);
}

View file

@ -241,10 +241,10 @@ namespace Automation4 {
set_field(L, "fontname", sty->font);
set_field(L, "fontsize", sty->fontsize);
set_field(L, "color1", sty->primary.GetASSFormatted(true));
set_field(L, "color2", sty->secondary.GetASSFormatted(true));
set_field(L, "color3", sty->outline.GetASSFormatted(true));
set_field(L, "color4", sty->shadow.GetASSFormatted(true));
set_field(L, "color1", sty->primary.GetAssFormatted(true));
set_field(L, "color2", sty->secondary.GetAssFormatted(true));
set_field(L, "color3", sty->outline.GetAssFormatted(true));
set_field(L, "color4", sty->shadow.GetAssFormatted(true));
set_field(L, "bold", sty->bold);
set_field(L, "italic", sty->italic);

View file

@ -597,8 +597,8 @@ void BaseGrid::GetRowStrings(int row, AssDialogue *line, bool *paint_columns, wx
if (paint_columns[3]) strings[3] = wxString::Format("%d", context->videoController->FrameAtTime(line->End, agi::vfr::END));
}
else {
if (paint_columns[2]) strings[2] = line->Start.GetASSFormated();
if (paint_columns[3]) strings[3] = line->End.GetASSFormated();
if (paint_columns[2]) strings[2] = line->Start.GetAssFormated();
if (paint_columns[3]) strings[3] = line->End.GetAssFormated();
}
if (paint_columns[4]) strings[4] = line->Style;
if (paint_columns[5]) strings[5] = line->Actor;
@ -833,7 +833,7 @@ void BaseGrid::SetColumnWidths() {
int startLen = 0;
int endLen = 0;
if (!byFrame)
startLen = endLen = dc.GetTextExtent(AssTime().GetASSFormated()).GetWidth();
startLen = endLen = dc.GetTextExtent(AssTime().GetAssFormated()).GetWidth();
// O(n) widths
bool showMargin[3] = { false, false, false };

View file

@ -202,7 +202,7 @@ int block_at_pos(wxString const& text, int pos) {
void set_tag(const agi::Context *c, wxString const& tag, wxString const& value, int &sel_start, int &sel_end, bool at_end = false) {
AssDialogue * const line = c->selectionController->GetActiveLine();
if (line->Blocks.empty())
line->ParseASSTags();
line->ParseAssTags();
int start = at_end ? sel_end : sel_start;
int blockn = block_at_pos(line->Text, start);
@ -239,7 +239,7 @@ void set_tag(const agi::Context *c, wxString const& tag, wxString const& value,
if (plain || blockn < 0) {
line->Text = line->Text.Left(start) + "{" + insert + "}" + line->Text.Mid(start);
shift += 2;
line->ParseASSTags();
line->ParseAssTags();
}
else if(ovr) {
wxString alt;
@ -296,7 +296,7 @@ void toggle_override_tag(const agi::Context *c, bool (AssStyle::*field), const c
AssStyle const* const style = c->ass->GetStyle(line->Style);
bool state = style ? style->*field : AssStyle().*field;
line->ParseASSTags();
line->ParseAssTags();
int sel_start = c->textSelectionController->GetSelectionStart();
int sel_end = c->textSelectionController->GetSelectionEnd();
int blockn = block_at_pos(line->Text, sel_start);
@ -315,7 +315,7 @@ void got_color(const agi::Context *c, const char *tag, int *commit_id, wxColour
if (new_color.Ok()) {
int sel_start = c->textSelectionController->GetSelectionStart();
int sel_end = c->textSelectionController->GetSelectionEnd();
set_tag(c, tag, AssColor(new_color).GetASSFormatted(false), sel_start, sel_end);
set_tag(c, tag, AssColor(new_color).GetAssFormatted(false), sel_start, sel_end);
commit_text(c, _("set color"), sel_start, sel_end, commit_id);
}
}
@ -325,7 +325,7 @@ void show_color_picker(const agi::Context *c, AssColor (AssStyle::*field), const
AssStyle const* const style = c->ass->GetStyle(line->Style);
wxColor color = (style ? style->*field : AssStyle().*field).GetWXColor();
line->ParseASSTags();
line->ParseAssTags();
int sel_start = c->textSelectionController->GetSelectionStart();
int sel_end = c->textSelectionController->GetSelectionEnd();
@ -439,7 +439,7 @@ struct edit_font : public Command {
void operator()(agi::Context *c) {
AssDialogue *const line = c->selectionController->GetActiveLine();
line->ParseASSTags();
line->ParseAssTags();
const int blockn = block_at_pos(line->Text, c->textSelectionController->GetInsertionPoint());
const AssStyle *style = c->ass->GetStyle(line->Style);

View file

@ -238,7 +238,7 @@ class DialogColorPicker : public wxDialog {
/// Update all other controls as a result of modifying an HSV control
void UpdateFromHSV(bool dirty = true);
/// Update all other controls as a result of modifying the ASS format control
void UpdateFromASS();
void UpdateFromAss();
/// Update all other controls as a result of modifying the HTML format control
void UpdateFromHTML();
@ -472,7 +472,7 @@ wxString ColorPickerRecent::StoreToString()
{
wxString res;
for (int i = 0; i < rows*cols; i++) {
res << AssColor(colors[i]).GetASSFormatted(false, false, false) << " ";
res << AssColor(colors[i]).GetAssFormatted(false, false, false) << " ";
}
return res.Trim(true);
}
@ -502,7 +502,7 @@ void ColorPickerRecent::OnClick(wxMouseEvent &evt)
if (i >= 0 && i < (int)colors.size()) {
wxCommandEvent evnt(EVT_RECENT_SELECT, GetId());
evnt.SetString(AssColor(colors[i]).GetASSFormatted(false, false, false));
evnt.SetString(AssColor(colors[i]).GetAssFormatted(false, false, false));
AddPendingEvent(evnt);
}
}
@ -576,7 +576,7 @@ void ColorPickerScreenDropper::OnMouse(wxMouseEvent &evt)
wxColour color(pdi.Red(), pdi.Green(), pdi.Blue(), wxALPHA_OPAQUE);
wxCommandEvent evnt(EVT_DROPPER_SELECT, GetId());
evnt.SetString(AssColor(color).GetASSFormatted(false, false, false));
evnt.SetString(AssColor(color).GetAssFormatted(false, false, false));
AddPendingEvent(evnt);
}
}
@ -792,7 +792,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color, s
hsv_input[i]->Bind(wxEVT_COMMAND_SPINCTRL_UPDATED, bind(&DialogColorPicker::UpdateFromHSV, this, true));
hsv_input[i]->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromHSV, this, true));
}
ass_input->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromASS, this));
ass_input->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromAss, this));
html_input->Bind(wxEVT_COMMAND_TEXT_UPDATED, bind(&DialogColorPicker::UpdateFromHTML, this));
screen_dropper_icon->Bind(wxEVT_MOTION, &DialogColorPicker::OnDropperMouse, this);
@ -901,7 +901,7 @@ void DialogColorPicker::UpdateFromRGB(bool dirty)
SetHSL(r, g, b);
SetHSV(r, g, b);
cur_color = wxColour(r, g, b, wxALPHA_OPAQUE);
ass_input->ChangeValue(AssColor(cur_color).GetASSFormatted(false, false, false));
ass_input->ChangeValue(AssColor(cur_color).GetAssFormatted(false, false, false));
html_input->ChangeValue(color_to_html(cur_color));
if (dirty)
@ -920,7 +920,7 @@ void DialogColorPicker::UpdateFromHSL(bool dirty)
SetRGB(r, g, b);
SetHSV(r, g, b);
ass_input->ChangeValue(AssColor(cur_color).GetASSFormatted(false, false, false));
ass_input->ChangeValue(AssColor(cur_color).GetAssFormatted(false, false, false));
html_input->ChangeValue(color_to_html(cur_color));
if (dirty)
@ -938,7 +938,7 @@ void DialogColorPicker::UpdateFromHSV(bool dirty)
hsv_to_rgb(h, s, v, &r, &g, &b);
SetRGB(r, g, b);
SetHSL(r, g, b);
ass_input->ChangeValue(AssColor(cur_color).GetASSFormatted(false, false, false));
ass_input->ChangeValue(AssColor(cur_color).GetAssFormatted(false, false, false));
html_input->ChangeValue(color_to_html(cur_color));
if (dirty)
@ -947,7 +947,7 @@ void DialogColorPicker::UpdateFromHSV(bool dirty)
}
/// @brief Use the value entered in the ASS hex control to update the other controls
void DialogColorPicker::UpdateFromASS()
void DialogColorPicker::UpdateFromAss()
{
unsigned char r, g, b;
AssColor ass;
@ -975,7 +975,7 @@ void DialogColorPicker::UpdateFromHTML()
SetRGB(r, g, b);
SetHSL(r, g, b);
SetHSV(r, g, b);
ass_input->ChangeValue(AssColor(cur_color).GetASSFormatted(false, false, false));
ass_input->ChangeValue(AssColor(cur_color).GetAssFormatted(false, false, false));
spectrum_dirty = true;
UpdateSpectrumDisplay();

View file

@ -69,7 +69,7 @@ DialogJumpTo::DialogJumpTo(agi::Context *c)
JumpFrame = new wxTextCtrl(this,-1,"",wxDefaultPosition,wxSize(-1,-1),wxTE_PROCESS_ENTER, NumValidator((int)jumpframe));
JumpFrame->SetMaxLength(maxLength.size());
JumpTime = new TimeEdit(this, -1, c, AssTime(c->videoController->TimeAtFrame(jumpframe)).GetASSFormated(), wxSize(-1,-1));
JumpTime = new TimeEdit(this, -1, c, AssTime(c->videoController->TimeAtFrame(jumpframe)).GetAssFormated(), wxSize(-1,-1));
wxGridSizer *TimesSizer = new wxGridSizer(2, 5, 5);

View file

@ -205,7 +205,7 @@ namespace {
void resample_line(resample_state *state, AssEntry *line) {
AssDialogue *diag = dynamic_cast<AssDialogue*>(line);
if (diag && !(diag->Comment && (diag->Effect.StartsWith("template") || diag->Effect.StartsWith("code")))) {
diag->ParseASSTags();
diag->ParseAssTags();
diag->ProcessParameters(resample_tags, state);
for (size_t i = 0; i < diag->Blocks.size(); ++i) {

View file

@ -100,7 +100,7 @@ class StyleRenamer {
found_any = true;
}
diag->ParseASSTags();
diag->ParseAssTags();
diag->ProcessParameters(&StyleRenamer::ProcessTag, this);
if (replace)
diag->UpdateText();

View file

@ -161,7 +161,7 @@ DialogTranslation::DialogTranslation(agi::Context *c)
Bind(wxEVT_KEY_DOWN, &DialogTranslation::OnKeyDown, this);
active_line->ParseASSTags();
active_line->ParseAssTags();
if (bad_block(active_line->Blocks[0])) {
if (!NextBlock())
throw NothingToTranslate(STD_STR(_("There is nothing to translate in the file.")));
@ -177,7 +177,7 @@ void DialogTranslation::OnActiveLineChanged(AssDialogue *new_line) {
if (switching_lines) return;
active_line = new_line;
active_line->ParseASSTags();
active_line->ParseAssTags();
cur_block = 0;
line_number = count_if(c->ass->Line.begin(), find(c->ass->Line.begin(), c->ass->Line.end(), active_line), cast<AssDialogue*>()) + 1;
@ -207,7 +207,7 @@ bool DialogTranslation::NextBlock() {
active_line->ClearBlocks();
active_line = new_line;
active_line->ParseASSTags();
active_line->ParseAssTags();
cur_block = 0;
++line_number;
}
@ -230,7 +230,7 @@ bool DialogTranslation::PrevBlock() {
active_line->ClearBlocks();
active_line = new_line;
active_line->ParseASSTags();
active_line->ParseAssTags();
cur_block = active_line->Blocks.size() - 1;
--line_number;
}

View file

@ -221,7 +221,7 @@ void AssTransformFramerateFilter::TransformFrameRate(AssFile *subs) {
newEnd = trunc_cs(ConvertTime(curDialogue->End) + 9);
// Process stuff
curDialogue->ParseASSTags();
curDialogue->ParseAssTags();
curDialogue->ProcessParameters(TransformTimeTags, this);
curDialogue->Start = newStart;
curDialogue->End = newEnd;

View file

@ -49,7 +49,7 @@ FontCollector::FontCollector(FontCollectorStatusCallback status_callback, FontFi
void FontCollector::ProcessDialogueLine(AssDialogue *line, int index) {
if (line->Comment) return;
line->ParseASSTags();
line->ParseAssTags();
StyleInfo style = styles[line->Style];
StyleInfo initial = style;

View file

@ -117,11 +117,11 @@ static void read_subtitles(agi::ProgressSink *ps, MatroskaFile *file, MkvStdIO *
blockString.BeforeFirst(',', &afterOrder).ToLong(&order);
afterOrder.BeforeFirst(',', &afterLayer).ToLong(&layer);
subList[order] = wxString::Format("Dialogue: %d,%s,%s,%s", (int)layer, subStart.GetASSFormated(), subEnd.GetASSFormated(), afterLayer);
subList[order] = wxString::Format("Dialogue: %d,%s,%s,%s", (int)layer, subStart.GetAssFormated(), subEnd.GetAssFormated(), afterLayer);
}
// Process SRT
else {
blockString = wxString::Format("Dialogue: 0,%s,%s,%s", subStart.GetASSFormated(), subEnd.GetASSFormated(), blockString);
blockString = wxString::Format("Dialogue: 0,%s,%s,%s", subStart.GetAssFormated(), subEnd.GetAssFormated(), blockString);
blockString.Replace("\r\n","\\N");
blockString.Replace("\r","\\N");
blockString.Replace("\n","\\N");
@ -138,7 +138,7 @@ static void read_subtitles(agi::ProgressSink *ps, MatroskaFile *file, MkvStdIO *
int version = ssa;
AssAttachment *attach = 0;
for (std::map<int, wxString>::iterator it = subList.begin(); it != subList.end(); ++it) {
ASSSubtitleFormat::AddLine(target, it->second, &version, &attach);
AssSubtitleFormat::AddLine(target, it->second, &version, &attach);
}
}
@ -209,7 +209,7 @@ void MatroskaWrapper::GetSubtitles(wxString const& filename, AssFile *target) {
AssAttachment *attach = 0;
wxStringTokenizer token(privString, "\r\n", wxTOKEN_STRTOK);
while (token.HasMoreTokens())
ASSSubtitleFormat::AddLine(target, token.GetNextToken(), &version, &attach);
AssSubtitleFormat::AddLine(target, token.GetNextToken(), &version, &attach);
}
// Load default if it's SRT
else {

View file

@ -67,7 +67,7 @@ void Spline::SetScale(int new_scale) {
scale = 1 << (raw_scale - 1);
}
wxString Spline::EncodeToASS() const {
wxString Spline::EncodeToAss() const {
wxString result;
result.reserve(size() * 10);
char last = 0;
@ -107,7 +107,7 @@ wxString Spline::EncodeToASS() const {
return result;
}
void Spline::DecodeFromASS(wxString str) {
void Spline::DecodeFromAss(wxString str) {
// Clear current
clear();
std::vector<float> stack;

View file

@ -64,10 +64,10 @@ public:
Spline(const VisualToolBase &scale);
/// Encode to an ASS vector drawing
wxString EncodeToASS() const;
wxString EncodeToAss() const;
/// Decode an ASS vector drawing
void DecodeFromASS(wxString str);
void DecodeFromAss(wxString str);
/// Set the scale
/// @param new_scale Power-of-two to scale coordinates by

View file

@ -313,7 +313,7 @@ std::list<SubtitleFormat*> SubtitleFormat::formats;
void SubtitleFormat::LoadFormats() {
if (formats.empty()) {
new ASSSubtitleFormat;
new AssSubtitleFormat;
new Ebu3264SubtitleFormat;
new EncoreSubtitleFormat;
new MKVSubtitleFormat;

View file

@ -48,26 +48,26 @@
DEFINE_SIMPLE_EXCEPTION(AssParseError, SubtitleFormatParseError, "subtitle_io/parse/ass")
ASSSubtitleFormat::ASSSubtitleFormat()
AssSubtitleFormat::AssSubtitleFormat()
: SubtitleFormat("Advanced Substation Alpha")
{
}
wxArrayString ASSSubtitleFormat::GetReadWildcards() const {
wxArrayString AssSubtitleFormat::GetReadWildcards() const {
wxArrayString formats;
formats.Add("ass");
formats.Add("ssa");
return formats;
}
wxArrayString ASSSubtitleFormat::GetWriteWildcards() const {
wxArrayString AssSubtitleFormat::GetWriteWildcards() const {
wxArrayString formats;
formats.Add("ass");
formats.Add("ssa");
return formats;
}
void ASSSubtitleFormat::ReadFile(AssFile *target, wxString const& filename, wxString const& encoding) const {
void AssSubtitleFormat::ReadFile(AssFile *target, wxString const& filename, wxString const& encoding) const {
target->Clear();
TextFileReader file(filename, encoding);
@ -86,7 +86,7 @@ void ASSSubtitleFormat::ReadFile(AssFile *target, wxString const& filename, wxSt
}
}
void ASSSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename, wxString const& encoding) const {
void AssSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename, wxString const& encoding) const {
TextFileWriter file(filename, encoding);
bool ssa = filename.Right(4).Lower() == ".ssa";
@ -102,7 +102,7 @@ void ASSSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename,
}
}
void ASSSubtitleFormat::AddLine(AssFile *target, wxString data, int *version, AssAttachment **attach) {
void AssSubtitleFormat::AddLine(AssFile *target, wxString data, int *version, AssAttachment **attach) {
// Is this line an attachment filename?
bool isFilename = data.StartsWith("fontname: ") || data.StartsWith("filename: ");

View file

@ -43,9 +43,9 @@ class AssAttachment;
/// @brief DOCME
///
/// DOCME
class ASSSubtitleFormat : public SubtitleFormat {
class AssSubtitleFormat : public SubtitleFormat {
public:
ASSSubtitleFormat();
AssSubtitleFormat();
wxArrayString GetReadWildcards() const;
wxArrayString GetWriteWildcards() const;

View file

@ -268,7 +268,7 @@ namespace
// Helper for finding special characters
wxRegEx special_char_search("\\\\[nN]| ", wxRE_ADVANCED);
line->ParseASSTags();
line->ParseAssTags();
text_rows.clear();
text_rows.push_back(EbuTextRow());

View file

@ -215,7 +215,7 @@ public:
else if (attr_name == "color")
{
wxColour wxcl = html_to_color(attr_value);
wxString colorstr = AssColor(wxcl).GetASSFormatted(false, false, false);
wxString colorstr = AssColor(wxcl).GetAssFormatted(false, false, false);
new_attribs.color = wxString::Format("{\\c%s}", colorstr);
}
// remove this attribute to prepare for the next
@ -567,7 +567,7 @@ wxString SRTSubtitleFormat::ConvertTags(AssDialogue *diag) const {
tag_states['u'] = false;
tag_states['s'] = false;
diag->ParseASSTags();
diag->ParseAssTags();
for (size_t i = 0; i < diag->Blocks.size(); ++i) {
if (AssDialogueBlockOverride* block = dynamic_cast<AssDialogueBlockOverride*>(diag->Blocks[i])) {

View file

@ -246,7 +246,7 @@ void TTXTSubtitleFormat::WriteLine(wxXmlNode *root, AssDialogue *prev, AssDialog
// If it doesn't start at the end of previous, add blank
if (prev && prev->End != line->Start) {
wxXmlNode *node = new wxXmlNode(wxXML_ELEMENT_NODE, "TextSample");
node->AddAttribute("sampleTime", "0" + prev->End.GetASSFormated(true));
node->AddAttribute("sampleTime", "0" + prev->End.GetAssFormated(true));
node->AddAttribute("xml:space", "preserve");
root->AddChild(node);
node->AddChild(new wxXmlNode(wxXML_TEXT_NODE, "", ""));
@ -254,7 +254,7 @@ void TTXTSubtitleFormat::WriteLine(wxXmlNode *root, AssDialogue *prev, AssDialog
// Generate and insert node
wxXmlNode *node = new wxXmlNode(wxXML_ELEMENT_NODE, "TextSample");
node->AddAttribute("sampleTime", "0" + line->Start.GetASSFormated(true));
node->AddAttribute("sampleTime", "0" + line->Start.GetAssFormated(true));
node->AddAttribute("xml:space", "preserve");
root->AddChild(node);
node->AddChild(new wxXmlNode(wxXML_TEXT_NODE, "", line->Text));

View file

@ -164,7 +164,7 @@ void TXTSubtitleFormat::WriteFile(const AssFile *src, wxString const& filename,
wxString out_text;
if (strip_formatting) {
dia->ParseASSTags();
dia->ParseAssTags();
for (std::vector<AssDialogueBlock*>::iterator block = dia->Blocks.begin(); block != dia->Blocks.end(); ++block) {
if ((*block)->GetType() == BLOCK_PLAIN) {
out_text += (*block)->GetText();

View file

@ -87,7 +87,7 @@ TimeEdit::TimeEdit(wxWindow* parent, wxWindowID id, agi::Context *c, const wxStr
SetValidator(val);
// Other stuff
if (!value) SetValue(time.GetASSFormated());
if (!value) SetValue(time.GetAssFormated());
Bind(wxEVT_COMMAND_MENU_SELECTED, std::tr1::bind(&TimeEdit::CopyTime, this), Time_Edit_Copy);
Bind(wxEVT_COMMAND_MENU_SELECTED, std::tr1::bind(&TimeEdit::PasteTime, this), Time_Edit_Paste);
@ -136,7 +136,7 @@ void TimeEdit::UpdateText() {
if (byFrame)
ChangeValue(wxString::Format("%d", c->videoController->FrameAtTime(time, isEnd ? agi::vfr::END : agi::vfr::START)));
else
ChangeValue(time.GetASSFormated());
ChangeValue(time.GetAssFormated());
}
void TimeEdit::OnKeyDown(wxKeyEvent &event) {
@ -197,7 +197,7 @@ void TimeEdit::OnKeyDown(wxKeyEvent &event) {
// Overwrite the digit
time = text.Left(start) + (char)key + text.Mid(start + 1);
SetValue(time.GetASSFormated());
SetValue(time.GetAssFormated());
SetInsertionPoint(start + 1);
}
@ -246,7 +246,7 @@ void TimeEdit::PasteTime() {
wxTheClipboard->Close();
AssTime tempTime(text);
if (tempTime.GetASSFormated() == text) {
if (tempTime.GetAssFormated() == text) {
SetTime(tempTime);
SetSelection(0, GetValue().size());

View file

@ -159,7 +159,7 @@ void VideoBox::UpdateTimeBoxes() {
int time = context->videoController->TimeAtFrame(frame, agi::vfr::EXACT);
// Set the text box for frame number and time
VideoPosition->SetValue(wxString::Format("%s - %d", AssTime(time).GetASSFormated(true), frame));
VideoPosition->SetValue(wxString::Format("%s - %d", AssTime(time).GetAssFormated(true), frame));
if (binary_search(context->videoController->GetKeyFrames().begin(), context->videoController->GetKeyFrames().end(), frame)) {
// Set the background color to indicate this is a keyframe
VideoPosition->SetBackgroundColour(lagi_wxColour(OPT_GET("Colour/Subtitle Grid/Background/Selection")->GetColour()));

View file

@ -366,7 +366,7 @@ typedef const std::vector<AssOverrideParameter*> * param_vec;
// Parse line on creation and unparse at the end of scope
struct scoped_tag_parse {
AssDialogue *diag;
scoped_tag_parse(AssDialogue *diag) : diag(diag) { diag->ParseASSTags(); }
scoped_tag_parse(AssDialogue *diag) : diag(diag) { diag->ParseAssTags(); }
~scoped_tag_parse() { diag->ClearBlocks(); }
};
@ -572,7 +572,7 @@ void VisualToolBase::SetOverride(AssDialogue* line, wxString const& tag, wxStrin
wxString insert = tag + value;
// Get block at start
line->ParseASSTags();
line->ParseAssTags();
AssDialogueBlock *block = line->Blocks.front();
// Get current block as plain or override

View file

@ -203,7 +203,7 @@ void VisualToolVectorClip::Save() {
wxString value = "(";
if (spline.GetScale() != 1)
value += wxString::Format("%d,", spline.GetScale());
value += spline.EncodeToASS() + ")";
value += spline.EncodeToAss() + ")";
SetOverride(active_line, tag, value);
}
@ -398,7 +398,7 @@ void VisualToolVectorClip::DoRefresh() {
int scale;
vect = GetLineVectorClip(active_line, scale, inverse);
spline.SetScale(scale);
spline.DecodeFromASS(vect);
spline.DecodeFromAss(vect);
MakeFeatures();
SelectAll();