diff --git a/locale/POTFILES.in b/locale/POTFILES.in index d5151bdce..cf6f57653 100644 --- a/locale/POTFILES.in +++ b/locale/POTFILES.in @@ -504,23 +504,17 @@ src/effects/vamp/VampEffect.h src/export/Export.cpp src/export/Export.h src/export/ExportCL.cpp -src/export/ExportCL.h src/export/ExportFFmpeg.cpp -src/export/ExportFFmpeg.h src/export/ExportFFmpegDialogs.cpp src/export/ExportFFmpegDialogs.h src/export/ExportFLAC.cpp -src/export/ExportFLAC.h src/export/ExportMP2.cpp -src/export/ExportMP2.h src/export/ExportMP3.cpp src/export/ExportMP3.h src/export/ExportMultiple.cpp src/export/ExportMultiple.h src/export/ExportOGG.cpp -src/export/ExportOGG.h src/export/ExportPCM.cpp -src/export/ExportPCM.h src/float_cast.h src/import/FormatClassifier.cpp src/import/FormatClassifier.h diff --git a/mac/Audacity.xcodeproj/project.pbxproj b/mac/Audacity.xcodeproj/project.pbxproj index 6f71b30ba..2b6c39f04 100644 --- a/mac/Audacity.xcodeproj/project.pbxproj +++ b/mac/Audacity.xcodeproj/project.pbxproj @@ -2050,15 +2050,12 @@ 1790B06409883BFD008A330A /* Export.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = Export.cpp; sourceTree = ""; tabWidth = 3; }; 1790B06509883BFD008A330A /* Export.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = ""; tabWidth = 3; }; 1790B06609883BFD008A330A /* ExportCL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportCL.cpp; sourceTree = ""; tabWidth = 3; }; - 1790B06709883BFD008A330A /* ExportCL.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportCL.h; sourceTree = ""; tabWidth = 3; }; 1790B06809883BFD008A330A /* ExportMP3.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMP3.cpp; sourceTree = ""; tabWidth = 3; }; 1790B06909883BFD008A330A /* ExportMP3.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMP3.h; sourceTree = ""; tabWidth = 3; }; 1790B06A09883BFD008A330A /* ExportMultiple.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMultiple.cpp; sourceTree = ""; tabWidth = 3; }; 1790B06B09883BFD008A330A /* ExportMultiple.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMultiple.h; sourceTree = ""; tabWidth = 3; }; 1790B06C09883BFD008A330A /* ExportOGG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportOGG.cpp; sourceTree = ""; tabWidth = 3; }; - 1790B06D09883BFD008A330A /* ExportOGG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportOGG.h; sourceTree = ""; tabWidth = 3; }; 1790B06E09883BFD008A330A /* ExportPCM.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportPCM.cpp; sourceTree = ""; tabWidth = 3; }; - 1790B06F09883BFD008A330A /* ExportPCM.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportPCM.h; sourceTree = ""; tabWidth = 3; }; 1790B07009883BFD008A330A /* FFT.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FFT.cpp; sourceTree = ""; tabWidth = 3; }; 1790B07109883BFD008A330A /* FFT.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = FFT.h; sourceTree = ""; tabWidth = 3; }; 1790B07209883BFD008A330A /* FileFormats.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FileFormats.cpp; sourceTree = ""; tabWidth = 3; }; @@ -2374,7 +2371,6 @@ 2840CF4B0AEB807E00F49FC3 /* util.c */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.c; name = util.c; path = twolame/libtwolame/util.c; sourceTree = ""; tabWidth = 3; }; 2840CF4C0AEB807E00F49FC3 /* util.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = util.h; path = twolame/libtwolame/util.h; sourceTree = ""; tabWidth = 3; }; 2840CF840AEB83DB00F49FC3 /* ExportMP2.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMP2.cpp; sourceTree = ""; tabWidth = 3; }; - 2840CF850AEB83DB00F49FC3 /* ExportMP2.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMP2.h; sourceTree = ""; tabWidth = 3; }; 284416391B82D6BC0000574D /* TranslatableStringArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatableStringArray.h; sourceTree = ""; }; 2844163A1B82D6BC0000574D /* WaveTrackLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaveTrackLocation.h; sourceTree = ""; }; 28456AC00A2C180E00C23C1E /* ThemePrefs.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ThemePrefs.cpp; sourceTree = ""; tabWidth = 3; }; @@ -2645,7 +2641,6 @@ 2860BA220E0F0D8600A13878 /* TimerRecordDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = TimerRecordDialog.cpp; sourceTree = ""; tabWidth = 3; }; 2860BA230E0F0D8600A13878 /* TimerRecordDialog.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = TimerRecordDialog.h; sourceTree = ""; tabWidth = 3; }; 2860BA260E0F0DD800A13878 /* ExportFFmpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportFFmpeg.cpp; sourceTree = ""; tabWidth = 3; }; - 2860BA270E0F0DD800A13878 /* ExportFFmpeg.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportFFmpeg.h; sourceTree = ""; tabWidth = 3; }; 286229B0181CE4B600E1AD1A /* liblv2.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblv2.a; sourceTree = BUILT_PRODUCTS_DIR; }; 286229B1181CE51800E1AD1A /* lilv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lilv.h; path = lv2/lilv/lilv/lilv.h; sourceTree = ""; }; 286229B2181CE51800E1AD1A /* collections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = collections.c; path = lv2/lilv/src/collections.c; sourceTree = ""; }; @@ -2891,7 +2886,6 @@ 28DE72B0103885AA007E18EC /* TimeWarper.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = TimeWarper.cpp; sourceTree = ""; tabWidth = 3; }; 28DE72B1103885AA007E18EC /* TimeWarper.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = TimeWarper.h; sourceTree = ""; tabWidth = 3; }; 28E237080E515D1D00281398 /* libscorealign.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libscorealign.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 28E3E6E60A7C14CA00AB1361 /* ExportFLAC.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportFLAC.h; sourceTree = ""; tabWidth = 3; }; 28E3E6E70A7C14CA00AB1361 /* ExportFLAC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportFLAC.cpp; sourceTree = ""; tabWidth = 3; }; 28E67F5F0A3A160D0021D89F /* libportaudio.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libportaudio.a; sourceTree = BUILT_PRODUCTS_DIR; }; 28E67FC10A3A29AE0021D89F /* pa_asio.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = pa_asio.h; sourceTree = ""; tabWidth = 3; }; @@ -4839,23 +4833,17 @@ 1790B06409883BFD008A330A /* Export.cpp */, 1790B06509883BFD008A330A /* Export.h */, 1790B06609883BFD008A330A /* ExportCL.cpp */, - 1790B06709883BFD008A330A /* ExportCL.h */, 2860BA260E0F0DD800A13878 /* ExportFFmpeg.cpp */, - 2860BA270E0F0DD800A13878 /* ExportFFmpeg.h */, 28DA07380E4F5CEC003933C5 /* ExportFFmpegDialogs.cpp */, 28DA07370E4F5CEC003933C5 /* ExportFFmpegDialogs.h */, 28E3E6E70A7C14CA00AB1361 /* ExportFLAC.cpp */, - 28E3E6E60A7C14CA00AB1361 /* ExportFLAC.h */, 2840CF840AEB83DB00F49FC3 /* ExportMP2.cpp */, - 2840CF850AEB83DB00F49FC3 /* ExportMP2.h */, 1790B06809883BFD008A330A /* ExportMP3.cpp */, 1790B06909883BFD008A330A /* ExportMP3.h */, 1790B06A09883BFD008A330A /* ExportMultiple.cpp */, 1790B06B09883BFD008A330A /* ExportMultiple.h */, 1790B06C09883BFD008A330A /* ExportOGG.cpp */, - 1790B06D09883BFD008A330A /* ExportOGG.h */, 1790B06E09883BFD008A330A /* ExportPCM.cpp */, - 1790B06F09883BFD008A330A /* ExportPCM.h */, ); path = export; sourceTree = ""; diff --git a/src/Makefile.am b/src/Makefile.am index 469cead07..a5f5ecea4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -499,19 +499,14 @@ audacity_SOURCES = \ export/Export.cpp \ export/Export.h \ export/ExportCL.cpp \ - export/ExportCL.h \ export/ExportFLAC.cpp \ - export/ExportFLAC.h \ export/ExportMP2.cpp \ - export/ExportMP2.h \ export/ExportMP3.cpp \ export/ExportMP3.h \ export/ExportMultiple.cpp \ export/ExportMultiple.h \ export/ExportOGG.cpp \ - export/ExportOGG.h \ export/ExportPCM.cpp \ - export/ExportPCM.h \ import/Import.cpp \ import/Import.h \ import/ImportFLAC.cpp \ @@ -814,7 +809,6 @@ audacity_CPPFLAGS += $(FFMPEG_CFLAGS) audacity_LDADD += $(FFMPEG_LIBS) audacity_SOURCES += \ export/ExportFFmpeg.cpp \ - export/ExportFFmpeg.h \ export/ExportFFmpegDialogs.cpp \ export/ExportFFmpegDialogs.h \ import/ImportFFmpeg.cpp \ diff --git a/src/Makefile.in b/src/Makefile.in index b7cacf185..9fcd2c908 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -101,7 +101,6 @@ bin_PROGRAMS = audacity$(EXEEXT) @USE_FFMPEG_TRUE@am__append_5 = $(FFMPEG_LIBS) @USE_FFMPEG_TRUE@am__append_6 = \ @USE_FFMPEG_TRUE@ export/ExportFFmpeg.cpp \ -@USE_FFMPEG_TRUE@ export/ExportFFmpeg.h \ @USE_FFMPEG_TRUE@ export/ExportFFmpegDialogs.cpp \ @USE_FFMPEG_TRUE@ export/ExportFFmpegDialogs.h \ @USE_FFMPEG_TRUE@ import/ImportFFmpeg.cpp \ @@ -430,13 +429,11 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \ effects/TruncSilence.h effects/TwoPassSimpleMono.cpp \ effects/TwoPassSimpleMono.h effects/Wahwah.cpp \ effects/Wahwah.h export/Export.cpp export/Export.h \ - export/ExportCL.cpp export/ExportCL.h export/ExportFLAC.cpp \ - export/ExportFLAC.h export/ExportMP2.cpp export/ExportMP2.h \ + export/ExportCL.cpp export/ExportFLAC.cpp export/ExportMP2.cpp \ export/ExportMP3.cpp export/ExportMP3.h \ export/ExportMultiple.cpp export/ExportMultiple.h \ - export/ExportOGG.cpp export/ExportOGG.h export/ExportPCM.cpp \ - export/ExportPCM.h import/Import.cpp import/Import.h \ - import/ImportFLAC.cpp import/ImportForwards.h \ + export/ExportOGG.cpp export/ExportPCM.cpp import/Import.cpp \ + import/Import.h import/ImportFLAC.cpp import/ImportForwards.h \ import/ImportLOF.cpp import/ImportMP3.cpp import/ImportOGG.cpp \ import/ImportPCM.cpp import/ImportPlugin.h \ import/ImportRaw.cpp import/ImportRaw.h \ @@ -608,17 +605,16 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \ xml/XMLFileReader.h xml/XMLWriter.cpp xml/XMLWriter.h \ effects/audiounits/AudioUnitEffect.cpp \ effects/audiounits/AudioUnitEffect.h export/ExportFFmpeg.cpp \ - export/ExportFFmpeg.h export/ExportFFmpegDialogs.cpp \ - export/ExportFFmpegDialogs.h import/ImportFFmpeg.cpp \ - import/ImportGStreamer.cpp effects/ladspa/ladspa.h \ - effects/ladspa/LadspaEffect.cpp effects/ladspa/LadspaEffect.h \ - ondemand/ODDecodeFlacTask.cpp ondemand/ODDecodeFlacTask.h \ - effects/nyquist/LoadNyquist.cpp effects/nyquist/LoadNyquist.h \ - effects/nyquist/Nyquist.cpp effects/nyquist/Nyquist.h \ - effects/lv2/LoadLV2.cpp effects/lv2/LoadLV2.h \ - effects/lv2/LV2Effect.cpp effects/lv2/LV2Effect.h \ - NoteTrack.cpp NoteTrack.h import/ImportMIDI.cpp \ - import/ImportMIDI.h import/ImportQT.cpp \ + export/ExportFFmpegDialogs.cpp export/ExportFFmpegDialogs.h \ + import/ImportFFmpeg.cpp import/ImportGStreamer.cpp \ + effects/ladspa/ladspa.h effects/ladspa/LadspaEffect.cpp \ + effects/ladspa/LadspaEffect.h ondemand/ODDecodeFlacTask.cpp \ + ondemand/ODDecodeFlacTask.h effects/nyquist/LoadNyquist.cpp \ + effects/nyquist/LoadNyquist.h effects/nyquist/Nyquist.cpp \ + effects/nyquist/Nyquist.h effects/lv2/LoadLV2.cpp \ + effects/lv2/LoadLV2.h effects/lv2/LV2Effect.cpp \ + effects/lv2/LV2Effect.h NoteTrack.cpp NoteTrack.h \ + import/ImportMIDI.cpp import/ImportMIDI.h import/ImportQT.cpp \ effects/vamp/LoadVamp.cpp effects/vamp/LoadVamp.h \ effects/vamp/VampEffect.cpp effects/vamp/VampEffect.h \ effects/VST/aeffectx.h effects/VST/VSTEffect.cpp \ @@ -1554,13 +1550,11 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \ effects/TruncSilence.h effects/TwoPassSimpleMono.cpp \ effects/TwoPassSimpleMono.h effects/Wahwah.cpp \ effects/Wahwah.h export/Export.cpp export/Export.h \ - export/ExportCL.cpp export/ExportCL.h export/ExportFLAC.cpp \ - export/ExportFLAC.h export/ExportMP2.cpp export/ExportMP2.h \ + export/ExportCL.cpp export/ExportFLAC.cpp export/ExportMP2.cpp \ export/ExportMP3.cpp export/ExportMP3.h \ export/ExportMultiple.cpp export/ExportMultiple.h \ - export/ExportOGG.cpp export/ExportOGG.h export/ExportPCM.cpp \ - export/ExportPCM.h import/Import.cpp import/Import.h \ - import/ImportFLAC.cpp import/ImportForwards.h \ + export/ExportOGG.cpp export/ExportPCM.cpp import/Import.cpp \ + import/Import.h import/ImportFLAC.cpp import/ImportForwards.h \ import/ImportLOF.cpp import/ImportMP3.cpp import/ImportOGG.cpp \ import/ImportPCM.cpp import/ImportPlugin.h \ import/ImportRaw.cpp import/ImportRaw.h \ diff --git a/src/export/Export.cpp b/src/export/Export.cpp index 9d5cd8037..f57d60c14 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -47,14 +47,6 @@ #include #include -#include "ExportPCM.h" -#include "ExportMP3.h" -#include "ExportOGG.h" -#include "ExportFLAC.h" -#include "ExportCL.h" -#include "ExportMP2.h" -#include "ExportFFmpeg.h" - #include "sndfile.h" #include "FileDialog.h" @@ -297,33 +289,42 @@ BEGIN_EVENT_TABLE(Exporter, wxEvtHandler) EVT_COMMAND( wxID_ANY, AUDACITY_FILE_SUFFIX_EVENT, Exporter::OnExtensionChanged) END_EVENT_TABLE() +namespace { + using ExportPluginFactories = std::vector< Exporter::ExportPluginFactory >; + ExportPluginFactories &sFactories() + { + static ExportPluginFactories theList; + return theList; + } +} + +Exporter::RegisteredExportPlugin::RegisteredExportPlugin( + const ExportPluginFactory &factory ) +{ + if ( factory ) + sFactories().emplace_back( factory ); +} + Exporter::Exporter() { mMixerSpec = NULL; mBook = NULL; + // build the list of export plugins. + for ( const auto &factory : sFactories() ) + mPlugins.emplace_back( factory() ); + + // The factories were pushed on the array at static initialization time in an + // unspecified sequence. Sort according to the sequence numbers the plugins + // report to make the order determinate. + std::sort( mPlugins.begin(), mPlugins.end(), + []( const ExportPluginArray::value_type &a, + const ExportPluginArray::value_type &b ){ + return a->SequenceNumber() < b->SequenceNumber(); + } + ); + SetFileDialogTitle( _("Export Audio") ); - - RegisterPlugin(New_ExportPCM()); - RegisterPlugin(New_ExportMP3()); - -#ifdef USE_LIBVORBIS - RegisterPlugin(New_ExportOGG()); -#endif - -#ifdef USE_LIBFLAC - RegisterPlugin(New_ExportFLAC()); -#endif - -#if USE_LIBTWOLAME - RegisterPlugin(New_ExportMP2()); -#endif - - RegisterPlugin(New_ExportCL()); - -#if defined(USE_FFMPEG) - RegisterPlugin(New_ExportFFmpeg()); -#endif } Exporter::~Exporter() @@ -373,11 +374,6 @@ int Exporter::FindFormatIndex(int exportindex) return 0; } -void Exporter::RegisterPlugin(std::unique_ptr &&ExportPlugin) -{ - mPlugins.push_back(std::move(ExportPlugin)); -} - const ExportPluginArray &Exporter::GetPlugins() { return mPlugins; diff --git a/src/export/Export.h b/src/export/Export.h index 091d469da..3692cbbc4 100644 --- a/src/export/Export.h +++ b/src/export/Export.h @@ -11,6 +11,7 @@ #ifndef __AUDACITY_EXPORT__ #define __AUDACITY_EXPORT__ +#include #include #include // member variable #include "../SampleFormat.h" @@ -128,6 +129,8 @@ public: const Tags *metadata = NULL, int subformat = 0) = 0; + virtual unsigned SequenceNumber() const = 0; + protected: std::unique_ptr CreateMixer(const TrackList &tracks, bool selectionOnly, @@ -157,6 +160,18 @@ class AUDACITY_DLL_API Exporter final : public wxEvtHandler { public: + using ExportPluginFactory = + std::function< std::unique_ptr< ExportPlugin >() >; + + // Objects of this type are statically constructed in files implementing + // subclasses of ExportPlugin + // Register factories, not plugin objects themselves, which allows them + // to have some fresh state variables each time export begins again + // and to compute translated strings for the current locale + struct RegisteredExportPlugin{ + RegisteredExportPlugin( const ExportPluginFactory& ); + }; + static bool DoEditMetadata(AudacityProject &project, const wxString &title, const wxString &shortUndoDescription, bool force); @@ -165,7 +180,6 @@ public: void SetFileDialogTitle( const wxString & DialogTitle ); void SetDefaultFormat( const wxString & Format ){ mFormatName = Format;}; - void RegisterPlugin(std::unique_ptr &&plugin); bool Process(AudacityProject *project, bool selectedOnly, double t0, double t1); diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index 921a131ea..deacf9158 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -12,7 +12,6 @@ **********************************************************************/ #include "../Audacity.h" -#include "ExportCL.h" #include "../ProjectSettings.h" @@ -301,6 +300,8 @@ public: MixerSpec *mixerSpec = NULL, const Tags *metadata = NULL, int subformat = 0) override; + + virtual unsigned SequenceNumber() const override { return 60; } }; ExportCL::ExportCL() @@ -554,8 +555,5 @@ wxWindow *ExportCL::OptionsCreate(wxWindow *parent, int format) return safenew ExportCLOptions(parent, format); } -std::unique_ptr New_ExportCL() -{ - return std::make_unique(); -} - +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportCL >(); } }; diff --git a/src/export/ExportCL.h b/src/export/ExportCL.h deleted file mode 100644 index 4a4033650..000000000 --- a/src/export/ExportCL.h +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - - Audacity: A Digital Audio Editor - - ExportCL.h - - Joshua Haberman - -**********************************************************************/ - -#ifndef __AUDACITY_EXPORTCL__ -#define __AUDACITY_EXPORTCL__ - -#include "../MemoryX.h" -// forward declaration of the ExportPlugin class from Export.h -class ExportPlugin; - -/** The only part of this class which is publically accessible is the - * factory method New_ExportCL() which creates a NEW ExportCL object and - * returns a pointer to it. The rest of the class declaration is in ExportCL.cpp - */ -std::unique_ptr New_ExportCL(); - -#endif diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index e2e1f971a..aa7cdebef 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -20,7 +20,6 @@ function. #include "../Audacity.h" // keep ffmpeg before wx because they interact // for USE_* macros -#include "ExportFFmpeg.h" #include "../FFmpeg.h" // and Audacity.h before FFmpeg for config*.h @@ -151,6 +150,8 @@ public: const Tags *metadata = NULL, int subformat = 0) override; + virtual unsigned SequenceNumber() const override { return 70; } + private: AVOutputFormat * mEncFormatDesc{}; // describes our output file to libavformat @@ -1095,10 +1096,8 @@ wxWindow *ExportFFmpeg::OptionsCreate(wxWindow *parent, int format) return ExportPlugin::OptionsCreate(parent, format); } -std::unique_ptr New_ExportFFmpeg() -{ - return std::make_unique(); -} +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportFFmpeg >(); } }; #endif diff --git a/src/export/ExportFFmpeg.h b/src/export/ExportFFmpeg.h deleted file mode 100644 index 85a0ed26c..000000000 --- a/src/export/ExportFFmpeg.h +++ /dev/null @@ -1,23 +0,0 @@ -/********************************************************************** - -Audacity: A Digital Audio Editor - -ExportFFmpeg.h - -LRN - -**********************************************************************/ - -#ifndef __AUDACITY_EXPORTFFMPEG__ -#define __AUDACITY_EXPORTFFMPEG__ - -#include "../MemoryX.h" -class ExportPlugin; - -/** The only part of this class which is publically accessible is the - * factory method New_ExportFFmpeg() which creates a NEW ExportFFmpeg object and - * returns a pointer to it. The rest of the class declaration is in ExportFFmpeg.cpp - */ -std::unique_ptr New_ExportFFmpeg(); - -#endif diff --git a/src/export/ExportFLAC.cpp b/src/export/ExportFLAC.cpp index bb36115a8..f5bfb1b46 100644 --- a/src/export/ExportFLAC.cpp +++ b/src/export/ExportFLAC.cpp @@ -21,7 +21,6 @@ and libvorbis examples, Monty #include "../Audacity.h" // for USE_* macros #ifdef USE_LIBFLAC -#include "ExportFLAC.h" #include "Export.h" @@ -220,6 +219,8 @@ public: const Tags *metadata = NULL, int subformat = 0) override; + virtual unsigned SequenceNumber() const override { return 40; } + private: bool GetMetadata(AudacityProject *project, const Tags *tags); @@ -467,10 +468,8 @@ bool ExportFLAC::GetMetadata(AudacityProject *project, const Tags *tags) return true; } -std::unique_ptr New_ExportFLAC() -{ - return std::make_unique(); -} +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportFLAC >(); } }; #endif // USE_LIBFLAC diff --git a/src/export/ExportFLAC.h b/src/export/ExportFLAC.h deleted file mode 100644 index f22e48296..000000000 --- a/src/export/ExportFLAC.h +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - - Audacity: A Digital Audio Editor - - ExportFLAC.h - - Frederik M.J.V - -**********************************************************************/ - -#ifndef __AUDACITY_EXPORTFLAC__ -#define __AUDACITY_EXPORTFLAC__ - -#include "../MemoryX.h" -class ExportPlugin; - -/* The only part of this class which is publically accessible is the - * factory method New_ExportFLAC() which creates a NEW ExportFLAC object and - * returns a pointer to it. The rest of the class declaration is in ExportFLAC.cpp - */ -std::unique_ptr New_ExportFLAC(); - -#endif - diff --git a/src/export/ExportMP2.cpp b/src/export/ExportMP2.cpp index 57f9de00f..2e07e01d5 100644 --- a/src/export/ExportMP2.cpp +++ b/src/export/ExportMP2.cpp @@ -33,7 +33,6 @@ */ #include "../Audacity.h"// for USE_* macros -#include "ExportMP2.h" #ifdef USE_LIBTWOLAME @@ -184,6 +183,8 @@ public: const Tags *metadata = NULL, int subformat = 0) override; + virtual unsigned SequenceNumber() const override { return 50; } + private: int AddTags(AudacityProject *project, ArrayOf &buffer, bool *endOfFile, const Tags *tags); @@ -462,10 +463,8 @@ void ExportMP2::AddFrame(struct id3_tag *tp, const wxString & n, const wxString } #endif -std::unique_ptr New_ExportMP2() -{ - return std::make_unique(); -} +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportMP2 >(); } }; #endif // #ifdef USE_LIBTWOLAME diff --git a/src/export/ExportMP2.h b/src/export/ExportMP2.h deleted file mode 100644 index 19593abfa..000000000 --- a/src/export/ExportMP2.h +++ /dev/null @@ -1,25 +0,0 @@ -/********************************************************************** - - Audacity: A Digital Audio Editor - - ExportMP2.h - - Dominic Mazzoni - Markus Meyer - -**********************************************************************/ - -#ifndef __AUDACITY_EXPORTMP2__ -#define __AUDACITY_EXPORTMP2__ - -#include "../MemoryX.h" -class ExportPlugin; - -/** The only part of this class which is publically accessible is the - * factory method New_ExportMP2() which creates a NEW ExportMP2 object and - * returns a pointer to it. The rest of the class declaration is in ExportMP2.cpp - */ -std::unique_ptr New_ExportMP2(); - -#endif - diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index d80806121..68ee254f7 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -1692,6 +1692,8 @@ public: const Tags *metadata = NULL, int subformat = 0) override; + virtual unsigned SequenceNumber() const override { return 20; } + private: int FindValue(CHOICES *choices, int cnt, int needle, int def); @@ -2232,10 +2234,8 @@ void ExportMP3::AddFrame(struct id3_tag *tp, const wxString & n, const wxString } #endif -std::unique_ptr New_ExportMP3() -{ - return std::make_unique(); -} +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportMP3 >(); } }; //---------------------------------------------------------------------------- // Return library version diff --git a/src/export/ExportMP3.h b/src/export/ExportMP3.h index 98aad13de..de539c2e1 100644 --- a/src/export/ExportMP3.h +++ b/src/export/ExportMP3.h @@ -24,13 +24,8 @@ #define MP3_EXPORT_BUILT_IN 1 #endif -class ExportPlugin; class wxString; class wxWindow; -/** Factory method New_ExportMP3() which creates a NEW ExportMP3 object and - * returns a pointer to it. The rest of the class declaration is in ExportMP3.cpp - */ -std::unique_ptr New_ExportMP3(); //---------------------------------------------------------------------------- // Get MP3 library version diff --git a/src/export/ExportOGG.cpp b/src/export/ExportOGG.cpp index d98f7ca78..c1247d82a 100644 --- a/src/export/ExportOGG.cpp +++ b/src/export/ExportOGG.cpp @@ -18,7 +18,6 @@ #include "../Audacity.h" // for USE_* macros #ifdef USE_LIBVORBIS -#include "ExportOGG.h" #include "Export.h" @@ -143,6 +142,8 @@ public: const Tags *metadata = NULL, int subformat = 0) override; + virtual unsigned SequenceNumber() const override { return 30; } + private: bool FillComment(AudacityProject *project, vorbis_comment *comment, const Tags *metadata); @@ -397,10 +398,8 @@ bool ExportOGG::FillComment(AudacityProject *project, vorbis_comment *comment, c return true; } -std::unique_ptr New_ExportOGG() -{ - return std::make_unique(); -} +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportOGG >(); } }; #endif // USE_LIBVORBIS diff --git a/src/export/ExportOGG.h b/src/export/ExportOGG.h deleted file mode 100644 index 160d081e0..000000000 --- a/src/export/ExportOGG.h +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - - Audacity: A Digital Audio Editor - - ExportOGG.h - - Joshua Haberman - -**********************************************************************/ - -#ifndef __AUDACITY_EXPORTOGG__ -#define __AUDACITY_EXPORTOGG__ - -#include "../MemoryX.h" -class ExportPlugin; - -/** The only part of this class which is publically accessible is the - * factory method New_ExportOGG() which creates a NEW ExportOGG object and - * returns a pointer to it. The rest of the class declaration is in ExportOGG.cpp - */ -std::unique_ptr New_ExportOGG(); - -#endif - diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index e87591aeb..8e2c8049b 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -9,7 +9,6 @@ **********************************************************************/ #include "../Audacity.h" // for USE_* macros -#include "ExportPCM.h" #include @@ -342,6 +341,8 @@ public: FileExtension GetExtension(int index) override; bool CheckFileName(wxFileName &filename, int format) override; + virtual unsigned SequenceNumber() const override { return 10; } + private: void ReportTooBigError(wxWindow * pParent); ArrayOf AdjustString(const wxString & wxStr, int sf_format); @@ -967,7 +968,5 @@ bool ExportPCM::CheckFileName(wxFileName &filename, int format) return ExportPlugin::CheckFileName(filename, format); } -std::unique_ptr New_ExportPCM() -{ - return std::make_unique(); -} +static Exporter::RegisteredExportPlugin +sRegisteredPlugin{ []{ return std::make_unique< ExportPCM >(); } }; diff --git a/src/export/ExportPCM.h b/src/export/ExportPCM.h deleted file mode 100644 index 6fc957de7..000000000 --- a/src/export/ExportPCM.h +++ /dev/null @@ -1,24 +0,0 @@ -/********************************************************************** - - Audacity: A Digital Audio Editor - - ExportPCM.h - - Dominic Mazzoni - -**********************************************************************/ - -#ifndef __AUDACITY_EXPORTPCM__ -#define __AUDACITY_EXPORTPCM__ - -#include "../MemoryX.h" -class ExportPlugin; - -/** The only part of this class which is publically accessible is the - * factory method New_ExportPCM() which creates a NEW ExportPCM object and - * returns a pointer to it. The rest of the class declaration is in ExportPCM.cpp - */ -std::unique_ptr New_ExportPCM(); - -#endif - diff --git a/win/Projects/Audacity/Audacity.vcxproj b/win/Projects/Audacity/Audacity.vcxproj index 545464844..dc24c612d 100755 --- a/win/Projects/Audacity/Audacity.vcxproj +++ b/win/Projects/Audacity/Audacity.vcxproj @@ -788,15 +788,9 @@ - - - - - - diff --git a/win/Projects/Audacity/Audacity.vcxproj.filters b/win/Projects/Audacity/Audacity.vcxproj.filters index c9d60b5af..ddf7a44ec 100755 --- a/win/Projects/Audacity/Audacity.vcxproj.filters +++ b/win/Projects/Audacity/Audacity.vcxproj.filters @@ -1681,33 +1681,15 @@ src\export - - src\export - - - src\export - src\export - - src\export - - - src\export - src\export src\export - - src\export - - - src\export - src\import