Drop the position argument from ProcessParametersCallback since nothing needs it
This commit is contained in:
parent
1c176e8568
commit
3949ccec24
6 changed files with 15 additions and 20 deletions
|
@ -110,11 +110,11 @@ public:
|
||||||
void AddTag(wxString const& tag);
|
void AddTag(wxString const& tag);
|
||||||
|
|
||||||
/// Type of callback function passed to ProcessParameters
|
/// 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
|
/// @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
|
/// @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 {
|
class AssDialogue : public AssEntry {
|
||||||
|
|
|
@ -98,20 +98,16 @@ wxString AssDialogueBlockOverride::GetText() {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssDialogueBlockOverride::ProcessParameters(AssDialogueBlockOverride::ProcessParametersCallback callback,void *userData) {
|
void AssDialogueBlockOverride::ProcessParameters(ProcessParametersCallback callback, void *userData) {
|
||||||
for (auto curTag : Tags) {
|
for (auto tag : Tags) {
|
||||||
// Find parameters
|
for (auto par : tag->Params) {
|
||||||
for (size_t n = 0; n < curTag->Params.size(); ++n) {
|
if (par->GetType() == VARDATA_NONE || par->omitted) continue;
|
||||||
AssOverrideParameter *curPar = curTag->Params[n];
|
|
||||||
|
|
||||||
if (curPar->GetType() != VARDATA_NONE && !curPar->omitted) {
|
callback(tag->Name, par, userData);
|
||||||
(*callback)(curTag->Name, n, curPar, userData);
|
|
||||||
|
|
||||||
// Go recursive if it's a block parameter
|
// Go recursive if it's a block parameter
|
||||||
if (curPar->GetType() == VARDATA_BLOCK) {
|
if (par->GetType() == VARDATA_BLOCK)
|
||||||
curPar->Get<AssDialogueBlockOverride*>()->ProcessParameters(callback,userData);
|
par->Get<AssDialogueBlockOverride*>()->ProcessParameters(callback, userData);
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -153,7 +153,7 @@ namespace {
|
||||||
double ar;
|
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);
|
resample_state *state = static_cast<resample_state *>(ud);
|
||||||
|
|
||||||
double resizer = 1.0;
|
double resizer = 1.0;
|
||||||
|
|
|
@ -74,7 +74,7 @@ class StyleRenamer {
|
||||||
wxString new_name;
|
wxString new_name;
|
||||||
|
|
||||||
/// Process a single override parameter to check if it's \r with this style 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);
|
StyleRenamer *self = static_cast<StyleRenamer*>(userData);
|
||||||
if (tag == "\\r" && param->GetType() == VARDATA_TEXT && param->Get<wxString>() == self->source_name) {
|
if (tag == "\\r" && param->GetType() == VARDATA_TEXT && param->Get<wxString>() == self->source_name) {
|
||||||
if (self->do_replace)
|
if (self->do_replace)
|
||||||
|
|
|
@ -168,7 +168,7 @@ int FORCEINLINE trunc_cs(int time) {
|
||||||
return (time / 10) * 10;
|
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();
|
VariableDataType type = curParam->GetType();
|
||||||
if (type != VARDATA_INT && type != VARDATA_FLOAT) return;
|
if (type != VARDATA_INT && type != VARDATA_FLOAT) return;
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@ class wxCheckBox;
|
||||||
class wxRadioButton;
|
class wxRadioButton;
|
||||||
class wxTextCtrl;
|
class wxTextCtrl;
|
||||||
|
|
||||||
/// DOCME
|
|
||||||
/// @class AssTransformFramerateFilter
|
/// @class AssTransformFramerateFilter
|
||||||
/// @brief Transform subtitle times, including those in override tags, from an input framerate to an output framerate
|
/// @brief Transform subtitle times, including those in override tags, from an input framerate to an output framerate
|
||||||
class AssTransformFramerateFilter : public AssExportFilter {
|
class AssTransformFramerateFilter : public AssExportFilter {
|
||||||
|
@ -73,7 +72,7 @@ class AssTransformFramerateFilter : public AssExportFilter {
|
||||||
/// @param name Name of the tag
|
/// @param name Name of the tag
|
||||||
/// @param curParam Current parameter being processed
|
/// @param curParam Current parameter being processed
|
||||||
/// @param userdata Filter instance
|
/// @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
|
/// @brief Convert a time from the input frame rate to the output frame rate
|
||||||
/// @param time Time in ms to convert
|
/// @param time Time in ms to convert
|
||||||
|
|
Loading…
Reference in a new issue