Import.cpp does not depend on subclasses of ImportPlugin...

... freeing 15 files from the big strongly connected component:

ImportFFmpeg & ODDecodeFFMpegTask (still in a cycle of two)
ImportFLAC
ImportGStreamer
ImportLOF
ImportMIDI
ImportMP3
ImportOGG
ImportPCM
ImportQT
ProjectFileManager
ProjectFSCK
ProjectManager
ProjectSelectionManager
ODDecodeFlacTask

And eight header files in src/import are deleted.

This breaks a lot of cycles because Import, which is still in the big component,
no longer includes ImportLOF, which recursively uses ProjectManager. A
registration system for the subclasses of ImportFileHandle allows that
recursion without the cyclic compilation dependencies.
This commit is contained in:
Paul Licameli 2019-06-06 17:43:34 -04:00
parent 3cf124d92a
commit e2cf1d93c2
25 changed files with 202 additions and 424 deletions

View File

@ -507,25 +507,17 @@ src/import/FormatClassifier.h
src/import/Import.cpp
src/import/Import.h
src/import/ImportFFmpeg.cpp
src/import/ImportFFmpeg.h
src/import/ImportFLAC.cpp
src/import/ImportFLAC.h
src/import/ImportForwards.h
src/import/ImportGStreamer.cpp
src/import/ImportGStreamer.h
src/import/ImportLOF.cpp
src/import/ImportLOF.h
src/import/ImportMIDI.cpp
src/import/ImportMIDI.h
src/import/ImportMP3.cpp
src/import/ImportMP3.h
src/import/ImportOGG.cpp
src/import/ImportOGG.h
src/import/ImportPCM.cpp
src/import/ImportPCM.h
src/import/ImportPlugin.h
src/import/ImportQT.cpp
src/import/ImportQT.h
src/import/ImportRaw.cpp
src/import/ImportRaw.h
src/import/MultiFormatReader.cpp

View File

@ -2053,17 +2053,12 @@
1790B07F09883BFD008A330A /* Import.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = Import.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08009883BFD008A330A /* Import.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Import.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08109883BFD008A330A /* ImportFLAC.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportFLAC.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08209883BFD008A330A /* ImportFLAC.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportFLAC.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08309883BFD008A330A /* ImportLOF.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportLOF.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08409883BFD008A330A /* ImportLOF.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportLOF.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08509883BFD008A330A /* ImportMIDI.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportMIDI.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08609883BFD008A330A /* ImportMIDI.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportMIDI.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08709883BFD008A330A /* ImportMP3.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportMP3.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08809883BFD008A330A /* ImportMP3.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportMP3.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08909883BFD008A330A /* ImportOGG.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportOGG.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08A09883BFD008A330A /* ImportOGG.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportOGG.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08B09883BFD008A330A /* ImportPCM.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportPCM.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08C09883BFD008A330A /* ImportPCM.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportPCM.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08D09883BFD008A330A /* ImportPlugin.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportPlugin.h; sourceTree = "<group>"; tabWidth = 3; };
1790B08E09883BFD008A330A /* ImportRaw.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportRaw.cpp; sourceTree = "<group>"; tabWidth = 3; };
1790B08F09883BFD008A330A /* ImportRaw.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportRaw.h; sourceTree = "<group>"; tabWidth = 3; };
@ -2221,7 +2216,6 @@
280112791943EE0E00D98A16 /* HelpSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HelpSystem.cpp; sourceTree = "<group>"; };
2801127A1943EE0E00D98A16 /* HelpSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HelpSystem.h; sourceTree = "<group>"; };
2801A6430BF9268700648258 /* ImportQT.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportQT.cpp; sourceTree = "<group>"; tabWidth = 3; };
2801A6440BF9268700648258 /* ImportQT.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportQT.h; sourceTree = "<group>"; tabWidth = 3; };
2803810018313B070078452A /* lame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = lame.h; path = lame/lame/lame.h; sourceTree = "<group>"; };
2803C8B519F35AA000278526 /* PluginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginManager.h; sourceTree = "<group>"; };
2803C8B619F35AA000278526 /* TrackPanelListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TrackPanelListener.h; sourceTree = "<group>"; };
@ -2303,7 +2297,6 @@
282D474A0B9E8D900034BC49 /* Snap.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = Snap.cpp; sourceTree = "<group>"; tabWidth = 3; };
282D474B0B9E8D900034BC49 /* Snap.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = Snap.h; sourceTree = "<group>"; tabWidth = 3; };
283135EA0DFB9D110076D551 /* ImportFFmpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = ImportFFmpeg.cpp; sourceTree = "<group>"; tabWidth = 3; };
283135EB0DFB9D110076D551 /* ImportFFmpeg.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = ImportFFmpeg.h; sourceTree = "<group>"; tabWidth = 3; };
283135FD0DFBA2E80076D551 /* FFmpeg.cpp */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.cpp.cpp; path = FFmpeg.cpp; sourceTree = "<group>"; tabWidth = 3; };
283135FE0DFBA2E80076D551 /* FFmpeg.h */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.h; path = FFmpeg.h; sourceTree = "<group>"; tabWidth = 3; };
283506280A3A88ED00EB1EBD /* pa_unix_util.c */ = {isa = PBXFileReference; fileEncoding = 5; indentWidth = 3; lastKnownFileType = sourcecode.c.c; path = pa_unix_util.c; sourceTree = "<group>"; tabWidth = 3; };
@ -3304,7 +3297,6 @@
5E78388D1DE4995E003270C0 /* AudacityException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AudacityException.cpp; sourceTree = "<group>"; };
5E7838931DE4BBC2003270C0 /* CommandFlag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandFlag.h; sourceTree = "<group>"; };
5E79B33F1D5CC38D001D677D /* ImportGStreamer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ImportGStreamer.cpp; sourceTree = "<group>"; };
5E79B3401D5CC38D001D677D /* ImportGStreamer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImportGStreamer.h; sourceTree = "<group>"; };
5E89EEE91F78D017000F5E82 /* zh_CN.po */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = zh_CN.po; path = ../locale/zh_CN.po; sourceTree = "<group>"; };
5E94A1B81D1F1C8400A8713A /* wxPanelWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wxPanelWrapper.cpp; sourceTree = "<group>"; };
5E94A1B91D1F1C8400A8713A /* wxPanelWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wxPanelWrapper.h; sourceTree = "<group>"; };
@ -4789,25 +4781,17 @@
1790B07F09883BFD008A330A /* Import.cpp */,
1790B08009883BFD008A330A /* Import.h */,
283135EA0DFB9D110076D551 /* ImportFFmpeg.cpp */,
283135EB0DFB9D110076D551 /* ImportFFmpeg.h */,
1790B08109883BFD008A330A /* ImportFLAC.cpp */,
1790B08209883BFD008A330A /* ImportFLAC.h */,
5EB9EA281D5B81270050AF40 /* ImportForwards.h */,
5E79B33F1D5CC38D001D677D /* ImportGStreamer.cpp */,
5E79B3401D5CC38D001D677D /* ImportGStreamer.h */,
1790B08309883BFD008A330A /* ImportLOF.cpp */,
1790B08409883BFD008A330A /* ImportLOF.h */,
1790B08509883BFD008A330A /* ImportMIDI.cpp */,
1790B08609883BFD008A330A /* ImportMIDI.h */,
1790B08709883BFD008A330A /* ImportMP3.cpp */,
1790B08809883BFD008A330A /* ImportMP3.h */,
1790B08909883BFD008A330A /* ImportOGG.cpp */,
1790B08A09883BFD008A330A /* ImportOGG.h */,
1790B08B09883BFD008A330A /* ImportPCM.cpp */,
1790B08C09883BFD008A330A /* ImportPCM.h */,
1790B08D09883BFD008A330A /* ImportPlugin.h */,
2801A6430BF9268700648258 /* ImportQT.cpp */,
2801A6440BF9268700648258 /* ImportQT.h */,
1790B08E09883BFD008A330A /* ImportRaw.cpp */,
1790B08F09883BFD008A330A /* ImportRaw.h */,
28F67175197DFA1C00075C32 /* MultiFormatReader.cpp */,

View File

@ -495,16 +495,11 @@ audacity_SOURCES = \
import/Import.cpp \
import/Import.h \
import/ImportFLAC.cpp \
import/ImportFLAC.h \
import/ImportForwards.h \
import/ImportLOF.cpp \
import/ImportLOF.h \
import/ImportMP3.cpp \
import/ImportMP3.h \
import/ImportOGG.cpp \
import/ImportOGG.h \
import/ImportPCM.cpp \
import/ImportPCM.h \
import/ImportPlugin.h \
import/ImportRaw.cpp \
import/ImportRaw.h \
@ -776,7 +771,6 @@ audacity_SOURCES += \
export/ExportFFmpegDialogs.cpp \
export/ExportFFmpegDialogs.h \
import/ImportFFmpeg.cpp \
import/ImportFFmpeg.h \
$(NULL)
endif
@ -785,7 +779,6 @@ audacity_CPPFLAGS += $(GSTREAMER_CFLAGS)
audacity_LDADD += $(GSTREAMER_LIBS)
audacity_SOURCES += \
import/ImportGStreamer.cpp \
import/ImportGStreamer.h \
$(NULL)
endif
@ -881,7 +874,6 @@ audacity_CPPFLAGS += $(QUICKTIME_CFLAGS)
audacity_LDADD += $(QUICKTIME_LIBS)
audacity_SOURCES += \
import/ImportQT.cpp \
import/ImportQT.h \
$(NULL)
endif

View File

@ -105,14 +105,12 @@ bin_PROGRAMS = audacity$(EXEEXT)
@USE_FFMPEG_TRUE@ export/ExportFFmpegDialogs.cpp \
@USE_FFMPEG_TRUE@ export/ExportFFmpegDialogs.h \
@USE_FFMPEG_TRUE@ import/ImportFFmpeg.cpp \
@USE_FFMPEG_TRUE@ import/ImportFFmpeg.h \
@USE_FFMPEG_TRUE@ $(NULL)
@USE_GSTREAMER_TRUE@am__append_7 = $(GSTREAMER_CFLAGS)
@USE_GSTREAMER_TRUE@am__append_8 = $(GSTREAMER_LIBS)
@USE_GSTREAMER_TRUE@am__append_9 = \
@USE_GSTREAMER_TRUE@ import/ImportGStreamer.cpp \
@USE_GSTREAMER_TRUE@ import/ImportGStreamer.h \
@USE_GSTREAMER_TRUE@ $(NULL)
@USE_LADSPA_TRUE@am__append_10 = $(LADSPA_CFLAGS)
@ -175,7 +173,6 @@ bin_PROGRAMS = audacity$(EXEEXT)
@USE_QUICKTIME_TRUE@am__append_40 = $(QUICKTIME_LIBS)
@USE_QUICKTIME_TRUE@am__append_41 = \
@USE_QUICKTIME_TRUE@ import/ImportQT.cpp \
@USE_QUICKTIME_TRUE@ import/ImportQT.h \
@USE_QUICKTIME_TRUE@ $(NULL)
@USE_SBSMS_TRUE@am__append_42 = $(SBSMS_CFLAGS)
@ -432,18 +429,16 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
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/ImportFLAC.h \
import/ImportForwards.h import/ImportLOF.cpp \
import/ImportLOF.h import/ImportMP3.cpp import/ImportMP3.h \
import/ImportOGG.cpp import/ImportOGG.h import/ImportPCM.cpp \
import/ImportPCM.h import/ImportPlugin.h import/ImportRaw.cpp \
import/ImportRaw.h import/RawAudioGuess.cpp \
import/RawAudioGuess.h import/FormatClassifier.cpp \
import/FormatClassifier.h import/MultiFormatReader.cpp \
import/MultiFormatReader.h import/SpecPowerMeter.cpp \
import/SpecPowerMeter.h menus/ClipMenus.cpp \
menus/EditMenus.cpp menus/ExtraMenus.cpp menus/FileMenus.cpp \
menus/HelpMenus.cpp menus/LabelMenus.cpp \
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 \
import/RawAudioGuess.cpp import/RawAudioGuess.h \
import/FormatClassifier.cpp import/FormatClassifier.h \
import/MultiFormatReader.cpp import/MultiFormatReader.h \
import/SpecPowerMeter.cpp import/SpecPowerMeter.h \
menus/ClipMenus.cpp menus/EditMenus.cpp menus/ExtraMenus.cpp \
menus/FileMenus.cpp menus/HelpMenus.cpp menus/LabelMenus.cpp \
menus/NavigationMenus.cpp menus/PluginMenus.cpp \
menus/SelectMenus.cpp menus/ToolbarMenus.cpp \
menus/TrackMenus.cpp menus/TransportMenus.cpp \
@ -585,8 +580,7 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
effects/audiounits/AudioUnitEffect.h export/ExportFFmpeg.cpp \
export/ExportFFmpeg.h export/ExportFFmpegDialogs.cpp \
export/ExportFFmpegDialogs.h import/ImportFFmpeg.cpp \
import/ImportFFmpeg.h import/ImportGStreamer.cpp \
import/ImportGStreamer.h effects/ladspa/ladspa.h \
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 \
@ -594,7 +588,7 @@ am__audacity_SOURCES_DIST = BlockFile.cpp BlockFile.h DirManager.cpp \
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 import/ImportQT.h \
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 \
@ -1512,18 +1506,16 @@ audacity_SOURCES = $(libaudacity_la_SOURCES) AboutDialog.cpp \
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/ImportFLAC.h \
import/ImportForwards.h import/ImportLOF.cpp \
import/ImportLOF.h import/ImportMP3.cpp import/ImportMP3.h \
import/ImportOGG.cpp import/ImportOGG.h import/ImportPCM.cpp \
import/ImportPCM.h import/ImportPlugin.h import/ImportRaw.cpp \
import/ImportRaw.h import/RawAudioGuess.cpp \
import/RawAudioGuess.h import/FormatClassifier.cpp \
import/FormatClassifier.h import/MultiFormatReader.cpp \
import/MultiFormatReader.h import/SpecPowerMeter.cpp \
import/SpecPowerMeter.h menus/ClipMenus.cpp \
menus/EditMenus.cpp menus/ExtraMenus.cpp menus/FileMenus.cpp \
menus/HelpMenus.cpp menus/LabelMenus.cpp \
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 \
import/RawAudioGuess.cpp import/RawAudioGuess.h \
import/FormatClassifier.cpp import/FormatClassifier.h \
import/MultiFormatReader.cpp import/MultiFormatReader.h \
import/SpecPowerMeter.cpp import/SpecPowerMeter.h \
menus/ClipMenus.cpp menus/EditMenus.cpp menus/ExtraMenus.cpp \
menus/FileMenus.cpp menus/HelpMenus.cpp menus/LabelMenus.cpp \
menus/NavigationMenus.cpp menus/PluginMenus.cpp \
menus/SelectMenus.cpp menus/ToolbarMenus.cpp \
menus/TrackMenus.cpp menus/TransportMenus.cpp \

View File

@ -38,6 +38,8 @@ and ImportLOF.cpp.
#include "../Audacity.h" // for USE_* macros
#include "Import.h"
#include "ImportPlugin.h"
#include <algorithm>
#include <wx/textctrl.h>
@ -51,14 +53,6 @@ and ImportLOF.cpp.
#include "../Project.h"
#include "../WaveTrack.h"
#include "ImportPCM.h"
#include "ImportMP3.h"
#include "ImportOGG.h"
#include "ImportQT.h"
#include "ImportLOF.h"
#include "ImportFLAC.h"
#include "ImportFFmpeg.h"
#include "ImportGStreamer.h"
#include "../Prefs.h"
#include "../widgets/ProgressDialog.h"
@ -83,30 +77,52 @@ Importer::~Importer()
{
}
ImportPluginList &Importer::sImportPluginList()
{
static ImportPluginList theList;
return theList;
}
Importer::RegisteredImportPlugin::RegisteredImportPlugin(
std::unique_ptr<ImportPlugin> pPlugin )
{
if ( pPlugin )
sImportPluginList().emplace_back( std::move( pPlugin ) );
}
UnusableImportPluginList &Importer::sUnusableImportPluginList()
{
static UnusableImportPluginList theList;
return theList;
}
Importer::RegisteredUnusableImportPlugin::RegisteredUnusableImportPlugin(
std::unique_ptr<UnusableImportPlugin> pPlugin )
{
if ( pPlugin )
sUnusableImportPluginList().emplace_back( std::move( pPlugin ) );
}
bool Importer::Initialize()
{
ImportPluginList{}.swap(mImportPluginList);
UnusableImportPluginList{}.swap(mUnusableImportPluginList);
ExtImportItems{}.swap(mExtImportItems);
// build the list of import plugin and/or unusableImporters.
// order is significant. If none match, they will all be tried
// in the order defined here.
GetPCMImportPlugin(mImportPluginList, mUnusableImportPluginList);
GetOGGImportPlugin(mImportPluginList, mUnusableImportPluginList);
GetFLACImportPlugin(mImportPluginList, mUnusableImportPluginList);
GetMP3ImportPlugin(mImportPluginList, mUnusableImportPluginList);
GetLOFImportPlugin(mImportPluginList, mUnusableImportPluginList);
#if defined(USE_FFMPEG)
GetFFmpegImportPlugin(mImportPluginList, mUnusableImportPluginList);
#endif
#ifdef USE_QUICKTIME
GetQTImportPlugin(mImportPluginList, mUnusableImportPluginList);
#endif
#if defined(USE_GSTREAMER)
GetGStreamerImportPlugin(mImportPluginList, mUnusableImportPluginList);
#endif
// They were pushed on the array at static initialization time in an
// unspecified sequence. Sort according to the sequence numbers they
// report to make the order determinate.
auto &list = sImportPluginList();
std::sort( list.begin(), list.end(),
[]( const ImportPluginList::value_type &a,
const ImportPluginList::value_type &b ){
return a->SequenceNumber() < b->SequenceNumber();
}
);
// Ordering of the unusable plugin list is not important.
ExtImportItems{}.swap(mExtImportItems);
ReadImportItems();
@ -116,15 +132,13 @@ bool Importer::Initialize()
bool Importer::Terminate()
{
WriteImportItems();
ImportPluginList{}.swap( mImportPluginList );
UnusableImportPluginList{}.swap( mUnusableImportPluginList );
return true;
}
void Importer::GetSupportedImportFormats(FormatList *formatList)
{
for(const auto &importPlugin : mImportPluginList)
for(const auto &importPlugin : sImportPluginList())
{
formatList->emplace_back(importPlugin->GetPluginFormatDescription(),
importPlugin->GetSupportedExtensions());
@ -206,7 +220,7 @@ void Importer::ReadImportItems()
for (size_t i = 0; i < new_item->filters.size(); i++)
{
bool found = false;
for (const auto &importPlugin : mImportPluginList)
for (const auto &importPlugin : sImportPluginList())
{
if (importPlugin->GetPluginStringID() == new_item->filters[i])
{
@ -220,7 +234,7 @@ void Importer::ReadImportItems()
new_item->filter_objects.push_back(nullptr);
}
/* Find all filter objects that are not present in the filter list */
for (const auto &importPlugin : mImportPluginList)
for (const auto &importPlugin : sImportPluginList())
{
bool found = false;
for (size_t i = 0; i < new_item->filter_objects.size(); i++)
@ -317,7 +331,7 @@ std::unique_ptr<ExtImportItem> Importer::CreateDefaultImportItem()
new_item->extensions.push_back(wxT("*"));
new_item->mime_types.push_back(wxT("*"));
for (const auto &importPlugin : mImportPluginList)
for (const auto &importPlugin : sImportPluginList())
{
new_item->filters.push_back(importPlugin->GetPluginStringID());
new_item->filter_objects.push_back(importPlugin.get());
@ -371,7 +385,7 @@ bool Importer::Import(const FilePath &fName,
if (usersSelectionOverrides)
{
for (const auto &plugin : mImportPluginList)
for (const auto &plugin : sImportPluginList())
{
if (plugin->GetPluginFormatDescription().CompareTo(type) == 0)
{
@ -441,16 +455,16 @@ bool Importer::Import(const FilePath &fName,
// Add all plugins that support the extension
// Here we rely on the fact that the first plugin in mImportPluginList is libsndfile.
// Here we rely on the fact that the first plugin in sImportPluginList() is libsndfile.
// We want to save this for later insertion ahead of libmad, if libmad supports the extension.
// The order of plugins in mImportPluginList is determined by the Importer constructor alone and
// The order of plugins in sImportPluginList() is determined by the Importer constructor alone and
// is not changed by user selection overrides or any other mechanism, but we include an assert
// in case subsequent code revisions to the constructor should break this assumption that
// libsndfile is first.
ImportPlugin *libsndfilePlugin = mImportPluginList.begin()->get();
ImportPlugin *libsndfilePlugin = sImportPluginList().begin()->get();
wxASSERT(libsndfilePlugin->GetPluginStringID() == wxT("libsndfile"));
for (const auto &plugin : mImportPluginList)
for (const auto &plugin : sImportPluginList())
{
// Make sure its not already in the list
if (importPlugins.end() ==
@ -486,7 +500,7 @@ bool Importer::Import(const FilePath &fName,
// Otherwise, if FFmpeg (libav) has not been installed, libmad will still be there near the
// end of the preference list importPlugins, where it will claim success importing FFmpeg file
// formats unsuitable for it, and produce distorted results.
for (const auto &plugin : mImportPluginList)
for (const auto &plugin : sImportPluginList())
{
if (!(plugin->GetPluginStringID() == wxT("libmad")))
{
@ -565,7 +579,7 @@ bool Importer::Import(const FilePath &fName,
// None of our plugins can handle this file. It might be that
// Audacity supports this format, but support was not compiled in.
// If so, notify the user of this fact
for (const auto &unusableImportPlugin : mUnusableImportPluginList)
for (const auto &unusableImportPlugin : sUnusableImportPluginList())
{
if( unusableImportPlugin->SupportsExtension(extension) )
{

View File

@ -88,6 +88,19 @@ class ExtImportItem
class Importer {
public:
// Objects of this type are statically constructed in files implementing
// subclasses of ImportPlugin
struct RegisteredImportPlugin{
RegisteredImportPlugin( std::unique_ptr<ImportPlugin> );
};
// Objects of this type are statically constructed in files, to identify
// unsupported import formats; typically in a conditional compilation
struct RegisteredUnusableImportPlugin{
RegisteredUnusableImportPlugin( std::unique_ptr<UnusableImportPlugin> );
};
Importer();
~Importer();
@ -148,8 +161,8 @@ private:
static Importer mInstance;
ExtImportItems mExtImportItems;
ImportPluginList mImportPluginList;
UnusableImportPluginList mUnusableImportPluginList;
static ImportPluginList &sImportPluginList();
static UnusableImportPluginList &sUnusableImportPluginList();
};
//----------------------------------------------------------------------------

View File

@ -21,7 +21,6 @@ Licensed under the GNU General Public License v2 or later
*//*******************************************************************/
#include "../Audacity.h" // needed before FFmpeg.h // for USE_* macros
#include "ImportFFmpeg.h"
#include "../Experimental.h"
@ -152,6 +151,7 @@ static const auto exts = {
};
// all the includes live here by default
#include "Import.h"
#include "../Tags.h"
#include "../WaveTrack.h"
#include "ImportPlugin.h"
@ -182,6 +182,8 @@ public:
///! Probes the file and opens it if appropriate
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override;
};
///! Does acual import, returned by FFmpegImportPlugin::Open
@ -282,13 +284,6 @@ private:
};
void GetFFmpegImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &WXUNUSED(unusableImportPluginList))
{
importPluginList.push_back( std::make_unique<FFmpegImportPlugin>() );
}
wxString FFmpegImportPlugin::GetPluginFormatDescription()
{
return DESC;
@ -336,6 +331,15 @@ std::unique_ptr<ImportFileHandle> FFmpegImportPlugin::Open(const FilePath &filen
return std::move(handle);
}
unsigned FFmpegImportPlugin::SequenceNumber() const
{
return 60;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< FFmpegImportPlugin >()
};
FFmpegImportFileHandle::FFmpegImportFileHandle(const FilePath & name)
: ImportFileHandle(name)

View File

@ -1,19 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportFFmpeg.h
LRN
**********************************************************************/
#ifndef __AUDACITY_IMPORT_FFMPEG__
#define __AUDACITY_IMPORT_FFMPEG__
#include "ImportForwards.h"
void GetFFmpegImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -23,7 +23,6 @@
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportFLAC.h"
#include "../Experimental.h"
@ -39,6 +38,7 @@
#include <wx/intl.h> // needed for _("translated stings") even if we
// don't have libflac available
#include "Import.h"
#include "ImportPlugin.h"
#include "../Tags.h"
@ -56,14 +56,10 @@ static const auto exts = {
#ifndef USE_LIBFLAC
void GetFLACImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList)
{
unusableImportPluginList.push_back(
static Importer::RegisteredUnusableImportPlugin registered{
std::make_unique<UnusableImportPlugin>
(DESC, FileExtensions( exts.begin(), exts.end() ) )
);
}
};
#else /* USE_LIBFLAC */
@ -138,6 +134,8 @@ class FLACImportPlugin final : public ImportPlugin
wxString GetPluginStringID() override { return wxT("libflac"); }
wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override;
};
@ -285,14 +283,6 @@ FLAC__StreamDecoderWriteStatus MyFLACFile::write_callback(const FLAC__Frame *fra
}, MakeSimpleGuard(FLAC__STREAM_DECODER_WRITE_STATUS_ABORT) );
}
void GetFLACImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &WXUNUSED(unusableImportPluginList))
{
importPluginList.push_back( std::make_unique<FLACImportPlugin>() );
}
wxString FLACImportPlugin::GetPluginFormatDescription()
{
return DESC;
@ -340,6 +330,14 @@ std::unique_ptr<ImportFileHandle> FLACImportPlugin::Open(const FilePath &filenam
return std::move(handle);
}
unsigned FLACImportPlugin::SequenceNumber() const
{
return 30;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< FLACImportPlugin >()
};
FLACImportFileHandle::FLACImportFileHandle(const FilePath & name)
: ImportFileHandle(name),

View File

@ -1,20 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportFLAC.h
Sami Liedes
**********************************************************************/
#ifndef __AUDACITY_IMPORT_FLAC__
#define __AUDACITY_IMPORT_FLAC__
#include "ImportForwards.h"
void GetFLACImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -248,6 +248,8 @@ public:
///! Probes the file and opens it if appropriate
std::unique_ptr<ImportFileHandle> Open(const wxString &Filename) override;
unsigned SequenceNumber() const override;
};
// ============================================================================
@ -256,10 +258,9 @@ public:
// ----------------------------------------------------------------------------
// Instantiate GStreamerImportPlugin and add to the list of known importers
void
GetGStreamerImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
{
static
Importer::RegisteredImportPlugin{ []() -> std::unique_ptr< ImportPlugin > {
wxLogMessage(_TS("Audacity is built against GStreamer version %d.%d.%d-%d"),
GST_VERSION_MAJOR,
GST_VERSION_MINOR,
@ -281,7 +282,7 @@ GetGStreamerImportPlugin(ImportPluginList &importPluginList,
wxLogMessage(wxT("Failed to initialize GStreamer. Error %d: %s"),
error.get()->code,
wxString::FromUTF8(error.get()->message));
return;
return {};
}
guint major, minor, micro, nano;
@ -297,11 +298,11 @@ GetGStreamerImportPlugin(ImportPluginList &importPluginList,
// No supported extensions...no gstreamer plugins installed
if (plug->GetSupportedExtensions().size() == 0)
return;
return {};
// Add to list of importers
importPluginList.push_back( std::move(plug) );
}
return std::move(plug);
}() } registered;
// ============================================================================
// GStreamerImportPlugin Class
@ -1145,6 +1146,11 @@ GStreamerImportFileHandle::Import(TrackFactory *trackFactory,
return updateResult;
}
unsigned GStreamerImportPlugin::SequenceNumber() const
{
return 80;
}
// ----------------------------------------------------------------------------
// Message handlers
// ----------------------------------------------------------------------------

View File

@ -1,19 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportGStreamer.h
LRN
**********************************************************************/
#ifndef __AUDACITY_IMPORT_GSTREAMER__
#define __AUDACITY_IMPORT_GSTREAMER__
#include "ImportPlugin.h"
void GetGStreamerImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -70,7 +70,6 @@
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportLOF.h"
#include <wx/string.h>
#include <wx/utils.h>
@ -84,6 +83,7 @@
#include "../FileNames.h"
#include "../WaveTrack.h"
#include "ImportPlugin.h"
#include "Import.h"
#include "../Menus.h"
#include "../NoteTrack.h"
#include "../Project.h"
@ -116,6 +116,8 @@ public:
wxString GetPluginStringID() override { return wxT("lof"); }
wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override;
};
@ -171,12 +173,6 @@ LOFImportFileHandle::LOFImportFileHandle
{
}
void GetLOFImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
{
importPluginList.push_back( std::make_unique<LOFImportPlugin>() );
}
wxString LOFImportPlugin::GetPluginFormatDescription()
{
return DESC;
@ -272,6 +268,15 @@ ProgressResult LOFImportFileHandle::Import(
return ProgressResult::Success;
}
unsigned LOFImportPlugin::SequenceNumber() const
{
return 50;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< LOFImportPlugin >()
};
/** @brief Processes a single line from a LOF text file, doing whatever is
* indicated on the line.
*

View File

@ -1,62 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportLOF.h
David I. Murray
Supports the opening of ".lof" files which are text files that contain
a list of individual files to open in audacity in specific formats.
(In BNF) The syntax for an LOF file, denoted by <lof>:
<lof> ::= [<window> | <file> | <#>]*
<window> ::= window [<window-parameter>]* <newline>
<window-parameter> ::= offset <time> | duration <time>
<time> ::= [<digit>]+ [ . [<digit>]* ]
<file> ::= file [<file-parameter>]* <newline>
<file-parameter> ::= offset <time>
<#> ::= <comment> <newline>
EXAMPLE LOF file:
# everything following the hash character is ignored
window # an initial window command is implicit and optional
file "C:\folder1\sample1.wav" # sample1.wav is displayed
file "C:\sample2.wav" offset 5 # sample2 is displayed with a 5s offset
File "C:\sample3.wav" # sample3 is displayed with no offset
window offset 5 duration 10 # open a NEW window, zoom to display
# 10 seconds total starting at 5 (ending at 15) seconds
file "C:\sample3.wav" offset 2.5
SEMANTICS:
There are two commands: "window" creates a NEW window, and "file"
appends a track to the current window and displays the file there. The
first file is always placed in a NEW window, whether or not an initial
"window" command is given.
Commands have optional keyword parameters that may be listed in any
order. A parameter should only occur once per command. The "offset"
parameter specifies a time offset. For windows, this is the leftmost
time displayed in the window. For files, the offset is an amount by
which the file is shifted in time before display (only enabled for audio;
not midi). The offset is specified as an integer or decimal number of
seconds, and the default value is zero.
Windows may also have a "duration" parameter, which specifies how much
time should be displayed in the window. The default duration is equal
to the duration of the longest track currently displayed.
**********************************************************************/
#ifndef __AUDACITY_IMPORT_LOF__
#define __AUDACITY_IMPORT_LOF__
#include "ImportForwards.h"
void GetLOFImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -27,7 +27,6 @@
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportMP3.h"
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
@ -40,6 +39,7 @@
#include <wx/intl.h>
#include "../Prefs.h"
#include "Import.h"
#include "ImportPlugin.h"
#include "../Tags.h"
#include "../prefs/QualityPrefs.h"
@ -55,14 +55,10 @@ static const auto exts = {
#ifndef USE_LIBMAD
void GetMP3ImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList)
{
unusableImportPluginList.push_back(
static Importer::RegisteredUnusableImportPlugin registered{
std::make_unique<UnusableImportPlugin>
(DESC, FileExtensions( exts.begin(), exts.end() ) )
);
}
};
#else /* USE_LIBMAD */
@ -120,6 +116,8 @@ public:
wxString GetPluginStringID() override { return wxT("libmad"); }
wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override;
};
class MP3ImportFileHandle final : public ImportFileHandle
@ -157,12 +155,6 @@ private:
mad_decoder mDecoder;
};
void GetMP3ImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
{
importPluginList.push_back( std::make_unique<MP3ImportPlugin>() );
}
/* The MAD callbacks */
enum mad_flow input_cb(void *_data, struct mad_stream *stream);
enum mad_flow output_cb(void *_data,
@ -263,6 +255,15 @@ ProgressResult MP3ImportFileHandle::Import(
return privateData.updateResult;
}
unsigned MP3ImportPlugin::SequenceNumber() const
{
return 40;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< MP3ImportPlugin >()
};
MP3ImportFileHandle::~MP3ImportFileHandle()
{
}

View File

@ -1,19 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportMP3.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_IMPORT_MP3__
#define __AUDACITY_IMPORT_MP3__
#include "ImportForwards.h"
void GetMP3ImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -29,7 +29,6 @@
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportOGG.h"
// For compilers that support precompilation, includes "wx/wx.h".
#include <wx/wxprec.h>
@ -39,6 +38,7 @@
#endif
#include <wx/intl.h>
#include "Import.h"
#include "../Prefs.h"
#include "../Tags.h"
#include "../prefs/QualityPrefs.h"
@ -55,14 +55,10 @@ static const auto exts = {
/* BPF There is no real reason to compile without LIBVORBIS, but if you do, you will needs this header */
#include "ImportPlugin.h"
void GetOGGImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList)
{
unusableImportPluginList.push_back(
static Importer::RegisteredUnusableImportPlugin registered{
std::make_unique<UnusableImportPlugin>
(DESC, FileExtensions( exts.begin(), exts.end() ) )
);
}
};
#else /* USE_LIBVORBIS */
@ -94,6 +90,8 @@ public:
wxString GetPluginStringID() override { return wxT("liboggvorbis"); }
wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override;
};
@ -159,11 +157,6 @@ private:
sampleFormat mFormat;
};
void GetOGGImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
{
importPluginList.push_back( std::make_unique<OggImportPlugin>() );
}
wxString OggImportPlugin::GetPluginFormatDescription()
{
@ -216,6 +209,15 @@ std::unique_ptr<ImportFileHandle> OggImportPlugin::Open(const FilePath &filename
return std::make_unique<OggImportFileHandle>(filename, std::move(file), std::move(vorbisFile));
}
unsigned OggImportPlugin::SequenceNumber() const
{
return 20;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< OggImportPlugin >()
};
wxString OggImportFileHandle::GetFileDescription()
{
return DESC;

View File

@ -1,19 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportOGG.h
Joshua Haberman
**********************************************************************/
#ifndef __AUDACITY_IMPORT_OGG__
#define __AUDACITY_IMPORT_OGG__
#include "ImportForwards.h"
void GetOGGImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -20,8 +20,8 @@
*//*******************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportPCM.h"
#include "Import.h"
#include "../Tags.h"
#include <wx/wx.h>
@ -84,6 +84,8 @@ public:
wxString GetPluginStringID() override { return wxT("libsndfile"); }
wxString GetPluginFormatDescription() override;
std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) override;
unsigned SequenceNumber() const override;
};
@ -115,12 +117,6 @@ private:
sampleFormat mFormat;
};
void GetPCMImportPlugin(ImportPluginList & importPluginList,
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
{
importPluginList.push_back( std::make_unique<PCMImportPlugin>() );
}
wxString PCMImportPlugin::GetPluginFormatDescription()
{
return DESC;
@ -190,6 +186,15 @@ std::unique_ptr<ImportFileHandle> PCMImportPlugin::Open(const FilePath &filename
return std::make_unique<PCMImportFileHandle>(filename, std::move(file), info);
}
unsigned PCMImportPlugin::SequenceNumber() const
{
return 10;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< PCMImportPlugin >()
};
PCMImportFileHandle::PCMImportFileHandle(const FilePath &name,
SFFile &&file, SF_INFO info)
: ImportFileHandle(name),

View File

@ -1,20 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportPCM.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_IMPORT_PCM__
#define __AUDACITY_IMPORT_PCM__
#include "ImportForwards.h"
void GetPCMImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -40,16 +40,6 @@ been compiled or are not available in this version of Audacity. Has
enough information to identify the file extensions that would be used,
but little else.
*//****************************************************************//**
\class ImportPluginList
\brief An ImportPlugin list.
*//****************************************************************//**
\class UnusableImportPluginList
\brief An UnusableImportPlugin list.
*//*******************************************************************/
#ifndef __AUDACITY_IMPORTER__
@ -104,6 +94,8 @@ public:
// state.
virtual std::unique_ptr<ImportFileHandle> Open(const FilePath &Filename) = 0;
virtual unsigned SequenceNumber() const = 0;
virtual ~ImportPlugin() { }
protected:

View File

@ -14,8 +14,8 @@
**********************************************************************/
#include "../Audacity.h" // for USE_* macros
#include "ImportQT.h"
#include "Import.h"
#include "ImportPlugin.h"
#include "../widgets/AudacityMessageBox.h"
#include "../widgets/ProgressDialog.h"
@ -38,19 +38,17 @@ static const auto exts = {
#ifndef USE_QUICKTIME
void GetQTImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList)
{
// Bug 2068: misleading error message about QuickTime
// Bug 2068: misleading error message about QuickTime
// In 64 bit versions we cannot compile in (obsolete) QuickTime
// So don't register the QuickTime extensions, so ensuring we never report
// "This version of Audacity was not compiled with QuickTime files support"
// When attempting to import MP4 files.
// unusableImportPluginList.push_back(
// std::make_unique<UnusableImportPlugin>(DESC,
// FileExtensions( exts.begin(), exts.end() ) )
// );
}
/*
static Importer::RegisteredUnusableImportPlugin registered{
std::make_unique<UnusableImportPlugin>(DESC,
FileExtensions( exts.begin(), exts.end() ) )
};
*/
#else /* USE_QUICKTIME */
@ -126,6 +124,8 @@ class QTImportPlugin final : public ImportPlugin
wxString GetPluginFormatDescription();
std::unique_ptr<ImportFileHandle> Open(const wxString & Filename) override;
unsigned SequenceNumber() const override;
private:
bool mInitialized;
};
@ -175,12 +175,6 @@ class QTImportFileHandle final : public ImportFileHandle
Movie mMovie;
};
void GetQTImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList)
{
importPluginList.push_back( std::make_unique<QTImportPlugin>() );
}
wxString QTImportPlugin::GetPluginFormatDescription()
{
return DESC;
@ -226,6 +220,15 @@ std::unique_ptr<ImportFileHandle> QTImportPlugin::Open(const wxString & Filename
return std::make_unique<QTImportFileHandle>(Filename, theMovie);
}
unsigned QTImportPlugin::SequenceNumber() const
{
return 70;
}
static Importer::RegisteredImportPlugin registered{
std::make_unique< QTImportPlugin >()
};
wxString QTImportFileHandle::GetFileDescription()
{

View File

@ -1,19 +0,0 @@
/**********************************************************************
Audacity: A Digital Audio Editor
ImportQT.h
Joshua Haberman
**********************************************************************/
#ifndef __AUDACITY_IMPORT_QT__
#define __AUDACITY_IMPORT_QT__
#include "ImportForwards.h"
void GetQTImportPlugin(ImportPluginList &importPluginList,
UnusableImportPluginList &unusableImportPluginList);
#endif

View File

@ -543,7 +543,6 @@
<ClInclude Include="..\..\..\src\HitTestResult.h" />
<ClInclude Include="..\..\..\src\import\FormatClassifier.h" />
<ClInclude Include="..\..\..\src\import\ImportForwards.h" />
<ClInclude Include="..\..\..\src\import\ImportGStreamer.h" />
<ClInclude Include="..\..\..\src\import\MultiFormatReader.h" />
<ClInclude Include="..\..\..\src\import\SpecPowerMeter.h" />
<ClInclude Include="..\..\..\src\InconsistencyException.h" />
@ -752,13 +751,7 @@
<ClInclude Include="..\..\..\src\export\ExportOGG.h" />
<ClInclude Include="..\..\..\src\export\ExportPCM.h" />
<ClInclude Include="..\..\..\src\import\Import.h" />
<ClInclude Include="..\..\..\src\import\ImportFFmpeg.h" />
<ClInclude Include="..\..\..\src\import\ImportFLAC.h" />
<ClInclude Include="..\..\..\src\import\ImportLOF.h" />
<ClInclude Include="..\..\..\src\import\ImportMIDI.h" />
<ClInclude Include="..\..\..\src\import\ImportMP3.h" />
<ClInclude Include="..\..\..\src\import\ImportOGG.h" />
<ClInclude Include="..\..\..\src\import\ImportPCM.h" />
<ClInclude Include="..\..\..\src\import\ImportPlugin.h" />
<ClInclude Include="..\..\..\src\import\ImportRaw.h" />
<ClInclude Include="..\..\..\src\import\RawAudioGuess.h" />

View File

@ -1630,27 +1630,9 @@
<ClInclude Include="..\..\..\src\import\Import.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportFFmpeg.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportFLAC.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportLOF.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportMIDI.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportMP3.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportOGG.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportPCM.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportPlugin.h">
<Filter>src\import</Filter>
</ClInclude>
@ -1948,9 +1930,6 @@
<ClInclude Include="..\..\..\src\SseMathFuncs.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\import\ImportGStreamer.h">
<Filter>src\import</Filter>
</ClInclude>
<ClInclude Include="..\..\..\src\widgets\HelpSystem.h">
<Filter>src\widgets</Filter>
</ClInclude>