forked from mia/Aegisub
Get rid of auto-running exporters, since they aren't really used for anything anymore
This commit is contained in:
parent
7d6e246ace
commit
4116e88fe5
6 changed files with 5 additions and 31 deletions
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
#include <libaegisub/of_type_adaptor.h>
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
#include <boost/range/algorithm_ext.hpp>
|
||||
|
||||
#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<AegiVideoFrame> 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
|
||||
|
|
Loading…
Reference in a new issue