Audacity 3.2.0
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
ExportPluginRegistry Class Referencefinal

#include <ExportPluginRegistry.h>

Collaboration diagram for ExportPluginRegistry:
[legend]

Classes

class  ConstIterator
 
struct  ExportPluginRegistryItem
 
struct  RegisteredPlugin
 
struct  Traits
 

Public Types

using ExportPlugins = std::vector< std::unique_ptr< ExportPlugin > >
 
using Factory = std::function< std::unique_ptr< ExportPlugin >() >
 

Public Member Functions

 ExportPluginRegistry (ExportPluginRegistry &)=delete
 
 ExportPluginRegistry (ExportPluginRegistry &&)=delete
 
 ~ExportPluginRegistry ()
 
void Initialize ()
 
ConstIterator cbegin () const noexcept
 
ConstIterator cend () const noexcept
 
ConstIterator begin () const noexcept
 
ConstIterator end () const noexcept
 
std::tuple< ExportPlugin *, int > FindFormat (const wxString &format, bool compareWithCase=false) const
 Returns first pair of [exportPlugin, formatIndex], such that: exportPlugin->GetFormatInfo(formatIndex).format == format More...
 

Static Public Member Functions

static ExportPluginRegistryGet ()
 

Public Attributes

std::vector< bool >::const_iterator a
 

Private Member Functions

 ExportPluginRegistry ()
 

Private Attributes

ExportPlugins mPlugins
 

Detailed Description

Definition at line 13 of file ExportPluginRegistry.h.

Member Typedef Documentation

◆ ExportPlugins

using ExportPluginRegistry::ExportPlugins = std::vector<std::unique_ptr<ExportPlugin> >

Definition at line 23 of file ExportPluginRegistry.h.

◆ Factory

using ExportPluginRegistry::Factory = std::function< std::unique_ptr< ExportPlugin >() >

Definition at line 72 of file ExportPluginRegistry.h.

Constructor & Destructor Documentation

◆ ExportPluginRegistry() [1/3]

ExportPluginRegistry::ExportPluginRegistry ( )
privatedefault

◆ ExportPluginRegistry() [2/3]

ExportPluginRegistry::ExportPluginRegistry ( ExportPluginRegistry )
delete

◆ ExportPluginRegistry() [3/3]

ExportPluginRegistry::ExportPluginRegistry ( ExportPluginRegistry &&  )
delete

◆ ~ExportPluginRegistry()

ExportPluginRegistry::~ExportPluginRegistry ( )
default

Member Function Documentation

◆ begin()

ConstIterator ExportPluginRegistry::begin ( ) const
inlinenoexcept

Definition at line 100 of file ExportPluginRegistry.h.

100{ return cbegin(); }
ConstIterator cbegin() const noexcept

◆ cbegin()

ConstIterator ExportPluginRegistry::cbegin ( ) const
inlinenoexcept

Definition at line 98 of file ExportPluginRegistry.h.

98{ return { mPlugins.begin(), 0 }; }

◆ cend()

ConstIterator ExportPluginRegistry::cend ( ) const
inlinenoexcept

Definition at line 99 of file ExportPluginRegistry.h.

99{ return { mPlugins.end(), 0 }; }

◆ end()

ConstIterator ExportPluginRegistry::end ( ) const
inlinenoexcept

Definition at line 101 of file ExportPluginRegistry.h.

101{ return cend(); }
ConstIterator cend() const noexcept

◆ FindFormat()

std::tuple< ExportPlugin *, int > ExportPluginRegistry::FindFormat ( const wxString &  format,
bool  compareWithCase = false 
) const

Returns first pair of [exportPlugin, formatIndex], such that: exportPlugin->GetFormatInfo(formatIndex).format == format

Definition at line 72 of file ExportPluginRegistry.cpp.

73{
74 for(auto t: *this)
75 {
76 const auto [plugin, formatIndex] = t;
77 if(plugin->GetFormatInfo(formatIndex).format.IsSameAs(format, compareWithCase))
78 return t;
79 }
80 return {};
81}

References anonymous_namespace{ExportPCM.cpp}::format.

Referenced by ExportCommand::Apply(), anonymous_namespace{FileMenus.cpp}::DoExport(), and TimerRecordDialog::ExecutePostRecordActions().

Here is the caller graph for this function:

◆ Get()

ExportPluginRegistry & ExportPluginRegistry::Get ( )
static

◆ Initialize()

void ExportPluginRegistry::Initialize ( )

Definition at line 54 of file ExportPluginRegistry.cpp.

55{
56 using namespace Registry;
59 { {wxT(""), wxT("PCM,MP3,OGG,Opus,FLAC,WavPack,FFmpeg,MP2,CommandLine") } },
60 };
61
62 // visit the registry to collect the plug-ins properly
63 // sorted
66 [&](const ExportPluginRegistryItem &item, auto&){
67 mPlugins.emplace_back(item.mFactory()); },
69}
wxT("CloseDown"))
void Visit(const Visitors &visitors, const GroupItem< RegistryTraits > *pTopItem, const GroupItem< RegistryTraits > *pRegistry={}, typename RegistryTraits::ComputedItemContextType &computedItemContext=RegistryTraits::ComputedItemContextType::Instance)
Definition: Registry.h:609
static Registry::GroupItem< Traits > & Registry()

References ExportPluginRegistry::ExportPluginRegistryItem::mFactory, mPlugins, anonymous_namespace{ExportPluginRegistry.cpp}::PathStart, ExportPluginRegistry::ExportPluginRegistryItem::Registry(), Registry::Visit(), and wxT().

Referenced by AudacityApp::InitPart2().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ a

std::vector<bool>::const_iterator ExportPluginRegistry::a

Definition at line 21 of file ExportPluginRegistry.h.

◆ mPlugins

ExportPlugins ExportPluginRegistry::mPlugins
private

Definition at line 119 of file ExportPluginRegistry.h.

Referenced by Initialize().


The documentation for this class was generated from the following files: