mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-13 22:21:11 +02:00
Pass containers by ref to import plugin factories, use STL idiom
This commit is contained in:
@@ -101,20 +101,20 @@ bool Importer::Initialize()
|
|||||||
// build the list of import plugin and/or unusableImporters.
|
// build the list of import plugin and/or unusableImporters.
|
||||||
// order is significant. If none match, they will all be tried
|
// order is significant. If none match, they will all be tried
|
||||||
// in the order defined here.
|
// in the order defined here.
|
||||||
GetPCMImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetPCMImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
GetOGGImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetOGGImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
GetFLACImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetFLACImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
GetMP3ImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetMP3ImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
GetLOFImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetLOFImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
|
|
||||||
#if defined(USE_FFMPEG)
|
#if defined(USE_FFMPEG)
|
||||||
GetFFmpegImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetFFmpegImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_QUICKTIME
|
#ifdef USE_QUICKTIME
|
||||||
GetQTImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetQTImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
#endif
|
#endif
|
||||||
#if defined(USE_GSTREAMER)
|
#if defined(USE_GSTREAMER)
|
||||||
GetGStreamerImportPlugin(mImportPluginList, mUnusableImportPluginList);
|
GetGStreamerImportPlugin(*mImportPluginList, *mUnusableImportPluginList);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ReadImportItems();
|
ReadImportItems();
|
||||||
|
@@ -283,10 +283,10 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
void GetFFmpegImportPlugin(ImportPluginList *importPluginList,
|
void GetFFmpegImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList &WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
importPluginList->Append(new FFmpegImportPlugin);
|
importPluginList.push_back( new FFmpegImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -13,7 +13,7 @@ LRN
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetFFmpegImportPlugin(ImportPluginList *importPluginList,
|
void GetFFmpegImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -56,13 +56,13 @@ static const wxChar *exts[] =
|
|||||||
|
|
||||||
#ifndef USE_LIBFLAC
|
#ifndef USE_LIBFLAC
|
||||||
|
|
||||||
void GetFLACImportPlugin(ImportPluginList *importPluginList,
|
void GetFLACImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList)
|
UnusableImportPluginList &unusableImportPluginList)
|
||||||
{
|
{
|
||||||
UnusableImportPlugin* flacIsUnsupported =
|
UnusableImportPlugin* flacIsUnsupported =
|
||||||
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
||||||
|
|
||||||
unusableImportPluginList->Append(flacIsUnsupported);
|
unusableImportPluginList.push_back( flacIsUnsupported );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* USE_LIBFLAC */
|
#else /* USE_LIBFLAC */
|
||||||
@@ -282,10 +282,10 @@ FLAC__StreamDecoderWriteStatus MyFLACFile::write_callback(const FLAC__Frame *fra
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void GetFLACImportPlugin(ImportPluginList *importPluginList,
|
void GetFLACImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList &WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
importPluginList->Append(new FLACImportPlugin);
|
importPluginList.push_back( new FLACImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetFLACImportPlugin(ImportPluginList *importPluginList,
|
void GetFLACImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -261,8 +261,8 @@ public:
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Instantiate GStreamerImportPlugin and add to the list of known importers
|
// Instantiate GStreamerImportPlugin and add to the list of known importers
|
||||||
void
|
void
|
||||||
GetGStreamerImportPlugin(ImportPluginList *importPluginList,
|
GetGStreamerImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList * WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
wxLogMessage(wxT("Audacity is built against GStreamer version %d.%d.%d-%d"),
|
wxLogMessage(wxT("Audacity is built against GStreamer version %d.%d.%d-%d"),
|
||||||
GST_VERSION_MAJOR,
|
GST_VERSION_MAJOR,
|
||||||
@@ -300,7 +300,7 @@ GetGStreamerImportPlugin(ImportPluginList *importPluginList,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Add to list of importers
|
// Add to list of importers
|
||||||
importPluginList->push_back(std::move(plug));
|
importPluginList.push_back( plug.release() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@@ -13,7 +13,7 @@ LRN
|
|||||||
|
|
||||||
#include "ImportPlugin.h"
|
#include "ImportPlugin.h"
|
||||||
|
|
||||||
void GetGStreamerImportPlugin(ImportPluginList *importPluginList,
|
void GetGStreamerImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -175,10 +175,10 @@ LOFImportFileHandle::LOFImportFileHandle
|
|||||||
scrollOffset = 0;
|
scrollOffset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetLOFImportPlugin(ImportPluginList *importPluginList,
|
void GetLOFImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList * WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
importPluginList->Append(new LOFImportPlugin);
|
importPluginList.push_back( new LOFImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString LOFImportPlugin::GetPluginFormatDescription()
|
wxString LOFImportPlugin::GetPluginFormatDescription()
|
||||||
|
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetLOFImportPlugin(ImportPluginList *importPluginList,
|
void GetLOFImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -56,13 +56,13 @@ static const wxChar *exts[] =
|
|||||||
|
|
||||||
#ifndef USE_LIBMAD
|
#ifndef USE_LIBMAD
|
||||||
|
|
||||||
void GetMP3ImportPlugin(ImportPluginList *importPluginList,
|
void GetMP3ImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList)
|
UnusableImportPluginList &unusableImportPluginList)
|
||||||
{
|
{
|
||||||
UnusableImportPlugin* mp3IsUnsupported =
|
UnusableImportPlugin* mp3IsUnsupported =
|
||||||
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
||||||
|
|
||||||
unusableImportPluginList->Append(mp3IsUnsupported);
|
unusableImportPluginList.push_back( mp3IsUnsupported );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* USE_LIBMAD */
|
#else /* USE_LIBMAD */
|
||||||
@@ -153,10 +153,10 @@ private:
|
|||||||
mad_decoder mDecoder;
|
mad_decoder mDecoder;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetMP3ImportPlugin(ImportPluginList *importPluginList,
|
void GetMP3ImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList * WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
importPluginList->Append(new MP3ImportPlugin);
|
importPluginList.push_back( new MP3ImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The MAD callbacks */
|
/* The MAD callbacks */
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetMP3ImportPlugin(ImportPluginList *importPluginList,
|
void GetMP3ImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -55,13 +55,13 @@ static const wxChar *exts[] =
|
|||||||
/* BPF There is no real reason to compile without LIBVORBIS, but if you do, you will needs this header */
|
/* BPF There is no real reason to compile without LIBVORBIS, but if you do, you will needs this header */
|
||||||
#include "ImportPlugin.h"
|
#include "ImportPlugin.h"
|
||||||
|
|
||||||
void GetOGGImportPlugin(ImportPluginList *importPluginList,
|
void GetOGGImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList)
|
UnusableImportPluginList &unusableImportPluginList)
|
||||||
{
|
{
|
||||||
UnusableImportPlugin* oggIsUnsupported =
|
UnusableImportPlugin* oggIsUnsupported =
|
||||||
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
||||||
|
|
||||||
unusableImportPluginList->Append(oggIsUnsupported);
|
unusableImportPluginList.push_back( oggIsUnsupported );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* USE_LIBVORBIS */
|
#else /* USE_LIBVORBIS */
|
||||||
@@ -160,10 +160,10 @@ private:
|
|||||||
sampleFormat mFormat;
|
sampleFormat mFormat;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetOGGImportPlugin(ImportPluginList *importPluginList,
|
void GetOGGImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList * WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
importPluginList->Append(new OggImportPlugin);
|
importPluginList.push_back( new OggImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString OggImportPlugin::GetPluginFormatDescription()
|
wxString OggImportPlugin::GetPluginFormatDescription()
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetOGGImportPlugin(ImportPluginList *importPluginList,
|
void GetOGGImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -113,10 +113,10 @@ private:
|
|||||||
sampleFormat mFormat;
|
sampleFormat mFormat;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetPCMImportPlugin(ImportPluginList * importPluginList,
|
void GetPCMImportPlugin(ImportPluginList & importPluginList,
|
||||||
UnusableImportPluginList * WXUNUSED(unusableImportPluginList))
|
UnusableImportPluginList & WXUNUSED(unusableImportPluginList))
|
||||||
{
|
{
|
||||||
importPluginList->Append(new PCMImportPlugin);
|
importPluginList.push_back( new PCMImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString PCMImportPlugin::GetPluginFormatDescription()
|
wxString PCMImportPlugin::GetPluginFormatDescription()
|
||||||
|
@@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetPCMImportPlugin(ImportPluginList *importPluginList,
|
void GetPCMImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -27,13 +27,13 @@ static const wxChar *exts[] =
|
|||||||
|
|
||||||
#ifndef USE_QUICKTIME
|
#ifndef USE_QUICKTIME
|
||||||
|
|
||||||
void GetQTImportPlugin(ImportPluginList *importPluginList,
|
void GetQTImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList)
|
UnusableImportPluginList &unusableImportPluginList)
|
||||||
{
|
{
|
||||||
UnusableImportPlugin* qtIsUnsupported =
|
UnusableImportPlugin* qtIsUnsupported =
|
||||||
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
new UnusableImportPlugin(DESC, wxArrayString(WXSIZEOF(exts), exts));
|
||||||
|
|
||||||
unusableImportPluginList->Append(qtIsUnsupported);
|
unusableImportPluginList.push_back( qtIsUnsupported );
|
||||||
}
|
}
|
||||||
|
|
||||||
#else /* USE_QUICKTIME */
|
#else /* USE_QUICKTIME */
|
||||||
@@ -162,10 +162,10 @@ class QTImportFileHandle final : public ImportFileHandle
|
|||||||
Movie mMovie;
|
Movie mMovie;
|
||||||
};
|
};
|
||||||
|
|
||||||
void GetQTImportPlugin(ImportPluginList *importPluginList,
|
void GetQTImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList)
|
UnusableImportPluginList &unusableImportPluginList)
|
||||||
{
|
{
|
||||||
importPluginList->Append(new QTImportPlugin);
|
importPluginList.push_back( new QTImportPlugin );
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString QTImportPlugin::GetPluginFormatDescription()
|
wxString QTImportPlugin::GetPluginFormatDescription()
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
#include "ImportForwards.h"
|
#include "ImportForwards.h"
|
||||||
|
|
||||||
void GetQTImportPlugin(ImportPluginList *importPluginList,
|
void GetQTImportPlugin(ImportPluginList &importPluginList,
|
||||||
UnusableImportPluginList *unusableImportPluginList);
|
UnusableImportPluginList &unusableImportPluginList);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user