Get rid of auto-running exporters, since they aren't really used for anything anymore

This commit is contained in:
Thomas Goyne 2013-01-02 19:22:04 -08:00
parent 7d6e246ace
commit 4116e88fe5
6 changed files with 5 additions and 31 deletions

View file

@ -39,11 +39,10 @@
#include "ass_export_filter.h" #include "ass_export_filter.h"
#include "utils.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) : name(name)
, priority(priority) , priority(priority)
, description(description) , description(description)
, auto_apply(auto_apply)
{ {
} }

View file

@ -77,17 +77,12 @@ class AssExportFilter {
/// User-visible description of this filter /// User-visible description of this filter
wxString description; wxString description;
/// Should this filter be automatically applied when sending subtitles to
/// the renderer and exporting to non-ASS formats
bool auto_apply;
public: 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() { }; virtual ~AssExportFilter() { };
wxString const& GetName() const { return name; } wxString const& GetName() const { return name; }
wxString const& GetDescription() const { return description; } wxString const& GetDescription() const { return description; }
bool GetAutoApply() const { return auto_apply; }
/// Process subtitles /// Process subtitles
/// @param subs Subtitles to process /// @param subs Subtitles to process

View file

@ -84,13 +84,6 @@ void AssExporter::AddFilter(wxString const& name) {
filters.push_back(filter); filters.push_back(filter);
} }
void AssExporter::AddAutoFilters() {
for (auto filter : *AssExportFilterChain::GetFilterList()) {
if (filter->GetAutoApply())
filters.push_back(filter);
}
}
wxArrayString AssExporter::GetAllFilterNames() const { wxArrayString AssExporter::GetAllFilterNames() const {
wxArrayString names; wxArrayString names;
transform(filter_list_begin(), filter_list_end(), transform(filter_list_begin(), filter_list_end(),

View file

@ -71,10 +71,6 @@ public:
/// @throws wxString if filter is not found /// @throws wxString if filter is not found
void AddFilter(wxString const& name); 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 /// Run all added export filters
/// @param parent_window Parent window the filters should use when opening dialogs /// @param parent_window Parent window the filters should use when opening dialogs
/// @param copy Should the file be copied rather than transformed in-place? /// @param copy Should the file be copied rather than transformed in-place?

View file

@ -47,7 +47,7 @@
#include <libaegisub/of_type_adaptor.h> #include <libaegisub/of_type_adaptor.h>
AssFixStylesFilter::AssFixStylesFilter() 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)
{ {
} }

View file

@ -28,9 +28,9 @@
#include <boost/range/algorithm_ext.hpp> #include <boost/range/algorithm_ext.hpp>
#include "ass_dialogue.h" #include "ass_dialogue.h"
#include "ass_exporter.h"
#include "ass_file.h" #include "ass_file.h"
#include "compat.h" #include "compat.h"
#include "export_fixstyle.h"
#include "include/aegisub/context.h" #include "include/aegisub/context.h"
#include "include/aegisub/subtitles_provider.h" #include "include/aegisub/subtitles_provider.h"
#include "video_frame.h" #include "video_frame.h"
@ -82,16 +82,7 @@ std::shared_ptr<AegiVideoFrame> ThreadedFrameSource::ProcFrame(int frameNum, dou
singleFrame = SUBS_FILE_ALREADY_LOADED; singleFrame = SUBS_FILE_ALREADY_LOADED;
} }
else { else {
// This will crash if any of the export filters try to use AssFixStylesFilter().ProcessSubs(subs.get(), nullptr);
// 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();
singleFrame = frameNum; singleFrame = frameNum;
// Copying a nontrivially sized AssFile is fairly slow, so // Copying a nontrivially sized AssFile is fairly slow, so