Audacity  3.0.3
Classes | Functions | Variables
anonymous_namespace{EffectsPrefs.cpp} Namespace Reference

Classes

struct  Entry
 

Functions

static const std::vector< Entry > & GetModuleData ()
 

Variables

const std::map< wxString, TranslatableStringSuggestedPrompts
 
PrefsPanel::Registration sAttachment
 

Function Documentation

◆ GetModuleData()

static const std::vector< Entry >& anonymous_namespace{EffectsPrefs.cpp}::GetModuleData ( )
static

Definition at line 135 of file EffectsPrefs.cpp.

136 {
137  struct ModuleData : public std::vector< Entry > {
138  ModuleData() {
139  auto &pm = PluginManager::Get();
140  for (auto &plug : pm.PluginsOfType(PluginTypeModule)) {
141  auto internal = plug.GetEffectFamily();
142  if ( internal.empty() )
143  continue;
144 
145  TranslatableString prompt;
146  auto iter = SuggestedPrompts.find( internal );
147  if ( iter == SuggestedPrompts.end() )
148  // For the built-in modules this Msgid includes " Effects",
149  // but those strings were never shown to the user,
150  // and the prompts in the table above do not include it.
151  // If there should be new modules, it is not important for them
152  // to follow the " Effects" convention, but instead they can
153  // have shorter msgids.
154  prompt = plug.GetSymbol().Msgid();
155  else
156  prompt = iter->second;
157 
158  auto setting = pm.GetPluginEnabledSetting( plug );
159 
160  push_back( { prompt, setting } );
161  }
162  // Guarantee some determinate ordering
163  std::sort( begin(), end(),
164  []( const Entry &a, const Entry &b ){
165  return a.setting < b.setting;
166  }
167  );
168  }
169  };
170  static ModuleData theData;
171  return theData;
172 }

References PluginManager::Get(), PluginTypeModule, anonymous_namespace{EffectsPrefs.cpp}::Entry::setting, and SuggestedPrompts.

Referenced by EffectsPrefs::PopulateOrExchange().

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

Variable Documentation

◆ sAttachment

PrefsPanel::Registration anonymous_namespace{EffectsPrefs.cpp}::sAttachment
Initial value:
{ "Effects",
[](wxWindow *parent, wxWindowID winid, AudacityProject *)
{
wxASSERT(parent);
return safenew EffectsPrefs(parent, winid);
}
}

Definition at line 250 of file EffectsPrefs.cpp.

◆ SuggestedPrompts

const std::map< wxString, TranslatableString > anonymous_namespace{EffectsPrefs.cpp}::SuggestedPrompts
Initial value:
{
{ wxT("AudioUnit"), XXO("Audio Unit") },
{ wxT("LADSPA"), XXO("&LADSPA") },
{ wxT("LV2"), XXO("LV&2") },
{ wxT("Nyquist"), XXO("N&yquist") },
{ wxT("Vamp"), XXO("&Vamp") },
{ wxT("VST"), XXO("V&ST") },
}

Definition at line 100 of file EffectsPrefs.cpp.

Referenced by GetModuleData().

TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
anonymous_namespace{EffectsPrefs.cpp}::SuggestedPrompts
const std::map< wxString, TranslatableString > SuggestedPrompts
Definition: EffectsPrefs.cpp:100
Entry
Definition: EditToolBar.cpp:225
XXO
#define XXO(s)
Definition: Internat.h:44
PluginTypeModule
@ PluginTypeModule
Definition: PluginManager.h:39
PluginManager::Get
static PluginManager & Get()
Definition: PluginManager.cpp:695
EffectsPrefs
A PrefsPanel for general GUI preferences.
Definition: EffectsPrefs.h:26
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
safenew
#define safenew
Definition: MemoryX.h:10