Drop the position argument from ProcessParametersCallback since nothing needs it

This commit is contained in:
Thomas Goyne 2012-12-02 12:36:11 -08:00
parent 1c176e8568
commit 3949ccec24
6 changed files with 15 additions and 20 deletions

View file

@ -110,11 +110,11 @@ public:
void AddTag(wxString const& tag);
/// Type of callback function passed to ProcessParameters
typedef void (*ProcessParametersCallback)(wxString,int,AssOverrideParameter*,void *);
typedef void (*ProcessParametersCallback)(wxString const&, AssOverrideParameter *, void *);
/// @brief Process parameters via callback
/// @param callback The callback function to call per tag paramer
/// @param callback The callback function to call per tag parameter
/// @param userData User data to pass to callback function
void ProcessParameters(ProcessParametersCallback callback,void *userData);
void ProcessParameters(ProcessParametersCallback callback, void *userData);
};
class AssDialogue : public AssEntry {

View file

@ -98,20 +98,16 @@ wxString AssDialogueBlockOverride::GetText() {
return text;
}
void AssDialogueBlockOverride::ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData) {
for (auto curTag : Tags) {
// Find parameters
for (size_t n = 0; n < curTag->Params.size(); ++n) {
AssOverrideParameter *curPar = curTag->Params[n];
void AssDialogueBlockOverride::ProcessParameters(ProcessParametersCallback callback, void *userData) {
for (auto tag : Tags) {
for (auto par : tag->Params) {
if (par->GetType() == VARDATA_NONE || par->omitted) continue;
if (curPar->GetType() != VARDATA_NONE && !curPar->omitted) {
(*callback)(curTag->Name, n, curPar, userData);
callback(tag->Name, par, userData);
// Go recursive if it's a block parameter
if (curPar->GetType() == VARDATA_BLOCK) {
curPar->Get<AssDialogueBlockOverride*>()->ProcessParameters(callback,userData);
}
}
// Go recursive if it's a block parameter
if (par->GetType() == VARDATA_BLOCK)
par->Get<AssDialogueBlockOverride*>()->ProcessParameters(callback, userData);
}
}
}

View file

@ -153,7 +153,7 @@ namespace {
double ar;
};
void resample_tags(wxString name, int n, AssOverrideParameter *cur, void *ud) {
void resample_tags(wxString const& name, AssOverrideParameter *cur, void *ud) {
resample_state *state = static_cast<resample_state *>(ud);
double resizer = 1.0;

View file

@ -74,7 +74,7 @@ class StyleRenamer {
wxString new_name;
/// Process a single override parameter to check if it's \r with this style name
static void ProcessTag(wxString tag, int, AssOverrideParameter* param, void *userData) {
static void ProcessTag(wxString const& tag, AssOverrideParameter* param, void *userData) {
StyleRenamer *self = static_cast<StyleRenamer*>(userData);
if (tag == "\\r" && param->GetType() == VARDATA_TEXT && param->Get<wxString>() == self->source_name) {
if (self->do_replace)

View file

@ -168,7 +168,7 @@ int FORCEINLINE trunc_cs(int time) {
return (time / 10) * 10;
}
void AssTransformFramerateFilter::TransformTimeTags(wxString name,int n,AssOverrideParameter *curParam,void *curData) {
void AssTransformFramerateFilter::TransformTimeTags(wxString const& name, AssOverrideParameter *curParam, void *curData) {
VariableDataType type = curParam->GetType();
if (type != VARDATA_INT && type != VARDATA_FLOAT) return;

View file

@ -41,7 +41,6 @@ class wxCheckBox;
class wxRadioButton;
class wxTextCtrl;
/// DOCME
/// @class AssTransformFramerateFilter
/// @brief Transform subtitle times, including those in override tags, from an input framerate to an output framerate
class AssTransformFramerateFilter : public AssExportFilter {
@ -73,7 +72,7 @@ class AssTransformFramerateFilter : public AssExportFilter {
/// @param name Name of the tag
/// @param curParam Current parameter being processed
/// @param userdata Filter instance
static void TransformTimeTags(wxString name,int,AssOverrideParameter *curParam,void *userdata);
static void TransformTimeTags(wxString const& name, AssOverrideParameter *curParam, void *userdata);
/// @brief Convert a time from the input frame rate to the output frame rate
/// @param time Time in ms to convert