diff --git a/aegisub/src/ass_export_filter.cpp b/aegisub/src/ass_export_filter.cpp index 9fb7d219b..98716b01c 100644 --- a/aegisub/src/ass_export_filter.cpp +++ b/aegisub/src/ass_export_filter.cpp @@ -39,11 +39,10 @@ #include "ass_export_filter.h" #include "utils.h" -AssExportFilter::AssExportFilter(wxString const& name, wxString const& description, int priority, bool auto_apply) +AssExportFilter::AssExportFilter(wxString const& name, wxString const& description, int priority) : name(name) , priority(priority) , description(description) -, auto_apply(auto_apply) { } diff --git a/aegisub/src/ass_export_filter.h b/aegisub/src/ass_export_filter.h index bd74a5e37..a36744462 100644 --- a/aegisub/src/ass_export_filter.h +++ b/aegisub/src/ass_export_filter.h @@ -77,17 +77,12 @@ class AssExportFilter { /// User-visible description of this filter wxString description; - /// Should this filter be automatically applied when sending subtitles to - /// the renderer and exporting to non-ASS formats - bool auto_apply; - public: - AssExportFilter(wxString const& name, wxString const& description, int priority = 0, bool auto_apply = false); + AssExportFilter(wxString const& name, wxString const& description, int priority = 0); virtual ~AssExportFilter() { }; wxString const& GetName() const { return name; } wxString const& GetDescription() const { return description; } - bool GetAutoApply() const { return auto_apply; } /// Process subtitles /// @param subs Subtitles to process diff --git a/aegisub/src/ass_exporter.cpp b/aegisub/src/ass_exporter.cpp index d632d27ff..de2e277ed 100644 --- a/aegisub/src/ass_exporter.cpp +++ b/aegisub/src/ass_exporter.cpp @@ -84,13 +84,6 @@ void AssExporter::AddFilter(wxString const& name) { filters.push_back(filter); } -void AssExporter::AddAutoFilters() { - for (auto filter : *AssExportFilterChain::GetFilterList()) { - if (filter->GetAutoApply()) - filters.push_back(filter); - } -} - wxArrayString AssExporter::GetAllFilterNames() const { wxArrayString names; transform(filter_list_begin(), filter_list_end(), diff --git a/aegisub/src/ass_exporter.h b/aegisub/src/ass_exporter.h index 93e72cc9a..86764e5d2 100644 --- a/aegisub/src/ass_exporter.h +++ b/aegisub/src/ass_exporter.h @@ -71,10 +71,6 @@ public: /// @throws wxString if filter is not found void AddFilter(wxString const& name); - /// Add all export filters which have indicated they should apply in - /// non-transform contexts - void AddAutoFilters(); - /// Run all added export filters /// @param parent_window Parent window the filters should use when opening dialogs /// @param copy Should the file be copied rather than transformed in-place? diff --git a/aegisub/src/export_fixstyle.cpp b/aegisub/src/export_fixstyle.cpp index ccdcc7c74..f43a5003e 100644 --- a/aegisub/src/export_fixstyle.cpp +++ b/aegisub/src/export_fixstyle.cpp @@ -47,7 +47,7 @@ #include AssFixStylesFilter::AssFixStylesFilter() -: AssExportFilter(_("Fix Styles"), _("Fixes styles by replacing any style that isn't available on file with Default."), -5000, true) +: AssExportFilter(_("Fix Styles"), _("Fixes styles by replacing any style that isn't available on file with Default."), -5000) { } diff --git a/aegisub/src/threaded_frame_source.cpp b/aegisub/src/threaded_frame_source.cpp index 1db868a6d..a17eb8467 100644 --- a/aegisub/src/threaded_frame_source.cpp +++ b/aegisub/src/threaded_frame_source.cpp @@ -28,9 +28,9 @@ #include #include "ass_dialogue.h" -#include "ass_exporter.h" #include "ass_file.h" #include "compat.h" +#include "export_fixstyle.h" #include "include/aegisub/context.h" #include "include/aegisub/subtitles_provider.h" #include "video_frame.h" @@ -82,16 +82,7 @@ std::shared_ptr ThreadedFrameSource::ProcFrame(int frameNum, dou singleFrame = SUBS_FILE_ALREADY_LOADED; } else { - // This will crash if any of the export filters try to use - // anything but the subtitles, but that wouldn't be safe to - // do anyway - agi::Context c; - memset(&c, 0, sizeof c); - c.ass = subs.get(); - - AssExporter exporter(&c); - exporter.AddAutoFilters(); - exporter.ExportTransform(); + AssFixStylesFilter().ProcessSubs(subs.get(), nullptr); singleFrame = frameNum; // Copying a nontrivially sized AssFile is fairly slow, so