Register export plugins, breaking cycles...
... as we did last relase for import; making several header files unnecessary. This breaks up a strongly connected component of 9, which was the largest remaining. Now the largest remaining is 5.
This commit is contained in:
parent
5459a7bf27
commit
bbaceba347
|
@ -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
|
||||
|
|
|
@ -2050,15 +2050,12 @@
|
|||
1790B06409883BFD008A330A /* Export.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = Export.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06509883BFD008A330A /* Export.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Export.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06609883BFD008A330A /* ExportCL.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportCL.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06709883BFD008A330A /* ExportCL.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportCL.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06809883BFD008A330A /* ExportMP3.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMP3.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06909883BFD008A330A /* ExportMP3.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMP3.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06A09883BFD008A330A /* ExportMultiple.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMultiple.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06B09883BFD008A330A /* ExportMultiple.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMultiple.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06C09883BFD008A330A /* ExportOGG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportOGG.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06D09883BFD008A330A /* ExportOGG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportOGG.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06E09883BFD008A330A /* ExportPCM.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportPCM.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B06F09883BFD008A330A /* ExportPCM.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportPCM.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B07009883BFD008A330A /* FFT.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FFT.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B07109883BFD008A330A /* FFT.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = FFT.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
1790B07209883BFD008A330A /* FileFormats.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FileFormats.cpp; sourceTree = "<group>"; 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 = "<group>"; tabWidth = 3; };
|
||||
2840CF4C0AEB807E00F49FC3 /* util.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; name = util.h; path = twolame/libtwolame/util.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
2840CF840AEB83DB00F49FC3 /* ExportMP2.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportMP2.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
2840CF850AEB83DB00F49FC3 /* ExportMP2.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportMP2.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
284416391B82D6BC0000574D /* TranslatableStringArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TranslatableStringArray.h; sourceTree = "<group>"; };
|
||||
2844163A1B82D6BC0000574D /* WaveTrackLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WaveTrackLocation.h; sourceTree = "<group>"; };
|
||||
28456AC00A2C180E00C23C1E /* ThemePrefs.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ThemePrefs.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
|
@ -2645,7 +2641,6 @@
|
|||
2860BA220E0F0D8600A13878 /* TimerRecordDialog.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = TimerRecordDialog.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
2860BA230E0F0D8600A13878 /* TimerRecordDialog.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = TimerRecordDialog.h; sourceTree = "<group>"; tabWidth = 3; };
|
||||
2860BA260E0F0DD800A13878 /* ExportFFmpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportFFmpeg.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
2860BA270E0F0DD800A13878 /* ExportFFmpeg.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ExportFFmpeg.h; sourceTree = "<group>"; 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 = "<group>"; };
|
||||
286229B2181CE51800E1AD1A /* collections.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = collections.c; path = lv2/lilv/src/collections.c; sourceTree = "<group>"; };
|
||||
|
@ -2891,7 +2886,6 @@
|
|||
28DE72B0103885AA007E18EC /* TimeWarper.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = TimeWarper.cpp; sourceTree = "<group>"; tabWidth = 3; };
|
||||
28DE72B1103885AA007E18EC /* TimeWarper.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = TimeWarper.h; sourceTree = "<group>"; 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 = "<group>"; tabWidth = 3; };
|
||||
28E3E6E70A7C14CA00AB1361 /* ExportFLAC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ExportFLAC.cpp; sourceTree = "<group>"; 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 = "<group>"; 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 = "<group>";
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -47,14 +47,6 @@
|
|||
#include <wx/dcmemory.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
#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> &&ExportPlugin)
|
||||
{
|
||||
mPlugins.push_back(std::move(ExportPlugin));
|
||||
}
|
||||
|
||||
const ExportPluginArray &Exporter::GetPlugins()
|
||||
{
|
||||
return mPlugins;
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#ifndef __AUDACITY_EXPORT__
|
||||
#define __AUDACITY_EXPORT__
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <wx/filename.h> // 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<Mixer> 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<ExportPlugin> &&plugin);
|
||||
|
||||
bool Process(AudacityProject *project, bool selectedOnly,
|
||||
double t0, double t1);
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportCL()
|
||||
{
|
||||
return std::make_unique<ExportCL>();
|
||||
}
|
||||
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportCL >(); } };
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportCL();
|
||||
|
||||
#endif
|
|
@ -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<ExportPlugin> New_ExportFFmpeg()
|
||||
{
|
||||
return std::make_unique<ExportFFmpeg>();
|
||||
}
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportFFmpeg >(); } };
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportFFmpeg();
|
||||
|
||||
#endif
|
|
@ -21,7 +21,6 @@ and libvorbis examples, Monty <monty@xiph.org>
|
|||
#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<ExportPlugin> New_ExportFLAC()
|
||||
{
|
||||
return std::make_unique<ExportFLAC>();
|
||||
}
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportFLAC >(); } };
|
||||
|
||||
#endif // USE_LIBFLAC
|
||||
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportFLAC();
|
||||
|
||||
#endif
|
||||
|
|
@ -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<char> &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<ExportPlugin> New_ExportMP2()
|
||||
{
|
||||
return std::make_unique<ExportMP2>();
|
||||
}
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportMP2 >(); } };
|
||||
|
||||
#endif // #ifdef USE_LIBTWOLAME
|
||||
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportMP2();
|
||||
|
||||
#endif
|
||||
|
|
@ -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<ExportPlugin> New_ExportMP3()
|
||||
{
|
||||
return std::make_unique<ExportMP3>();
|
||||
}
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportMP3 >(); } };
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Return library version
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportMP3();
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Get MP3 library version
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportOGG()
|
||||
{
|
||||
return std::make_unique<ExportOGG>();
|
||||
}
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportOGG >(); } };
|
||||
|
||||
#endif // USE_LIBVORBIS
|
||||
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportOGG();
|
||||
|
||||
#endif
|
||||
|
|
@ -9,7 +9,6 @@
|
|||
**********************************************************************/
|
||||
|
||||
#include "../Audacity.h" // for USE_* macros
|
||||
#include "ExportPCM.h"
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
|
@ -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<char> 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<ExportPlugin> New_ExportPCM()
|
||||
{
|
||||
return std::make_unique<ExportPCM>();
|
||||
}
|
||||
static Exporter::RegisteredExportPlugin
|
||||
sRegisteredPlugin{ []{ return std::make_unique< ExportPCM >(); } };
|
||||
|
|
|
@ -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<ExportPlugin> New_ExportPCM();
|
||||
|
||||
#endif
|
||||
|
|
@ -788,15 +788,9 @@
|
|||
<ClInclude Include="..\..\..\src\effects\Wahwah.h" />
|
||||
<ClInclude Include="..\..\..\src\effects\VST\VSTEffect.h" />
|
||||
<ClInclude Include="..\..\..\src\export\Export.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportCL.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportFFmpeg.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportFFmpegDialogs.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportFLAC.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportMP2.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportMP3.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportMultiple.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportOGG.h" />
|
||||
<ClInclude Include="..\..\..\src\export\ExportPCM.h" />
|
||||
<ClInclude Include="..\..\..\src\import\Import.h" />
|
||||
<ClInclude Include="..\..\..\src\import\ImportMIDI.h" />
|
||||
<ClInclude Include="..\..\..\src\import\ImportPlugin.h" />
|
||||
|
|
|
@ -1681,33 +1681,15 @@
|
|||
<ClInclude Include="..\..\..\src\export\Export.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportCL.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportFFmpeg.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportFFmpegDialogs.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportFLAC.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportMP2.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportMP3.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportMultiple.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportOGG.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\export\ExportPCM.h">
|
||||
<Filter>src\export</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\import\Import.h">
|
||||
<Filter>src\import</Filter>
|
||||
</ClInclude>
|
||||
|
|
Loading…
Reference in New Issue