Audacity  3.0.3
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
PluginManager Class Referencefinal

PluginManager maintains a list of all plug ins. That covers modules, effects, generators, analysis-effects, commands. It also has functions for shared and private configs - which need to move out. More...

#include <PluginManager.h>

Inheritance diagram for PluginManager:
[legend]
Collaboration diagram for PluginManager:
[legend]

Public Member Functions

RegistryPath GetPluginEnabledSetting (const PluginID &ID)
 
RegistryPath GetPluginEnabledSetting (const PluginDescriptor &desc)
 
bool IsPluginRegistered (const PluginPath &path) override
 
const PluginIDRegisterPlugin (ModuleInterface *module) override
 
const PluginIDRegisterPlugin (ModuleInterface *provider, ComponentInterface *command)
 
const PluginIDRegisterPlugin (ModuleInterface *provider, EffectDefinitionInterface *effect, int type) override
 
const PluginIDRegisterPlugin (ModuleInterface *provider, ImporterInterface *importer) override
 
void FindFilesInPathList (const wxString &pattern, const FilePaths &pathList, FilePaths &files, bool directories=false) override
 
bool HasSharedConfigGroup (const PluginID &ID, const RegistryPath &group)
 
bool GetSharedConfigSubgroups (const PluginID &ID, const RegistryPath &group, RegistryPaths &subgroups) override
 
bool GetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval=_T("")) override
 
bool GetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, int &value, int defval=0) override
 
bool GetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, bool &value, bool defval=false) override
 
bool GetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, float &value, float defval=0.0) override
 
bool GetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, double &value, double defval=0.0) override
 
bool SetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const wxString &value) override
 
bool SetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const int &value) override
 
bool SetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const bool &value) override
 
bool SetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const float &value) override
 
bool SetSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const double &value) override
 
bool RemoveSharedConfigSubgroup (const PluginID &ID, const RegistryPath &group) override
 
bool RemoveSharedConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key) override
 
bool HasPrivateConfigGroup (const PluginID &ID, const RegistryPath &group)
 
bool GetPrivateConfigSubgroups (const PluginID &ID, const RegistryPath &group, RegistryPaths &subgroups) override
 
bool GetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, wxString &value, const wxString &defval=_T("")) override
 
bool GetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, int &value, int defval=0) override
 
bool GetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, bool &value, bool defval=false) override
 
bool GetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, float &value, float defval=0.0) override
 
bool GetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, double &value, double defval=0.0) override
 
bool SetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const wxString &value) override
 
bool SetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const int &value) override
 
bool SetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const bool &value) override
 
bool SetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const float &value) override
 
bool SetPrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key, const double &value) override
 
bool RemovePrivateConfigSubgroup (const PluginID &ID, const RegistryPath &group) override
 
bool RemovePrivateConfig (const PluginID &ID, const RegistryPath &group, const RegistryPath &key) override
 
void Initialize ()
 
void Terminate ()
 
bool DropFile (const wxString &fileName)
 
int GetPluginCount (PluginType type)
 
const PluginDescriptorGetPlugin (const PluginID &ID)
 
const PluginDescriptorGetFirstPlugin (int type)
 
const PluginDescriptorGetNextPlugin (int type)
 
const PluginDescriptorGetFirstPluginForEffectType (EffectType type)
 
const PluginDescriptorGetNextPluginForEffectType (EffectType type)
 
bool IsPluginEnabled (const PluginID &ID)
 
void EnablePlugin (const PluginID &ID, bool enable)
 
const ComponentInterfaceSymbolGetSymbol (const PluginID &ID)
 
ComponentInterfaceGetInstance (const PluginID &ID)
 
void CheckForUpdates (bool bFast=false)
 
bool ShowManager (wxWindow *parent, EffectType type=EffectTypeNone)
 
const PluginIDRegisterPlugin (EffectDefinitionInterface *effect, PluginType type)
 
void UnregisterPlugin (const PluginID &ID)
 

Static Public Member Functions

static PluginManagerGet ()
 
static PluginID GetID (ModuleInterface *module)
 
static PluginID GetID (ComponentInterface *command)
 
static PluginID GetID (EffectDefinitionInterface *effect)
 
static PluginID GetID (ImporterInterface *importer)
 
static wxString GetPluginTypeString (PluginType type)
 
- Static Public Member Functions inherited from PluginManagerInterface
static const PluginIDDefaultRegistrationCallback (ModuleInterface *provider, ComponentInterface *ident)
 
static const PluginIDAudacityCommandRegistrationCallback (ModuleInterface *provider, ComponentInterface *ident)
 

Private Member Functions

 PluginManager ()
 
 ~PluginManager ()
 
void Load ()
 
void LoadGroup (FileConfig *pRegistry, PluginType type)
 
void Save ()
 
void SaveGroup (FileConfig *pRegistry, PluginType type)
 
PluginDescriptorCreatePlugin (const PluginID &id, ComponentInterface *ident, PluginType type)
 
FileConfigGetSettings ()
 
bool HasGroup (const RegistryPath &group)
 
bool GetSubgroups (const RegistryPath &group, RegistryPaths &subgroups)
 
bool GetConfig (const RegistryPath &key, wxString &value, const wxString &defval=L"")
 
bool GetConfig (const RegistryPath &key, int &value, int defval=0)
 
bool GetConfig (const RegistryPath &key, bool &value, bool defval=false)
 
bool GetConfig (const RegistryPath &key, float &value, float defval=0.0)
 
bool GetConfig (const RegistryPath &key, double &value, double defval=0.0)
 
bool SetConfig (const RegistryPath &key, const wxString &value)
 
bool SetConfig (const RegistryPath &key, const int &value)
 
bool SetConfig (const RegistryPath &key, const bool &value)
 
bool SetConfig (const RegistryPath &key, const float &value)
 
bool SetConfig (const RegistryPath &key, const double &value)
 
RegistryPath SettingsPath (const PluginID &ID, bool shared)
 
RegistryPath SharedGroup (const PluginID &ID, const RegistryPath &group)
 
RegistryPath SharedKey (const PluginID &ID, const RegistryPath &group, const RegistryPath &key)
 
RegistryPath PrivateGroup (const PluginID &ID, const RegistryPath &group)
 
RegistryPath PrivateKey (const PluginID &ID, const RegistryPath &group, const RegistryPath &key)
 
wxString ConvertID (const PluginID &ID)
 
wxString b64encode (const void *in, int len)
 
int b64decode (const wxString &in, void *out)
 
bool IsDirty ()
 
void SetDirty (bool dirty=true)
 

Private Attributes

std::unique_ptr< FileConfigmSettings
 
bool mDirty
 
int mCurrentIndex
 
PluginMap mPlugins
 
PluginMap::iterator mPluginsIter
 

Static Private Attributes

static std::unique_ptr< PluginManagermInstance {}
 

Friends

class PluginRegistrationDialog
 

Detailed Description

PluginManager maintains a list of all plug ins. That covers modules, effects, generators, analysis-effects, commands. It also has functions for shared and private configs - which need to move out.

Definition at line 171 of file PluginManager.h.

Constructor & Destructor Documentation

◆ PluginManager()

PluginManager::PluginManager ( )
private

Definition at line 1739 of file PluginManager.cpp.

1740 {
1741  mSettings = NULL;
1742 }

References mSettings.

◆ ~PluginManager()

PluginManager::~PluginManager ( )
private

Definition at line 1744 of file PluginManager.cpp.

1745 {
1746  // Ensure termination (harmless if already done)
1747  Terminate();
1748 }

References Terminate().

Here is the call graph for this function:

Member Function Documentation

◆ b64decode()

int PluginManager::b64decode ( const wxString &  in,
void *  out 
)
private

Definition at line 3153 of file PluginManager.cpp.

3154 {
3155  int len = in.length();
3156  unsigned char *p = (unsigned char *) out;
3157 
3158  if (len % 4) //Sanity check
3159  {
3160  return 0;
3161  }
3162 
3163  int padding = 0;
3164  if (len)
3165  {
3166  if (in[len - 1] == padc)
3167  {
3168  padding++;
3169  }
3170 
3171  if (in[len - 2] == padc)
3172  {
3173  padding++;
3174  }
3175  }
3176 
3177  //const char *a = in.mb_str();
3178  //Setup a vector to hold the result
3179  unsigned long temp = 0; //Holds decoded quanta
3180  int i = 0;
3181  while (i < len)
3182  {
3183  for (int quantumPosition = 0; quantumPosition < 4; quantumPosition++)
3184  {
3185  unsigned char c = in[i];
3186  temp <<= 6;
3187 
3188  if (c >= 0x41 && c <= 0x5A)
3189  {
3190  temp |= c - 0x41;
3191  }
3192  else if (c >= 0x61 && c <= 0x7A)
3193  {
3194  temp |= c - 0x47;
3195  }
3196  else if (c >= 0x30 && c <= 0x39)
3197  {
3198  temp |= c + 0x04;
3199  }
3200  else if (c == 0x2B)
3201  {
3202  temp |= 0x3E;
3203  }
3204  else if (c == 0x2F)
3205  {
3206  temp |= 0x3F;
3207  }
3208  else if (c == padc)
3209  {
3210  switch (len - i)
3211  {
3212  case 1: //One pad character
3213  *p++ = (temp >> 16) & 0x000000FF;
3214  *p++ = (temp >> 8) & 0x000000FF;
3215  return p - (unsigned char *) out;
3216  case 2: //Two pad characters
3217  *p++ = (temp >> 10) & 0x000000FF;
3218  return p - (unsigned char *) out;
3219  }
3220  }
3221  i++;
3222  }
3223  *p++ = (temp >> 16) & 0x000000FF;
3224  *p++ = (temp >> 8) & 0x000000FF;
3225  *p++ = temp & 0x000000FF;
3226  }
3227 
3228  return p - (unsigned char *) out;
3229 }

References padc.

Referenced by ConvertID().

Here is the caller graph for this function:

◆ b64encode()

wxString PluginManager::b64encode ( const void *  in,
int  len 
)
private

Definition at line 3113 of file PluginManager.cpp.

3114 {
3115  unsigned char *p = (unsigned char *) in;
3116  wxString out;
3117 
3118  unsigned long temp;
3119  for (int i = 0; i < len / 3; i++)
3120  {
3121  temp = (*p++) << 16; //Convert to big endian
3122  temp += (*p++) << 8;
3123  temp += (*p++);
3124  out += cset[(temp & 0x00FC0000) >> 18];
3125  out += cset[(temp & 0x0003F000) >> 12];
3126  out += cset[(temp & 0x00000FC0) >> 6];
3127  out += cset[(temp & 0x0000003F)];
3128  }
3129 
3130  switch (len % 3)
3131  {
3132  case 1:
3133  temp = (*p++) << 16; //Convert to big endian
3134  out += cset[(temp & 0x00FC0000) >> 18];
3135  out += cset[(temp & 0x0003F000) >> 12];
3136  out += padc;
3137  out += padc;
3138  break;
3139 
3140  case 2:
3141  temp = (*p++) << 16; //Convert to big endian
3142  temp += (*p++) << 8;
3143  out += cset[(temp & 0x00FC0000) >> 18];
3144  out += cset[(temp & 0x0003F000) >> 12];
3145  out += cset[(temp & 0x00000FC0) >> 6];
3146  out += padc;
3147  break;
3148  }
3149 
3150  return out;
3151 }

References cset, and padc.

Referenced by ConvertID().

Here is the caller graph for this function:

◆ CheckForUpdates()

void PluginManager::CheckForUpdates ( bool  bFast = false)

Definition at line 2388 of file PluginManager.cpp.

2389 {
2390  // Get ModuleManager reference
2392 
2393  wxArrayString pathIndex;
2394  for (PluginMap::iterator iter = mPlugins.begin(); iter != mPlugins.end(); ++iter)
2395  {
2396  PluginDescriptor & plug = iter->second;
2397 
2398  // Bypass 2.1.0 placeholders...remove this after a few releases past 2.1.0
2399  if (plug.GetPluginType() == PluginTypeNone)
2400  {
2401  continue;
2402  }
2403 
2404  pathIndex.push_back(plug.GetPath().BeforeFirst(wxT(';')));
2405  }
2406 
2407  // Check all known plugins to ensure they are still valid and scan for NEW ones.
2408  //
2409  // All NEW plugins get a stub entry created that will remain in place until the
2410  // user enables or disables the plugin.
2411  //
2412  // Because we use the plugins "path" as returned by the providers, we can actually
2413  // have multiple providers report the same path since, at this point, they only
2414  // know that the path might possibly be one supported by the provider.
2415  //
2416  // When the user enables the plugin, each provider that reported it will be asked
2417  // to register the plugin.
2418  for (PluginMap::iterator iter = mPlugins.begin(); iter != mPlugins.end(); ++iter)
2419  {
2420  PluginDescriptor & plug = iter->second;
2421  const PluginID & plugID = plug.GetID();
2422  const wxString & plugPath = plug.GetPath();
2423  PluginType plugType = plug.GetPluginType();
2424 
2425  // Bypass 2.1.0 placeholders...remove this after a few releases past 2.1.0
2426  if (plugType == PluginTypeNone)
2427  {
2428  continue;
2429  }
2430 
2431  if ( plugType == PluginTypeModule )
2432  {
2433  if( bFast )
2434  {
2435  // Skip modules, when doing a fast refresh/check.
2436  }
2437  else if (!mm.IsProviderValid(plugID, plugPath))
2438  {
2439  plug.SetEnabled(false);
2440  plug.SetValid(false);
2441  }
2442  else
2443  {
2444  // Collect plugin paths
2445  auto paths = mm.FindPluginsForProvider(plugID, plugPath);
2446  for (size_t i = 0, cnt = paths.size(); i < cnt; i++)
2447  {
2448  wxString path = paths[i].BeforeFirst(wxT(';'));;
2449  if ( ! make_iterator_range( pathIndex ).contains( path ) )
2450  {
2451  PluginID ID = plugID + wxT("_") + path;
2452  PluginDescriptor & plug2 = mPlugins[ID]; // This will create a NEW descriptor
2454  plug2.SetID(ID);
2455  plug2.SetProviderID(plugID);
2456  plug2.SetPath(path);
2457  plug2.SetEnabled(false);
2458  plug2.SetValid(false);
2459  }
2460  }
2461  }
2462  }
2463  else if (plugType != PluginTypeNone && plugType != PluginTypeStub)
2464  {
2465  plug.SetValid(mm.IsPluginValid(plug.GetProviderID(), plugPath, bFast));
2466  if (!plug.IsValid())
2467  {
2468  plug.SetEnabled(false);
2469  }
2470  }
2471  }
2472 
2473  Save();
2474 
2475  return;
2476 }

References ModuleManager::FindPluginsForProvider(), ModuleManager::Get(), PluginDescriptor::GetID(), PluginDescriptor::GetPath(), PluginDescriptor::GetPluginType(), PluginDescriptor::GetProviderID(), ModuleManager::IsPluginValid(), ModuleManager::IsProviderValid(), PluginDescriptor::IsValid(), make_iterator_range(), mPlugins, PluginTypeModule, PluginTypeNone, PluginTypeStub, Save(), PluginDescriptor::SetEnabled(), PluginDescriptor::SetID(), PluginDescriptor::SetPath(), PluginDescriptor::SetPluginType(), PluginDescriptor::SetProviderID(), and PluginDescriptor::SetValid().

Referenced by Initialize(), and ShowManager().

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

◆ ConvertID()

wxString PluginManager::ConvertID ( const PluginID ID)
private

Definition at line 3086 of file PluginManager.cpp.

3087 {
3088  if (ID.StartsWith(wxT("base64:")))
3089  {
3090  wxString id = ID.Mid(7);
3091  ArrayOf<char> buf{ id.length() / 4 * 3 };
3092  id = wxString::FromUTF8(buf.get(), b64decode(id, buf.get()));
3093  return id;
3094  }
3095 
3096  const wxCharBuffer & buf = ID.ToUTF8();
3097  return wxT("base64:") + b64encode(buf, strlen(buf));
3098 }

References b64decode(), b64encode(), and id.

Referenced by LoadGroup(), SaveGroup(), and SettingsPath().

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

◆ CreatePlugin()

PluginDescriptor & PluginManager::CreatePlugin ( const PluginID id,
ComponentInterface ident,
PluginType  type 
)
private

Definition at line 2762 of file PluginManager.cpp.

2765 {
2766  // This will either create a NEW entry or replace an existing entry
2767  PluginDescriptor & plug = mPlugins[id];
2768 
2769  plug.SetPluginType(type);
2770 
2771  plug.SetID(id);
2772  plug.SetPath(ident->GetPath());
2773  plug.SetSymbol(ident->GetSymbol());
2774  plug.SetVendor(ident->GetVendor().Internal());
2775  plug.SetVersion(ident->GetVersion());
2776 
2777  return plug;
2778 }

References ComponentInterface::GetPath(), ComponentInterface::GetSymbol(), ComponentInterface::GetVendor(), ComponentInterface::GetVersion(), id, ComponentInterfaceSymbol::Internal(), mPlugins, PluginDescriptor::SetID(), PluginDescriptor::SetPath(), PluginDescriptor::SetPluginType(), PluginDescriptor::SetSymbol(), PluginDescriptor::SetVendor(), and PluginDescriptor::SetVersion().

Referenced by RegisterPlugin().

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

◆ DropFile()

bool PluginManager::DropFile ( const wxString &  fileName)

Definition at line 1815 of file PluginManager.cpp.

1816 {
1817  auto &mm = ModuleManager::Get();
1818  const wxFileName src{ fileName };
1819 
1820  for (const PluginDescriptor *plug = GetFirstPlugin(PluginTypeModule);
1821  plug;
1823  {
1824  auto module = static_cast<ModuleInterface *>
1825  (mm.CreateProviderInstance(plug->GetID(), plug->GetPath()));
1826  if (! module)
1827  continue;
1828 
1829  const auto &ff = module->InstallPath();
1830  const auto &extensions = module->GetFileExtensions();
1831  if ( !ff.empty() &&
1832  extensions.Index(src.GetExt(), false) != wxNOT_FOUND ) {
1833  TranslatableString errMsg;
1834  // Do dry-run test of the file format
1835  unsigned nPlugIns =
1836  module->DiscoverPluginsAtPath(fileName, errMsg, {});
1837  if (nPlugIns) {
1838  // File contents are good for this module, so check no others.
1839  // All branches of this block return true, even in case of
1840  // failure for other reasons, to signal that other drag-and-drop
1841  // actions should not be tried.
1842 
1843  // Find path to copy it
1844  wxFileName dst;
1845  dst.AssignDir( ff );
1846  dst.SetFullName( src.GetFullName() );
1847  if ( dst.Exists() ) {
1848  // Query whether to overwrite
1849  bool overwrite = (wxYES == ::AudacityMessageBox(
1850  XO("Overwrite the plug-in file %s?")
1851  .Format( dst.GetFullPath() ),
1852  XO("Plug-in already exists"),
1853  wxYES_NO ) );
1854  if ( !overwrite )
1855  return true;
1856  }
1857 
1858  // Move the file or subtree
1859  bool copied = false;
1860  auto dstPath = dst.GetFullPath();
1861  if ( src.FileExists() )
1862  // A simple one-file plug-in
1863  copied = FileNames::DoCopyFile(
1864  src.GetFullPath(), dstPath, true );
1865  else {
1866  // A sub-folder
1867  // such as for some VST packages
1868  // Recursive copy needed -- to do
1869  return true;
1870  }
1871 
1872  if (!copied) {
1874  XO("Plug-in file is in use. Failed to overwrite") );
1875  return true;
1876  }
1877 
1878  // Register for real
1879  std::vector<PluginID> ids;
1880  std::vector<wxString> names;
1881  nPlugIns = module->DiscoverPluginsAtPath(dstPath, errMsg,
1882  [&](ModuleInterface *provider, ComponentInterface *ident)
1883  -> const PluginID& {
1884  // Register as by default, but also collecting the PluginIDs
1885  // and names
1887  provider, ident);
1888  ids.push_back(id);
1889  names.push_back( ident->GetSymbol().Translation() );
1890  return id;
1891  });
1892  if ( ! nPlugIns ) {
1893  // Unlikely after the dry run succeeded
1895  XO("Failed to register:\n%s").Format( errMsg ) );
1896  return true;
1897  }
1898 
1899  // Ask whether to enable the plug-ins
1900  if (auto nIds = ids.size()) {
1901  auto message = XPC(
1902  /* i18n-hint A plug-in is an optional added program for a sound
1903  effect, or generator, or analyzer */
1904  "Enable this plug-in?\n",
1905  "Enable these plug-ins?\n",
1906  0,
1907  "plug-ins"
1908  )( nIds );
1909  for (const auto &name : names)
1910  message.Join( Verbatim( name ), wxT("\n") );
1911  bool enable = (wxYES == ::AudacityMessageBox(
1912  message,
1913  XO("Enable new plug-ins"),
1914  wxYES_NO ) );
1915  for (const auto &id : ids)
1916  mPlugins[id].SetEnabled(enable);
1917  // Make changes to enabled status persist:
1918  this->Save();
1919  }
1920 
1921  return true;
1922  }
1923  }
1924  }
1925 
1926  return false;
1927 }

References AudacityMessageBox(), PluginManagerInterface::DefaultRegistrationCallback(), FileNames::DoCopyFile(), ModuleManager::Get(), GetFirstPlugin(), GetNextPlugin(), ComponentInterface::GetSymbol(), id, ModuleInterface::InstallPath(), mPlugins, name, names, PluginTypeModule, Save(), ComponentInterfaceSymbol::Translation(), Verbatim(), XO, and XPC.

Here is the call graph for this function:

◆ EnablePlugin()

void PluginManager::EnablePlugin ( const PluginID ID,
bool  enable 
)

Definition at line 2643 of file PluginManager.cpp.

2644 {
2645  if (mPlugins.find(ID) == mPlugins.end())
2646  {
2647  return;
2648  }
2649 
2650  return mPlugins[ID].SetEnabled(enable);
2651 }

References mPlugins.

◆ FindFilesInPathList()

void PluginManager::FindFilesInPathList ( const wxString &  pattern,
const FilePaths pathList,
FilePaths files,
bool  directories = false 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1505 of file PluginManager.cpp.

1509 {
1510 
1511  wxLogNull nolog;
1512 
1513  // Why bother...
1514  if (pattern.empty())
1515  {
1516  return;
1517  }
1518 
1519  // TODO: We REALLY need to figure out the "Audacity" plug-in path(s)
1520 
1521  FilePaths paths;
1522 
1523  // Add the "per-user" plug-ins directory
1524  {
1525  const wxFileName &ff = FileNames::PlugInDir();
1526  paths.push_back(ff.GetFullPath());
1527  }
1528 
1529  // Add the "Audacity" plug-ins directory
1530  wxFileName ff = PlatformCompatibility::GetExecutablePath();
1531 #if defined(__WXMAC__)
1532  // Path ends for example in "Audacity.app/Contents/MacOSX"
1533  //ff.RemoveLastDir();
1534  //ff.RemoveLastDir();
1535  // just remove the MacOSX part.
1536  ff.RemoveLastDir();
1537 #endif
1538  ff.AppendDir(wxT("plug-ins"));
1539  paths.push_back(ff.GetPath());
1540 
1541  // Weed out duplicates
1542  for (const auto &filePath : pathList)
1543  {
1544  ff = filePath;
1545  const wxString path{ ff.GetFullPath() };
1546  if (paths.Index(path, wxFileName::IsCaseSensitive()) == wxNOT_FOUND)
1547  {
1548  paths.push_back(path);
1549  }
1550  }
1551 
1552  // Find all matching files in each path
1553  for (size_t i = 0, cnt = paths.size(); i < cnt; i++)
1554  {
1555  ff = paths[i] + wxFILE_SEP_PATH + pattern;
1556  wxDir::GetAllFiles(ff.GetPath(), &files, ff.GetFullName(), directories ? wxDIR_DEFAULT : wxDIR_FILES);
1557  }
1558 
1559  return;
1560 }

References PlatformCompatibility::GetExecutablePath(), and FileNames::PlugInDir().

Here is the call graph for this function:

◆ Get()

PluginManager & PluginManager::Get ( )
static

Definition at line 1761 of file PluginManager.cpp.

1762 {
1763  if (!mInstance)
1764  {
1766  }
1767 
1768  return *mInstance;
1769 }

References mInstance, and safenew.

Referenced by anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItemGroup(), MacroCommands::ApplyEffectCommand(), PluginManagerInterface::AudacityCommandRegistrationCallback(), PluginManagerInterface::DefaultRegistrationCallback(), ModuleManager::DiscoverProviders(), MacroCommands::DoAudacityCommand(), EffectUI::DoEffect(), anonymous_namespace{PluginMenus.cpp}::DoManagePluginsMenu(), ModuleManager::FindPluginsForProvider(), EffectManager::GetAudacityCommand(), EffectManager::GetCommandIdentifier(), EffectManager::GetCommandSymbol(), EffectManager::GetEffect(), EffectManager::GetEffectByIdentifier(), anonymous_namespace{EffectsPrefs.cpp}::GetModuleData(), Effect::GetPrivateConfig(), Effect::GetPrivateConfigSubgroups(), Effect::GetSharedConfig(), Effect::GetSharedConfigSubgroups(), MacroCommands::HandleTextualCommand(), Effect::HasPrivateConfigGroup(), Effect::HasSharedConfigGroup(), ModuleManager::InitializeBuiltins(), AudacityApp::InitPart2(), MacroCommandsCatalog::MacroCommandsCatalog(), AudacityApp::OnExit(), PluginRegistrationDialog::OnOK(), ProjectFileManager::OpenFile(), anonymous_namespace{PluginMenus.cpp}::PopulateEffectsMenu(), PluginRegistrationDialog::PopulateOrExchange(), EffectManager::RegisterEffect(), Effect::RemovePrivateConfig(), Effect::RemovePrivateConfigSubgroup(), Effect::RemoveSharedConfig(), Effect::RemoveSharedConfigSubgroup(), GetInfoCommand::SendCommands(), Effect::SetPrivateConfig(), Effect::SetSharedConfig(), EffectManager::SupportsAutomation(), anonymous_namespace{TrackMenus.cpp}::TracksMenu(), and EffectManager::UnregisterEffect().

Here is the caller graph for this function:

◆ GetConfig() [1/5]

bool PluginManager::GetConfig ( const RegistryPath key,
bool &  value,
bool  defval = false 
)
private

Definition at line 2881 of file PluginManager.cpp.

2882 {
2883  bool result = false;
2884 
2885  if (!key.empty())
2886  {
2887  result = GetSettings()->Read(key, &value, defval);
2888  }
2889 
2890  return result;
2891 }

References GetSettings(), and key.

Here is the call graph for this function:

◆ GetConfig() [2/5]

bool PluginManager::GetConfig ( const RegistryPath key,
double &  value,
double  defval = 0.0 
)
private

Definition at line 2909 of file PluginManager.cpp.

2910 {
2911  bool result = false;
2912 
2913  if (!key.empty())
2914  {
2915  result = GetSettings()->Read(key, &value, defval);
2916  }
2917 
2918  return result;
2919 }

References GetSettings(), and key.

Here is the call graph for this function:

◆ GetConfig() [3/5]

bool PluginManager::GetConfig ( const RegistryPath key,
float &  value,
float  defval = 0.0 
)
private

Definition at line 2893 of file PluginManager.cpp.

2894 {
2895  bool result = false;
2896 
2897  if (!key.empty())
2898  {
2899  double dval = 0.0;
2900 
2901  result = GetSettings()->Read(key, &dval, (double) defval);
2902 
2903  value = (float) dval;
2904  }
2905 
2906  return result;
2907 }

References GetSettings(), and key.

Here is the call graph for this function:

◆ GetConfig() [4/5]

bool PluginManager::GetConfig ( const RegistryPath key,
int &  value,
int  defval = 0 
)
private

Definition at line 2853 of file PluginManager.cpp.

2854 {
2855  bool result = false;
2856 
2857  if (!key.empty())
2858  {
2859  result = GetSettings()->Read(key, &value, defval);
2860  }
2861 
2862  return result;
2863 }

References GetSettings(), and key.

Here is the call graph for this function:

◆ GetConfig() [5/5]

bool PluginManager::GetConfig ( const RegistryPath key,
wxString &  value,
const wxString &  defval = L"" 
)
private

Definition at line 2865 of file PluginManager.cpp.

2866 {
2867  bool result = false;
2868 
2869  if (!key.empty())
2870  {
2871  wxString wxval;
2872 
2873  result = GetSettings()->Read(key, &wxval, defval);
2874 
2875  value = wxval;
2876  }
2877 
2878  return result;
2879 }

References GetSettings(), and key.

Referenced by GetPrivateConfig(), and GetSharedConfig().

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

◆ GetFirstPlugin()

const PluginDescriptor * PluginManager::GetFirstPlugin ( int  type)

Definition at line 2544 of file PluginManager.cpp.

2545 {
2546  for (mPluginsIter = mPlugins.begin(); mPluginsIter != mPlugins.end(); ++mPluginsIter)
2547  {
2548  PluginDescriptor & plug = mPluginsIter->second;
2549  PluginType plugType = plug.GetPluginType();
2550  if( plug.IsValid() && plug.IsEnabled() && ((plugType & type) != 0))
2551  {
2552  bool familyEnabled = true;
2553  if( (plugType & PluginTypeEffect) != 0) {
2554  // This preference may be written by EffectsPrefs
2555  auto setting = GetPluginEnabledSetting( plug );
2556  familyEnabled = setting.empty()
2557  ? true
2558  : gPrefs->Read( setting, true );
2559  }
2560  if (familyEnabled)
2561  return &mPluginsIter->second;
2562  }
2563  }
2564 
2565  return NULL;
2566 }

References GetPluginEnabledSetting(), PluginDescriptor::GetPluginType(), gPrefs, PluginDescriptor::IsEnabled(), PluginDescriptor::IsValid(), mPlugins, mPluginsIter, and PluginTypeEffect.

Referenced by DropFile(), EffectManager::GetEffectByIdentifier(), MacroCommands::HandleTextualCommand(), MacroCommandsCatalog::MacroCommandsCatalog(), and GetInfoCommand::SendCommands().

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

◆ GetFirstPluginForEffectType()

const PluginDescriptor * PluginManager::GetFirstPluginForEffectType ( EffectType  type)

Definition at line 2592 of file PluginManager.cpp.

2593 {
2594  for (mPluginsIter = mPlugins.begin(); mPluginsIter != mPlugins.end(); ++mPluginsIter)
2595  {
2596  PluginDescriptor & plug = mPluginsIter->second;
2597 
2598  bool familyEnabled;
2599  // This preference may be written by EffectsPrefs
2600  auto setting = GetPluginEnabledSetting( plug );
2601  familyEnabled = setting.empty()
2602  ? true
2603  : gPrefs->Read( setting, true );
2604  if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
2605  {
2606  return &plug;
2607  }
2608  }
2609 
2610  return NULL;
2611 }

References PluginDescriptor::GetEffectType(), GetPluginEnabledSetting(), gPrefs, PluginDescriptor::IsEnabled(), PluginDescriptor::IsValid(), mPlugins, and mPluginsIter.

Referenced by anonymous_namespace{PluginMenus.cpp}::PopulateEffectsMenu().

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

◆ GetID() [1/4]

PluginID PluginManager::GetID ( ComponentInterface command)
static

Definition at line 2697 of file PluginManager.cpp.

2698 {
2699  return wxString::Format(wxT("%s_%s_%s_%s_%s"),
2701  wxEmptyString,
2702  command->GetVendor().Internal(),
2703  command->GetSymbol().Internal(),
2704  command->GetPath());
2705 }

References ComponentInterface::GetPath(), GetPluginTypeString(), ComponentInterface::GetSymbol(), ComponentInterface::GetVendor(), ComponentInterfaceSymbol::Internal(), and PluginTypeAudacityCommand.

Here is the call graph for this function:

◆ GetID() [2/4]

PluginID PluginManager::GetID ( EffectDefinitionInterface effect)
static

Definition at line 2707 of file PluginManager.cpp.

2708 {
2709  return wxString::Format(wxT("%s_%s_%s_%s_%s"),
2711  effect->GetFamily().Internal(),
2712  effect->GetVendor().Internal(),
2713  effect->GetSymbol().Internal(),
2714  effect->GetPath());
2715 }

References EffectDefinitionInterface::GetFamily(), ComponentInterface::GetPath(), GetPluginTypeString(), ComponentInterface::GetSymbol(), ComponentInterface::GetVendor(), ComponentInterfaceSymbol::Internal(), and PluginTypeEffect.

Here is the call graph for this function:

◆ GetID() [3/4]

PluginID PluginManager::GetID ( ImporterInterface importer)
static

Definition at line 2717 of file PluginManager.cpp.

2718 {
2719  return wxString::Format(wxT("%s_%s_%s_%s_%s"),
2721  wxEmptyString,
2722  importer->GetVendor().Internal(),
2723  importer->GetSymbol().Internal(),
2724  importer->GetPath());
2725 }

References ComponentInterface::GetPath(), GetPluginTypeString(), ComponentInterface::GetSymbol(), ComponentInterface::GetVendor(), ComponentInterfaceSymbol::Internal(), and PluginTypeImporter.

Here is the call graph for this function:

◆ GetID() [4/4]

PluginID PluginManager::GetID ( ModuleInterface module)
static

Definition at line 2687 of file PluginManager.cpp.

2688 {
2689  return wxString::Format(wxT("%s_%s_%s_%s_%s"),
2691  wxEmptyString,
2692  module->GetVendor().Internal(),
2693  module->GetSymbol().Internal(),
2694  module->GetPath());
2695 }

References ComponentInterface::GetPath(), GetPluginTypeString(), ComponentInterface::GetSymbol(), ComponentInterface::GetVendor(), ComponentInterfaceSymbol::Internal(), and PluginTypeModule.

Referenced by Effect::GetID(), ModuleManager::LoadModule(), and RegisterPlugin().

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

◆ GetInstance()

ComponentInterface * PluginManager::GetInstance ( const PluginID ID)

Definition at line 2664 of file PluginManager.cpp.

2665 {
2666  if (mPlugins.find(ID) == mPlugins.end())
2667  {
2668  return NULL;
2669  }
2670 
2671  PluginDescriptor & plug = mPlugins[ID];
2672 
2673  // If not dealing with legacy effects, make sure the provider is loaded
2674  if (!plug.IsEffectLegacy())
2675  {
2676  const PluginID & prov = plug.GetProviderID();
2677  if (mPlugins.find(prov) == mPlugins.end())
2678  {
2679  return NULL;
2680  }
2681  mPlugins[prov].GetInstance();
2682  }
2683 
2684  return plug.GetInstance();
2685 }

References PluginDescriptor::GetInstance(), PluginDescriptor::GetProviderID(), PluginDescriptor::IsEffectLegacy(), and mPlugins.

Referenced by EffectManager::GetAudacityCommand(), and EffectManager::GetEffect().

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

◆ GetNextPlugin()

const PluginDescriptor * PluginManager::GetNextPlugin ( int  type)

Definition at line 2568 of file PluginManager.cpp.

2569 {
2570  while (++mPluginsIter != mPlugins.end())
2571  {
2572  PluginDescriptor & plug = mPluginsIter->second;
2573  PluginType plugType = plug.GetPluginType();
2574  if( plug.IsValid() && plug.IsEnabled() && ((plugType & type) != 0))
2575  {
2576  bool familyEnabled = true;
2577  if( (plugType & PluginTypeEffect) != 0) {
2578  // This preference may be written by EffectsPrefs
2579  auto setting = GetPluginEnabledSetting( plug );
2580  familyEnabled = setting.empty()
2581  ? true
2582  : gPrefs->Read( setting, true );
2583  }
2584  if (familyEnabled)
2585  return &mPluginsIter->second;
2586  }
2587  }
2588 
2589  return NULL;
2590 }

References GetPluginEnabledSetting(), PluginDescriptor::GetPluginType(), gPrefs, PluginDescriptor::IsEnabled(), PluginDescriptor::IsValid(), mPlugins, mPluginsIter, and PluginTypeEffect.

Referenced by DropFile(), EffectManager::GetEffectByIdentifier(), MacroCommands::HandleTextualCommand(), MacroCommandsCatalog::MacroCommandsCatalog(), and GetInfoCommand::SendCommands().

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

◆ GetNextPluginForEffectType()

const PluginDescriptor * PluginManager::GetNextPluginForEffectType ( EffectType  type)

Definition at line 2613 of file PluginManager.cpp.

2614 {
2615  while (++mPluginsIter != mPlugins.end())
2616  {
2617  PluginDescriptor & plug = mPluginsIter->second;
2618  bool familyEnabled;
2619  // This preference may be written by EffectsPrefs
2620  auto setting = GetPluginEnabledSetting( plug );
2621  familyEnabled = setting.empty()
2622  ? true
2623  : gPrefs->Read( setting, true );
2624  if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
2625  {
2626  return &plug;
2627  }
2628  }
2629 
2630  return NULL;
2631 }

References PluginDescriptor::GetEffectType(), GetPluginEnabledSetting(), gPrefs, PluginDescriptor::IsEnabled(), PluginDescriptor::IsValid(), mPlugins, and mPluginsIter.

Referenced by anonymous_namespace{PluginMenus.cpp}::PopulateEffectsMenu().

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

◆ GetPlugin()

const PluginDescriptor * PluginManager::GetPlugin ( const PluginID ID)

Definition at line 2534 of file PluginManager.cpp.

2535 {
2536  if (mPlugins.find(ID) == mPlugins.end())
2537  {
2538  return NULL;
2539  }
2540 
2541  return &mPlugins[ID];
2542 }

References mPlugins.

Referenced by anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItemGroup(), MacroCommands::ApplyEffectCommand(), MacroCommands::DoAudacityCommand(), EffectUI::DoEffect(), GetPluginEnabledSetting(), EffectManager::SupportsAutomation(), and anonymous_namespace{TrackMenus.cpp}::TracksMenu().

Here is the caller graph for this function:

◆ GetPluginCount()

int PluginManager::GetPluginCount ( PluginType  type)

Definition at line 2519 of file PluginManager.cpp.

2520 {
2521  int num = 0;
2522 
2523  for (PluginMap::iterator iter = mPlugins.begin(); iter != mPlugins.end(); ++iter)
2524  {
2525  if (iter->second.GetPluginType() == type)
2526  {
2527  num++;
2528  }
2529  }
2530 
2531  return num;
2532 }

References mPlugins.

◆ GetPluginEnabledSetting() [1/2]

RegistryPath PluginManager::GetPluginEnabledSetting ( const PluginDescriptor desc)

Definition at line 1415 of file PluginManager.cpp.

1417 {
1418  switch ( desc.GetPluginType() ) {
1419  case PluginTypeModule: {
1420  // Retrieve optional family symbol that was recorded in
1421  // RegisterPlugin() for the module
1422  auto family = desc.GetEffectFamily();
1423  if ( family.empty() ) // as for built-in effect and command modules
1424  return {};
1425  else
1426  return wxT('/') + family + wxT("/Enable");
1427  }
1428  case PluginTypeEffect:
1429  // do NOT use GetEffectFamily() for this descriptor, but instead,
1430  // delegate to the plugin descriptor of the provider, which may
1431  // be different (may be empty)
1432  return GetPluginEnabledSetting( desc.GetProviderID() );
1433  default:
1434  return {};
1435  }
1436 }

References desc, GetPluginEnabledSetting(), PluginTypeEffect, and PluginTypeModule.

Here is the call graph for this function:

◆ GetPluginEnabledSetting() [2/2]

RegistryPath PluginManager::GetPluginEnabledSetting ( const PluginID ID)

Definition at line 1407 of file PluginManager.cpp.

1408 {
1409  auto pPlugin = GetPlugin( ID );
1410  if ( pPlugin )
1411  return GetPluginEnabledSetting( *pPlugin );
1412  return {};
1413 }

References GetPlugin().

Referenced by GetFirstPlugin(), GetFirstPluginForEffectType(), GetNextPlugin(), GetNextPluginForEffectType(), and GetPluginEnabledSetting().

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

◆ GetPluginTypeString()

wxString PluginManager::GetPluginTypeString ( PluginType  type)
static

Definition at line 2729 of file PluginManager.cpp.

2730 {
2731  wxString str;
2732 
2733  switch (type)
2734  {
2735  default:
2736  case PluginTypeNone:
2737  str = wxT("Placeholder");
2738  break;
2739  case PluginTypeStub:
2740  str = wxT("Stub");
2741  break;
2742  case PluginTypeEffect:
2743  str = wxT("Effect");
2744  break;
2746  str = wxT("Generic");
2747  break;
2748  case PluginTypeExporter:
2749  str = wxT("Exporter");
2750  break;
2751  case PluginTypeImporter:
2752  str = wxT("Importer");
2753  break;
2754  case PluginTypeModule:
2755  str = wxT("Module");
2756  break;
2757  }
2758 
2759  return str;
2760 }

References PluginTypeAudacityCommand, PluginTypeEffect, PluginTypeExporter, PluginTypeImporter, PluginTypeModule, PluginTypeNone, and PluginTypeStub.

Referenced by GetID(), Load(), LoadGroup(), SaveGroup(), and SettingsPath().

Here is the caller graph for this function:

◆ GetPrivateConfig() [1/5]

bool PluginManager::GetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
bool &  value,
bool  defval = false 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1664 of file PluginManager.cpp.

1665 {
1666  return GetConfig(PrivateKey(ID, group, key), value, defval);
1667 }

References GetConfig(), key, and PrivateKey().

Here is the call graph for this function:

◆ GetPrivateConfig() [2/5]

bool PluginManager::GetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
double &  value,
double  defval = 0.0 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1674 of file PluginManager.cpp.

1675 {
1676  return GetConfig(PrivateKey(ID, group, key), value, defval);
1677 }

References GetConfig(), key, and PrivateKey().

Here is the call graph for this function:

◆ GetPrivateConfig() [3/5]

bool PluginManager::GetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
float &  value,
float  defval = 0.0 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1669 of file PluginManager.cpp.

1670 {
1671  return GetConfig(PrivateKey(ID, group, key), value, defval);
1672 }

References GetConfig(), key, and PrivateKey().

Here is the call graph for this function:

◆ GetPrivateConfig() [4/5]

bool PluginManager::GetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
int &  value,
int  defval = 0 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1659 of file PluginManager.cpp.

1660 {
1661  return GetConfig(PrivateKey(ID, group, key), value, defval);
1662 }

References GetConfig(), key, and PrivateKey().

Here is the call graph for this function:

◆ GetPrivateConfig() [5/5]

bool PluginManager::GetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
wxString &  value,
const wxString &  defval = _T("") 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1654 of file PluginManager.cpp.

1655 {
1656  return GetConfig(PrivateKey(ID, group, key), value, defval);
1657 }

References GetConfig(), key, and PrivateKey().

Referenced by Effect::GetPrivateConfig().

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

◆ GetPrivateConfigSubgroups()

bool PluginManager::GetPrivateConfigSubgroups ( const PluginID ID,
const RegistryPath group,
RegistryPaths subgroups 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1649 of file PluginManager.cpp.

1650 {
1651  return GetSubgroups(PrivateGroup(ID, group), subgroups);
1652 }

References GetSubgroups(), and PrivateGroup().

Referenced by Effect::GetPrivateConfigSubgroups().

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

◆ GetSettings()

FileConfig * PluginManager::GetSettings ( )
private

Definition at line 2780 of file PluginManager.cpp.

2781 {
2782  if (!mSettings)
2783  {
2784  mSettings =
2786 
2787  // Check for a settings version that we can understand
2788  if (mSettings->HasEntry(SETVERKEY))
2789  {
2790  wxString setver = mSettings->Read(SETVERKEY, SETVERKEY);
2791  if (setver < SETVERCUR )
2792  {
2793  // This is where we'd put in conversion code when the
2794  // settings version changes.
2795  //
2796  // Should also check for a settings file that is newer than
2797  // what we can understand.
2798  }
2799  }
2800  else
2801  {
2802  // Make sure is has a version string
2803  mSettings->Write(SETVERKEY, SETVERCUR);
2804  mSettings->Flush();
2805  }
2806  }
2807 
2808  return mSettings.get();
2809 }

References AudacityFileConfig::Create(), mSettings, FileNames::PluginSettings(), SETVERCUR, and SETVERKEY.

Referenced by GetConfig(), GetSubgroups(), HasGroup(), Initialize(), RemovePrivateConfig(), RemovePrivateConfigSubgroup(), RemoveSharedConfig(), RemoveSharedConfigSubgroup(), and SetConfig().

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

◆ GetSharedConfig() [1/5]

bool PluginManager::GetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
bool &  value,
bool  defval = false 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1582 of file PluginManager.cpp.

1583 {
1584  return GetConfig(SharedKey(ID, group, key), value, defval);
1585 }

References GetConfig(), key, and SharedKey().

Here is the call graph for this function:

◆ GetSharedConfig() [2/5]

bool PluginManager::GetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
double &  value,
double  defval = 0.0 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1592 of file PluginManager.cpp.

1593 {
1594  return GetConfig(SharedKey(ID, group, key), value, defval);
1595 }

References GetConfig(), key, and SharedKey().

Here is the call graph for this function:

◆ GetSharedConfig() [3/5]

bool PluginManager::GetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
float &  value,
float  defval = 0.0 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1587 of file PluginManager.cpp.

1588 {
1589  return GetConfig(SharedKey(ID, group, key), value, defval);
1590 }

References GetConfig(), key, and SharedKey().

Here is the call graph for this function:

◆ GetSharedConfig() [4/5]

bool PluginManager::GetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
int &  value,
int  defval = 0 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1577 of file PluginManager.cpp.

1578 {
1579  return GetConfig(SharedKey(ID, group, key), value, defval);
1580 }

References GetConfig(), key, and SharedKey().

Here is the call graph for this function:

◆ GetSharedConfig() [5/5]

bool PluginManager::GetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
wxString &  value,
const wxString &  defval = _T("") 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1572 of file PluginManager.cpp.

1573 {
1574  return GetConfig(SharedKey(ID, group, key), value, defval);
1575 }

References GetConfig(), key, and SharedKey().

Referenced by Effect::GetSharedConfig().

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

◆ GetSharedConfigSubgroups()

bool PluginManager::GetSharedConfigSubgroups ( const PluginID ID,
const RegistryPath group,
RegistryPaths subgroups 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1567 of file PluginManager.cpp.

1568 {
1569  return GetSubgroups(SharedGroup(ID, group), subgroups);
1570 }

References GetSubgroups(), and SharedGroup().

Referenced by Effect::GetSharedConfigSubgroups().

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

◆ GetSubgroups()

bool PluginManager::GetSubgroups ( const RegistryPath group,
RegistryPaths subgroups 
)
private

Definition at line 2828 of file PluginManager.cpp.

2829 {
2830  if (group.empty() || !HasGroup(group))
2831  {
2832  return false;
2833  }
2834 
2835  wxString path = GetSettings()->GetPath();
2836  GetSettings()->SetPath(group);
2837 
2838  wxString name;
2839  long index = 0;
2840  if (GetSettings()->GetFirstGroup(name, index))
2841  {
2842  do
2843  {
2844  subgroups.push_back(name);
2845  } while (GetSettings()->GetNextGroup(name, index));
2846  }
2847 
2848  GetSettings()->SetPath(path);
2849 
2850  return true;
2851 }

References FileConfig::GetPath(), GetSettings(), HasGroup(), name, and FileConfig::SetPath().

Referenced by GetPrivateConfigSubgroups(), and GetSharedConfigSubgroups().

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

◆ GetSymbol()

const ComponentInterfaceSymbol & PluginManager::GetSymbol ( const PluginID ID)

Definition at line 2653 of file PluginManager.cpp.

2654 {
2655  if (mPlugins.find(ID) == mPlugins.end())
2656  {
2657  static ComponentInterfaceSymbol empty;
2658  return empty;
2659  }
2660 
2661  return mPlugins[ID].GetSymbol();
2662 }

References mPlugins.

Referenced by EffectManager::GetCommandIdentifier(), and EffectManager::GetCommandSymbol().

Here is the caller graph for this function:

◆ HasGroup()

bool PluginManager::HasGroup ( const RegistryPath group)
private

Definition at line 2811 of file PluginManager.cpp.

2812 {
2813  auto settings = GetSettings();
2814 
2815  bool res = settings->HasGroup(group);
2816  if (res)
2817  {
2818  // The group exists, but empty groups aren't considered valid
2819  wxString oldPath = settings->GetPath();
2820  settings->SetPath(group);
2821  res = settings->GetNumberOfEntries() || settings->GetNumberOfGroups();
2822  settings->SetPath(oldPath);
2823  }
2824 
2825  return res;
2826 }

References GetSettings(), and settings().

Referenced by GetSubgroups(), HasPrivateConfigGroup(), and HasSharedConfigGroup().

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

◆ HasPrivateConfigGroup()

bool PluginManager::HasPrivateConfigGroup ( const PluginID ID,
const RegistryPath group 
)

Definition at line 1644 of file PluginManager.cpp.

1645 {
1646  return HasGroup(PrivateGroup(ID, group));
1647 }

References HasGroup(), and PrivateGroup().

Referenced by Effect::HasPrivateConfigGroup().

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

◆ HasSharedConfigGroup()

bool PluginManager::HasSharedConfigGroup ( const PluginID ID,
const RegistryPath group 
)

Definition at line 1562 of file PluginManager.cpp.

1563 {
1564  return HasGroup(SharedGroup(ID, group));
1565 }

References HasGroup(), and SharedGroup().

Referenced by Effect::HasSharedConfigGroup().

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

◆ Initialize()

void PluginManager::Initialize ( )

Definition at line 1771 of file PluginManager.cpp.

1772 {
1773  // Always load the registry first
1774  Load();
1775 
1776  // And force load of setting to verify it's accessible
1777  GetSettings();
1778 
1779  // Then look for providers (they may autoregister plugins)
1781 
1782  // And finally check for updates
1783 #ifndef EXPERIMENTAL_EFFECT_MANAGEMENT
1784  CheckForUpdates();
1785 #else
1786  const bool kFast = true;
1787  CheckForUpdates( kFast );
1788 #endif
1789 }

References CheckForUpdates(), ModuleManager::DiscoverProviders(), ModuleManager::Get(), GetSettings(), and Load().

Referenced by AudacityApp::InitPart2().

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

◆ IsDirty()

bool PluginManager::IsDirty ( )
private

◆ IsPluginEnabled()

bool PluginManager::IsPluginEnabled ( const PluginID ID)

Definition at line 2633 of file PluginManager.cpp.

2634 {
2635  if (mPlugins.find(ID) == mPlugins.end())
2636  {
2637  return false;
2638  }
2639 
2640  return mPlugins[ID].IsEnabled();
2641 }

References mPlugins.

◆ IsPluginRegistered()

bool PluginManager::IsPluginRegistered ( const PluginPath path)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1438 of file PluginManager.cpp.

1439 {
1440  for (PluginMap::iterator iter = mPlugins.begin(); iter != mPlugins.end(); ++iter)
1441  {
1442  if (iter->second.GetPath() == path)
1443  {
1444  return true;
1445  }
1446  }
1447 
1448  return false;
1449 }

References mPlugins.

◆ Load()

void PluginManager::Load ( )
private

Definition at line 1929 of file PluginManager.cpp.

1930 {
1931  // Create/Open the registry
1932  auto pRegistry = AudacityFileConfig::Create(
1933  {}, {}, FileNames::PluginRegistry());
1934  auto &registry = *pRegistry;
1935 
1936  // If this group doesn't exist then we have something that's not a registry.
1937  // We should probably warn the user, but it's pretty unlikely that this will happen.
1938  if (!registry.HasGroup(REGROOT))
1939  {
1940  // Must start over
1941  registry.DeleteAll();
1942  return;
1943  }
1944 
1945  // Check for a registry version that we can understand
1946  // TODO: Should also check for a registry file that is newer than
1947  // what we can understand.
1948  wxString regver = registry.Read(REGVERKEY);
1949  if (regver < REGVERCUR )
1950  {
1951  // Conversion code here, for when registry version changes.
1952 
1953  // We iterate through the effects, possibly updating their info.
1954  wxString groupName;
1955  long groupIndex;
1956  wxString group = GetPluginTypeString(PluginTypeEffect);
1957  wxString cfgPath = REGROOT + group + wxCONFIG_PATH_SEPARATOR;
1958  wxArrayString groupsToDelete;
1959 
1960  registry.SetPath(cfgPath);
1961  for (bool cont = registry.GetFirstGroup(groupName, groupIndex);
1962  cont;
1963  registry.SetPath(cfgPath),
1964  cont = registry.GetNextGroup(groupName, groupIndex))
1965  {
1966  registry.SetPath(groupName);
1967  wxString effectSymbol = registry.Read(KEY_SYMBOL, "");
1968  wxString effectVersion = registry.Read(KEY_VERSION, "");
1969 
1970 
1971  // For 2.3.0 the plugins we distribute have moved around.
1972  // So we upped the registry version number to 1.1.
1973  // These particular config edits were originally written to fix Bug 1914.
1974  if (regver <= "1.0") {
1975  // Nyquist prompt is a built-in that has moved to the tools menu.
1976  if (effectSymbol == "Nyquist Prompt") {
1977  registry.Write(KEY_EFFECTTYPE, "Tool");
1978  // Old version of SDE was in Analyze menu. Now it is in Tools.
1979  // We don't want both the old and the new.
1980  } else if ((effectSymbol == "Sample Data Export") && (effectVersion == "n/a")) {
1981  groupsToDelete.push_back(cfgPath + groupName);
1982  // Old version of SDI was in Generate menu. Now it is in Tools.
1983  } else if ((effectSymbol == "Sample Data Import") && (effectVersion == "n/a")) {
1984  groupsToDelete.push_back(cfgPath + groupName);
1985  }
1986  }
1987 
1988  }
1989  // Doing the deletion within the search loop risked skipping some items,
1990  // hence the delayed delete.
1991  for (unsigned int i = 0; i < groupsToDelete.size(); i++) {
1992  registry.DeleteGroup(groupsToDelete[i]);
1993  }
1994  registry.SetPath("");
1995  registry.Write(REGVERKEY, REGVERCUR);
1996  // Updates done. Make sure we read the updated data later.
1997  registry.Flush();
1998  }
1999 
2000  // Load all provider plugins first
2001  LoadGroup(&registry, PluginTypeModule);
2002 
2003  // Now the rest
2004  LoadGroup(&registry, PluginTypeEffect);
2005  LoadGroup(&registry, PluginTypeAudacityCommand );
2006  LoadGroup(&registry, PluginTypeExporter);
2007  LoadGroup(&registry, PluginTypeImporter);
2008 
2009  LoadGroup(&registry, PluginTypeStub);
2010  return;
2011 }

References AudacityFileConfig::Create(), GetPluginTypeString(), KEY_EFFECTTYPE, KEY_SYMBOL, KEY_VERSION, LoadGroup(), FileNames::PluginRegistry(), PluginTypeAudacityCommand, PluginTypeEffect, PluginTypeExporter, PluginTypeImporter, PluginTypeModule, PluginTypeStub, REGROOT, REGVERCUR, and REGVERKEY.

Referenced by Initialize().

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

◆ LoadGroup()

void PluginManager::LoadGroup ( FileConfig pRegistry,
PluginType  type 
)
private

Definition at line 2013 of file PluginManager.cpp.

2014 {
2015 #ifdef __WXMAC__
2016  // Bug 1590: On Mac, we should purge the registry of Nyquist plug-ins
2017  // bundled with other versions of Audacity, assuming both versions
2018  // were properly installed in /Applications (or whatever it is called in
2019  // your locale)
2020 
2021  const auto fullExePath = PlatformCompatibility::GetExecutablePath();
2022 
2023  // Strip rightmost path components up to *.app
2024  wxFileName exeFn{ fullExePath };
2025  exeFn.SetEmptyExt();
2026  exeFn.SetName(wxString{});
2027  while(exeFn.GetDirCount() && !exeFn.GetDirs().back().EndsWith(".app"))
2028  exeFn.RemoveLastDir();
2029 
2030  const auto goodPath = exeFn.GetPath();
2031 
2032  if(exeFn.GetDirCount())
2033  exeFn.RemoveLastDir();
2034  const auto possiblyBadPath = exeFn.GetPath();
2035 
2036  auto AcceptPath = [&](const wxString &path) {
2037  if (!path.StartsWith(possiblyBadPath))
2038  // Assume it's not under /Applications
2039  return true;
2040  if (path.StartsWith(goodPath))
2041  // It's bundled with this executable
2042  return true;
2043  return false;
2044  };
2045 #else
2046  auto AcceptPath = [](const wxString&){ return true; };
2047 #endif
2048 
2049  wxString strVal;
2050  bool boolVal;
2051  wxString groupName;
2052  long groupIndex;
2053  wxString group = GetPluginTypeString(type);
2054  wxString cfgPath = REGROOT + group + wxCONFIG_PATH_SEPARATOR;
2055 
2056  pRegistry->SetPath(cfgPath);
2057  for (bool cont = pRegistry->GetFirstGroup(groupName, groupIndex);
2058  cont;
2059  pRegistry->SetPath(cfgPath),
2060  cont = pRegistry->GetNextGroup(groupName, groupIndex))
2061  {
2062  PluginDescriptor plug;
2063 
2064  pRegistry->SetPath(groupName);
2065 
2066  groupName = ConvertID(groupName);
2067 
2068  // Bypass group if the ID is already in use
2069  if (mPlugins.find(groupName) != mPlugins.end())
2070  {
2071  pRegistry->SetPath(wxT(".."));
2072 
2073  continue;
2074  }
2075 
2076  // Set the ID and type
2077  plug.SetID(groupName);
2078  plug.SetPluginType(type);
2079 
2080  // Get the provider ID and bypass group if not found
2081  if (!pRegistry->Read(KEY_PROVIDERID, &strVal, wxEmptyString))
2082  {
2083  // Bypass group if the provider isn't valid
2084  if (!strVal.empty() && mPlugins.find(strVal) == mPlugins.end())
2085  {
2086  continue;
2087  }
2088  }
2089  plug.SetProviderID(PluginID(strVal));
2090 
2091  // Get the path (optional)
2092  pRegistry->Read(KEY_PATH, &strVal, wxEmptyString);
2093  if (!AcceptPath(strVal))
2094  // Ignore the obsolete path in the config file, during session,
2095  // but don't remove it from the file. Maybe you really want to
2096  // switch back to the other version of Audacity and lose nothing.
2097  continue;
2098  plug.SetPath(strVal);
2099 
2100  /*
2101  // PRL: Ignore names written in configs before 2.3.0!
2102  // use Internal string only! Let the present version of Audacity map
2103  // that to a user-visible string.
2104  // Get the name and bypass group if not found
2105  if (!pRegistry->Read(KEY_NAME, &strVal))
2106  {
2107  continue;
2108  }
2109  plug.SetName(strVal);
2110  */
2111 
2112  // Get the symbol...Audacity 2.3.0 or later requires it
2113  // bypass group if not found
2114  // Note, KEY_SYMBOL started getting written to config files in 2.1.0.
2115  // KEY_NAME (now ignored) was written before that, but only for VST
2116  // effects.
2117  if (!pRegistry->Read(KEY_SYMBOL, &strVal))
2118  continue;
2119  plug.SetSymbol(strVal);
2120 
2121  // Get the version and bypass group if not found
2122  if (!pRegistry->Read(KEY_VERSION, &strVal))
2123  {
2124  continue;
2125  }
2126  plug.SetVersion(strVal);
2127 
2128  // Get the vendor and bypass group if not found
2129  if (!pRegistry->Read(KEY_VENDOR, &strVal))
2130  {
2131  continue;
2132  }
2133  plug.SetVendor( strVal );
2134 
2135 #if 0
2136  // This was done before version 2.2.2, but the value was not really used
2137  // But absence of a value will cause early versions to skip the group
2138  // Therefore we still write a blank to keep pluginregistry.cfg
2139  // backwards-compatible
2140 
2141  // Get the description and bypass group if not found
2142  if (!pRegistry->Read(KEY_DESCRIPTION, &strVal))
2143  {
2144  continue;
2145  }
2146 #endif
2147 
2148  // Is it enabled...default to no if not found
2149  pRegistry->Read(KEY_ENABLED, &boolVal, false);
2150  plug.SetEnabled(boolVal);
2151 
2152  // Is it valid...default to no if not found
2153  pRegistry->Read(KEY_VALID, &boolVal, false);
2154  plug.SetValid(boolVal);
2155 
2156  switch (type)
2157  {
2158  case PluginTypeModule:
2159  {
2160  // Nothing to do here yet
2161  }
2162  break;
2163 
2164  case PluginTypeEffect:
2165  {
2166  // Get the effect type and bypass group if not found
2167  if (!pRegistry->Read(KEY_EFFECTTYPE, &strVal))
2168  continue;
2169 
2170  if (strVal == KEY_EFFECTTYPE_NONE)
2172  else if (strVal == KEY_EFFECTTYPE_ANALYZE)
2174  else if (strVal == KEY_EFFECTTYPE_GENERATE)
2176  else if (strVal == KEY_EFFECTTYPE_PROCESS)
2178  else if (strVal == KEY_EFFECTTYPE_TOOL)
2180  else if (strVal == KEY_EFFECTTYPE_HIDDEN)
2182  else
2183  continue;
2184 
2185  // Get the effect family and bypass group if not found
2186  if (!pRegistry->Read(KEY_EFFECTFAMILY, &strVal))
2187  {
2188  continue;
2189  }
2190  plug.SetEffectFamily(strVal);
2191 
2192  // Is it a default (above the line) effect and bypass group if not found
2193  if (!pRegistry->Read(KEY_EFFECTDEFAULT, &boolVal))
2194  {
2195  continue;
2196  }
2197  plug.SetEffectDefault(boolVal);
2198 
2199  // Is it an interactive effect and bypass group if not found
2200  if (!pRegistry->Read(KEY_EFFECTINTERACTIVE, &boolVal))
2201  {
2202  continue;
2203  }
2204  plug.SetEffectInteractive(boolVal);
2205 
2206  // Is it a realtime capable effect and bypass group if not found
2207  if (!pRegistry->Read(KEY_EFFECTREALTIME, &boolVal))
2208  {
2209  continue;
2210  }
2211  plug.SetEffectRealtime(boolVal);
2212 
2213  // Does the effect support automation...bypass group if not found
2214  if (!pRegistry->Read(KEY_EFFECTAUTOMATABLE, &boolVal))
2215  {
2216  continue;
2217  }
2218  plug.SetEffectAutomatable(boolVal);
2219  }
2220  break;
2221 
2222  case PluginTypeImporter:
2223  {
2224  // Get the importer identifier and bypass group if not found
2225  if (!pRegistry->Read(KEY_IMPORTERIDENT, &strVal))
2226  {
2227  continue;
2228  }
2229  plug.SetImporterIdentifier(strVal);
2230 
2231  // Get the importer extensions and bypass group if not found
2232  if (!pRegistry->Read(KEY_IMPORTEREXTENSIONS, &strVal))
2233  {
2234  continue;
2235  }
2236  FileExtensions extensions;
2237  wxStringTokenizer tkr(strVal, wxT(":"));
2238  while (tkr.HasMoreTokens())
2239  {
2240  extensions.push_back(tkr.GetNextToken());
2241  }
2242  plug.SetImporterExtensions(extensions);
2243  }
2244  break;
2245 
2246  case PluginTypeStub:
2247  {
2248  // Nothing additional for stubs
2249  }
2250  break;
2251 
2252  // Not used by 2.1.1 or greater and should be removed after a few releases past 2.1.0.
2253  case PluginTypeNone:
2254  {
2255  // Used for stub groups
2256  }
2257  break;
2258 
2259  default:
2260  {
2261  continue;
2262  }
2263  }
2264 
2265  // Everything checked out...accept the plugin
2266  mPlugins[groupName] = plug;
2267  }
2268 
2269  return;
2270 }

References ConvertID(), EffectTypeAnalyze, EffectTypeGenerate, EffectTypeHidden, EffectTypeNone, EffectTypeProcess, EffectTypeTool, PlatformCompatibility::GetExecutablePath(), FileConfig::GetFirstGroup(), FileConfig::GetNextGroup(), GetPluginTypeString(), KEY_DESCRIPTION, KEY_EFFECTAUTOMATABLE, KEY_EFFECTDEFAULT, KEY_EFFECTFAMILY, KEY_EFFECTINTERACTIVE, KEY_EFFECTREALTIME, KEY_EFFECTTYPE, KEY_EFFECTTYPE_ANALYZE, KEY_EFFECTTYPE_GENERATE, KEY_EFFECTTYPE_HIDDEN, KEY_EFFECTTYPE_NONE, KEY_EFFECTTYPE_PROCESS, KEY_EFFECTTYPE_TOOL, KEY_ENABLED, KEY_IMPORTEREXTENSIONS, KEY_IMPORTERIDENT, KEY_PATH, KEY_PROVIDERID, KEY_SYMBOL, KEY_VALID, KEY_VENDOR, KEY_VERSION, mPlugins, PluginTypeEffect, PluginTypeImporter, PluginTypeModule, PluginTypeNone, PluginTypeStub, REGROOT, PluginDescriptor::SetEffectAutomatable(), PluginDescriptor::SetEffectDefault(), PluginDescriptor::SetEffectFamily(), PluginDescriptor::SetEffectInteractive(), PluginDescriptor::SetEffectRealtime(), PluginDescriptor::SetEffectType(), PluginDescriptor::SetEnabled(), PluginDescriptor::SetID(), PluginDescriptor::SetImporterExtensions(), PluginDescriptor::SetImporterIdentifier(), PluginDescriptor::SetPath(), FileConfig::SetPath(), PluginDescriptor::SetPluginType(), PluginDescriptor::SetProviderID(), PluginDescriptor::SetSymbol(), PluginDescriptor::SetValid(), PluginDescriptor::SetVendor(), and PluginDescriptor::SetVersion().

Referenced by Load().

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

◆ PrivateGroup()

RegistryPath PluginManager::PrivateGroup ( const PluginID ID,
const RegistryPath group 
)
private

Definition at line 3059 of file PluginManager.cpp.

3060 {
3061  auto path = SettingsPath(ID, false);
3062 
3063  wxFileName ff(group);
3064  if (!ff.GetName().empty())
3065  {
3066  path += ff.GetFullPath(wxPATH_UNIX) + wxCONFIG_PATH_SEPARATOR;
3067  }
3068 
3069  return path;
3070 }

References SettingsPath().

Referenced by GetPrivateConfigSubgroups(), HasPrivateConfigGroup(), PrivateKey(), and RemovePrivateConfigSubgroup().

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

◆ PrivateKey()

RegistryPath PluginManager::PrivateKey ( const PluginID ID,
const RegistryPath group,
const RegistryPath key 
)
private

Definition at line 3073 of file PluginManager.cpp.

3074 {
3075  auto path = PrivateGroup(ID, group);
3076  if (path.empty())
3077  {
3078  return path;
3079  }
3080 
3081  return path + key;
3082 }

References key, and PrivateGroup().

Referenced by GetPrivateConfig(), RemovePrivateConfig(), and SetPrivateConfig().

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

◆ RegisterPlugin() [1/5]

const PluginID & PluginManager::RegisterPlugin ( EffectDefinitionInterface effect,
PluginType  type 
)

Definition at line 2488 of file PluginManager.cpp.

2489 {
2490  PluginDescriptor & plug = CreatePlugin(GetID(effect), effect, type);
2491 
2492  plug.SetEffectType(effect->GetType());
2493  plug.SetEffectFamily(effect->GetFamily().Internal());
2494  plug.SetEffectInteractive(effect->IsInteractive());
2495  plug.SetEffectDefault(effect->IsDefault());
2496  plug.SetEffectRealtime(effect->SupportsRealtime());
2497  plug.SetEffectAutomatable(effect->SupportsAutomation());
2498 
2499  plug.SetInstance(effect);
2500  plug.SetEffectLegacy(true);
2501  plug.SetEnabled(true);
2502  plug.SetValid(true);
2503 
2504  return plug.GetID();
2505 }

References CreatePlugin(), EffectDefinitionInterface::GetFamily(), PluginDescriptor::GetID(), GetID(), EffectDefinitionInterface::GetType(), ComponentInterfaceSymbol::Internal(), EffectDefinitionInterface::IsDefault(), EffectDefinitionInterface::IsInteractive(), PluginDescriptor::SetEffectAutomatable(), PluginDescriptor::SetEffectDefault(), PluginDescriptor::SetEffectFamily(), PluginDescriptor::SetEffectInteractive(), PluginDescriptor::SetEffectLegacy(), PluginDescriptor::SetEffectRealtime(), PluginDescriptor::SetEffectType(), PluginDescriptor::SetEnabled(), PluginDescriptor::SetInstance(), PluginDescriptor::SetValid(), EffectDefinitionInterface::SupportsAutomation(), and EffectDefinitionInterface::SupportsRealtime().

Here is the call graph for this function:

◆ RegisterPlugin() [2/5]

const PluginID & PluginManager::RegisterPlugin ( ModuleInterface module)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1451 of file PluginManager.cpp.

1452 {
1453  PluginDescriptor & plug = CreatePlugin(GetID(module), module, PluginTypeModule);
1455 
1456  plug.SetEnabled(true);
1457  plug.SetValid(true);
1458 
1459  return plug.GetID();
1460 }

References CreatePlugin(), PluginDescriptor::GetID(), GetID(), ModuleInterface::GetOptionalFamilySymbol(), ComponentInterfaceSymbol::Internal(), PluginTypeModule, PluginDescriptor::SetEffectFamily(), PluginDescriptor::SetEnabled(), and PluginDescriptor::SetValid().

Referenced by PluginManagerInterface::AudacityCommandRegistrationCallback(), PluginManagerInterface::DefaultRegistrationCallback(), ModuleManager::DiscoverProviders(), ModuleManager::InitializeBuiltins(), and EffectManager::RegisterEffect().

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

◆ RegisterPlugin() [3/5]

const PluginID & PluginManager::RegisterPlugin ( ModuleInterface provider,
ComponentInterface command 
)

Definition at line 1462 of file PluginManager.cpp.

1463 {
1465 
1466  plug.SetProviderID(PluginManager::GetID(provider));
1467 
1468  plug.SetEnabled(true);
1469  plug.SetValid(true);
1470 
1471  return plug.GetID();
1472 }

References CreatePlugin(), PluginDescriptor::GetID(), GetID(), PluginTypeAudacityCommand, PluginDescriptor::SetEnabled(), PluginDescriptor::SetProviderID(), and PluginDescriptor::SetValid().

Here is the call graph for this function:

◆ RegisterPlugin() [4/5]

const PluginID & PluginManager::RegisterPlugin ( ModuleInterface provider,
EffectDefinitionInterface effect,
int  type 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1474 of file PluginManager.cpp.

1475 {
1476  PluginDescriptor & plug = CreatePlugin(GetID(effect), effect, (PluginType)type);
1477 
1478  plug.SetProviderID(PluginManager::GetID(provider));
1479 
1480  plug.SetEffectType(effect->GetClassification());
1481  plug.SetEffectFamily(effect->GetFamily().Internal());
1482  plug.SetEffectInteractive(effect->IsInteractive());
1483  plug.SetEffectDefault(effect->IsDefault());
1484  plug.SetEffectRealtime(effect->SupportsRealtime());
1485  plug.SetEffectAutomatable(effect->SupportsAutomation());
1486 
1487  plug.SetEnabled(true);
1488  plug.SetValid(true);
1489 
1490  return plug.GetID();
1491 }

References CreatePlugin(), EffectDefinitionInterface::GetClassification(), EffectDefinitionInterface::GetFamily(), PluginDescriptor::GetID(), GetID(), ComponentInterfaceSymbol::Internal(), EffectDefinitionInterface::IsDefault(), EffectDefinitionInterface::IsInteractive(), PluginDescriptor::SetEffectAutomatable(), PluginDescriptor::SetEffectDefault(), PluginDescriptor::SetEffectFamily(), PluginDescriptor::SetEffectInteractive(), PluginDescriptor::SetEffectRealtime(), PluginDescriptor::SetEffectType(), PluginDescriptor::SetEnabled(), PluginDescriptor::SetProviderID(), PluginDescriptor::SetValid(), EffectDefinitionInterface::SupportsAutomation(), and EffectDefinitionInterface::SupportsRealtime().

Here is the call graph for this function:

◆ RegisterPlugin() [5/5]

const PluginID & PluginManager::RegisterPlugin ( ModuleInterface provider,
ImporterInterface importer 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1493 of file PluginManager.cpp.

1494 {
1495  PluginDescriptor & plug = CreatePlugin(GetID(importer), importer, PluginTypeImporter);
1496 
1497  plug.SetProviderID(PluginManager::GetID(provider));
1498 
1499  plug.SetImporterIdentifier(importer->GetPluginStringID());
1501 
1502  return plug.GetID();
1503 }

References CreatePlugin(), PluginDescriptor::GetID(), GetID(), ImporterInterface::GetPluginStringID(), ImporterInterface::GetSupportedExtensions(), PluginTypeImporter, PluginDescriptor::SetImporterExtensions(), PluginDescriptor::SetImporterIdentifier(), and PluginDescriptor::SetProviderID().

Here is the call graph for this function:

◆ RemovePrivateConfig()

bool PluginManager::RemovePrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1715 of file PluginManager.cpp.

1716 {
1717  bool result = GetSettings()->DeleteEntry(PrivateKey(ID, group, key));
1718  if (result)
1719  {
1720  GetSettings()->Flush();
1721  }
1722 
1723  return result;
1724 }

References FileConfig::DeleteEntry(), FileConfig::Flush(), GetSettings(), key, and PrivateKey().

Referenced by Effect::RemovePrivateConfig().

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

◆ RemovePrivateConfigSubgroup()

bool PluginManager::RemovePrivateConfigSubgroup ( const PluginID ID,
const RegistryPath group 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1704 of file PluginManager.cpp.

1705 {
1706  bool result = GetSettings()->DeleteGroup(PrivateGroup(ID, group));
1707  if (result)
1708  {
1709  GetSettings()->Flush();
1710  }
1711 
1712  return result;
1713 }

References FileConfig::DeleteGroup(), FileConfig::Flush(), GetSettings(), and PrivateGroup().

Referenced by Effect::RemovePrivateConfigSubgroup().

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

◆ RemoveSharedConfig()

bool PluginManager::RemoveSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1633 of file PluginManager.cpp.

1634 {
1635  bool result = GetSettings()->DeleteEntry(SharedKey(ID, group, key));
1636  if (result)
1637  {
1638  GetSettings()->Flush();
1639  }
1640 
1641  return result;
1642 }

References FileConfig::DeleteEntry(), FileConfig::Flush(), GetSettings(), key, and SharedKey().

Referenced by Effect::RemoveSharedConfig().

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

◆ RemoveSharedConfigSubgroup()

bool PluginManager::RemoveSharedConfigSubgroup ( const PluginID ID,
const RegistryPath group 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1622 of file PluginManager.cpp.

1623 {
1624  bool result = GetSettings()->DeleteGroup(SharedGroup(ID, group));
1625  if (result)
1626  {
1627  GetSettings()->Flush();
1628  }
1629 
1630  return result;
1631 }

References FileConfig::DeleteGroup(), FileConfig::Flush(), GetSettings(), and SharedGroup().

Referenced by Effect::RemoveSharedConfigSubgroup().

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

◆ Save()

void PluginManager::Save ( )
private

Definition at line 2272 of file PluginManager.cpp.

2273 {
2274  // Create/Open the registry
2275  auto pRegistry = AudacityFileConfig::Create(
2276  {}, {}, FileNames::PluginRegistry());
2277  auto &registry = *pRegistry;
2278 
2279  // Clear it out
2280  registry.DeleteAll();
2281 
2282  // Write the version string
2283  registry.Write(REGVERKEY, REGVERCUR);
2284 
2285  // Save the individual groups
2286  SaveGroup(&registry, PluginTypeEffect);
2287  SaveGroup(&registry, PluginTypeExporter);
2289  SaveGroup(&registry, PluginTypeImporter);
2290  SaveGroup(&registry, PluginTypeStub);
2291 
2292  // Not used by 2.1.1 or greater, but must save to allow users to switch between 2.1.0
2293  // and 2.1.1+. This should be removed after a few releases past 2.1.0.
2294  //SaveGroup(&registry, PluginTypeNone);
2295 
2296  // And now the providers
2297  SaveGroup(&registry, PluginTypeModule);
2298 
2299  // Just to be safe
2300  registry.Flush();
2301 }

References AudacityFileConfig::Create(), FileNames::PluginRegistry(), PluginTypeAudacityCommand, PluginTypeEffect, PluginTypeExporter, PluginTypeImporter, PluginTypeModule, PluginTypeStub, REGVERCUR, REGVERKEY, and SaveGroup().

Referenced by CheckForUpdates(), DropFile(), and PluginRegistrationDialog::OnOK().

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

◆ SaveGroup()

void PluginManager::SaveGroup ( FileConfig pRegistry,
PluginType  type 
)
private

Definition at line 2303 of file PluginManager.cpp.

2304 {
2305  wxString group = GetPluginTypeString(type);
2306  for (PluginMap::iterator iter = mPlugins.begin(); iter != mPlugins.end(); ++iter)
2307  {
2308  PluginDescriptor & plug = iter->second;
2309 
2310  if (plug.GetPluginType() != type)
2311  {
2312  continue;
2313  }
2314 
2315  pRegistry->SetPath(REGROOT + group + wxCONFIG_PATH_SEPARATOR + ConvertID(plug.GetID()));
2316 
2317  pRegistry->Write(KEY_PATH, plug.GetPath());
2318  pRegistry->Write(KEY_SYMBOL, plug.GetSymbol().Internal());
2319 
2320  // PRL: Writing KEY_NAME which is no longer read, but older Audacity
2321  // versions expect to find it.
2322  pRegistry->Write(KEY_NAME, plug.GetSymbol().Msgid().MSGID());
2323 
2324  pRegistry->Write(KEY_VERSION, plug.GetUntranslatedVersion());
2325  pRegistry->Write(KEY_VENDOR, plug.GetVendor());
2326  // Write a blank -- see comments in LoadGroup:
2327  pRegistry->Write(KEY_DESCRIPTION, wxString{});
2328  pRegistry->Write(KEY_PROVIDERID, plug.GetProviderID());
2329  pRegistry->Write(KEY_ENABLED, plug.IsEnabled());
2330  pRegistry->Write(KEY_VALID, plug.IsValid());
2331 
2332  switch (type)
2333  {
2334  case PluginTypeModule:
2335  break;
2336 
2337  case PluginTypeEffect:
2338  {
2339  EffectType etype = plug.GetEffectType();
2340  wxString stype;
2341  if (etype == EffectTypeNone)
2342  stype = KEY_EFFECTTYPE_NONE;
2343  else if (etype == EffectTypeAnalyze)
2344  stype = KEY_EFFECTTYPE_ANALYZE;
2345  else if (etype == EffectTypeGenerate)
2346  stype = KEY_EFFECTTYPE_GENERATE;
2347  else if (etype == EffectTypeProcess)
2348  stype = KEY_EFFECTTYPE_PROCESS;
2349  else if (etype == EffectTypeTool)
2350  stype = KEY_EFFECTTYPE_TOOL;
2351  else if (etype == EffectTypeHidden)
2352  stype = KEY_EFFECTTYPE_HIDDEN;
2353 
2354  pRegistry->Write(KEY_EFFECTTYPE, stype);
2355  pRegistry->Write(KEY_EFFECTFAMILY, plug.GetEffectFamily());
2356  pRegistry->Write(KEY_EFFECTDEFAULT, plug.IsEffectDefault());
2357  pRegistry->Write(KEY_EFFECTINTERACTIVE, plug.IsEffectInteractive());
2358  pRegistry->Write(KEY_EFFECTREALTIME, plug.IsEffectRealtime());
2359  pRegistry->Write(KEY_EFFECTAUTOMATABLE, plug.IsEffectAutomatable());
2360  }
2361  break;
2362 
2363  case PluginTypeImporter:
2364  {
2365  pRegistry->Write(KEY_IMPORTERIDENT, plug.GetImporterIdentifier());
2366  const auto & extensions = plug.GetImporterExtensions();
2367  wxString strExt;
2368  for (size_t i = 0, cnt = extensions.size(); i < cnt; i++)
2369  {
2370  strExt += extensions[i] + wxT(":");
2371  }
2372  strExt.RemoveLast(1);
2373  pRegistry->Write(KEY_IMPORTEREXTENSIONS, strExt);
2374  }
2375  break;
2376 
2377  default:
2378  break;
2379  }
2380  }
2381 
2382  return;
2383 }

References ConvertID(), EffectTypeAnalyze, EffectTypeGenerate, EffectTypeHidden, EffectTypeNone, EffectTypeProcess, EffectTypeTool, PluginDescriptor::GetEffectFamily(), PluginDescriptor::GetEffectType(), PluginDescriptor::GetID(), PluginDescriptor::GetImporterExtensions(), PluginDescriptor::GetImporterIdentifier(), PluginDescriptor::GetPath(), PluginDescriptor::GetPluginType(), GetPluginTypeString(), PluginDescriptor::GetProviderID(), PluginDescriptor::GetSymbol(), PluginDescriptor::GetUntranslatedVersion(), PluginDescriptor::GetVendor(), ComponentInterfaceSymbol::Internal(), PluginDescriptor::IsEffectAutomatable(), PluginDescriptor::IsEffectDefault(), PluginDescriptor::IsEffectInteractive(), PluginDescriptor::IsEffectRealtime(), PluginDescriptor::IsEnabled(), PluginDescriptor::IsValid(), KEY_DESCRIPTION, KEY_EFFECTAUTOMATABLE, KEY_EFFECTDEFAULT, KEY_EFFECTFAMILY, KEY_EFFECTINTERACTIVE, KEY_EFFECTREALTIME, KEY_EFFECTTYPE, KEY_EFFECTTYPE_ANALYZE, KEY_EFFECTTYPE_GENERATE, KEY_EFFECTTYPE_HIDDEN, KEY_EFFECTTYPE_NONE, KEY_EFFECTTYPE_PROCESS, KEY_EFFECTTYPE_TOOL, KEY_ENABLED, KEY_IMPORTEREXTENSIONS, KEY_IMPORTERIDENT, KEY_NAME, KEY_PATH, KEY_PROVIDERID, KEY_SYMBOL, KEY_VALID, KEY_VENDOR, KEY_VERSION, mPlugins, ComponentInterfaceSymbol::Msgid(), TranslatableString::MSGID(), PluginTypeEffect, PluginTypeImporter, PluginTypeModule, REGROOT, and FileConfig::SetPath().

Referenced by Save().

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

◆ SetConfig() [1/5]

bool PluginManager::SetConfig ( const RegistryPath key,
const bool &  value 
)
private

Definition at line 2954 of file PluginManager.cpp.

2955 {
2956  bool result = false;
2957 
2958  if (!key.empty())
2959  {
2960  result = GetSettings()->Write(key, value);
2961  if (result)
2962  {
2963  result = GetSettings()->Flush();
2964  }
2965  }
2966 
2967  return result;
2968 }

References FileConfig::Flush(), GetSettings(), and key.

Here is the call graph for this function:

◆ SetConfig() [2/5]

bool PluginManager::SetConfig ( const RegistryPath key,
const double &  value 
)
private

Definition at line 2986 of file PluginManager.cpp.

2987 {
2988  bool result = false;
2989 
2990  if (!key.empty())
2991  {
2992  result = GetSettings()->Write(key, value);
2993  if (result)
2994  {
2995  result = GetSettings()->Flush();
2996  }
2997  }
2998 
2999  return result;
3000 }

References FileConfig::Flush(), GetSettings(), and key.

Here is the call graph for this function:

◆ SetConfig() [3/5]

bool PluginManager::SetConfig ( const RegistryPath key,
const float &  value 
)
private

Definition at line 2970 of file PluginManager.cpp.

2971 {
2972  bool result = false;
2973 
2974  if (!key.empty())
2975  {
2976  result = GetSettings()->Write(key, value);
2977  if (result)
2978  {
2979  result = GetSettings()->Flush();
2980  }
2981  }
2982 
2983  return result;
2984 }

References FileConfig::Flush(), GetSettings(), and key.

Here is the call graph for this function:

◆ SetConfig() [4/5]

bool PluginManager::SetConfig ( const RegistryPath key,
const int &  value 
)
private

Definition at line 2938 of file PluginManager.cpp.

2939 {
2940  bool result = false;
2941 
2942  if (!key.empty())
2943  {
2944  result = GetSettings()->Write(key, value);
2945  if (result)
2946  {
2947  result = GetSettings()->Flush();
2948  }
2949  }
2950 
2951  return result;
2952 }

References FileConfig::Flush(), GetSettings(), and key.

Here is the call graph for this function:

◆ SetConfig() [5/5]

bool PluginManager::SetConfig ( const RegistryPath key,
const wxString &  value 
)
private

Definition at line 2921 of file PluginManager.cpp.

2922 {
2923  bool result = false;
2924 
2925  if (!key.empty())
2926  {
2927  wxString wxval = value;
2928  result = GetSettings()->Write(key, wxval);
2929  if (result)
2930  {
2931  result = GetSettings()->Flush();
2932  }
2933  }
2934 
2935  return result;
2936 }

References FileConfig::Flush(), GetSettings(), and key.

Referenced by SetPrivateConfig(), and SetSharedConfig().

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

◆ SetDirty()

void PluginManager::SetDirty ( bool  dirty = true)
private

◆ SetPrivateConfig() [1/5]

bool PluginManager::SetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const bool &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1689 of file PluginManager.cpp.

1690 {
1691  return SetConfig(PrivateKey(ID, group, key), value);
1692 }

References key, PrivateKey(), and SetConfig().

Here is the call graph for this function:

◆ SetPrivateConfig() [2/5]

bool PluginManager::SetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const double &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1699 of file PluginManager.cpp.

1700 {
1701  return SetConfig(PrivateKey(ID, group, key), value);
1702 }

References key, PrivateKey(), and SetConfig().

Here is the call graph for this function:

◆ SetPrivateConfig() [3/5]

bool PluginManager::SetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const float &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1694 of file PluginManager.cpp.

1695 {
1696  return SetConfig(PrivateKey(ID, group, key), value);
1697 }

References key, PrivateKey(), and SetConfig().

Here is the call graph for this function:

◆ SetPrivateConfig() [4/5]

bool PluginManager::SetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const int &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1684 of file PluginManager.cpp.

1685 {
1686  return SetConfig(PrivateKey(ID, group, key), value);
1687 }

References key, PrivateKey(), and SetConfig().

Here is the call graph for this function:

◆ SetPrivateConfig() [5/5]

bool PluginManager::SetPrivateConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const wxString &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1679 of file PluginManager.cpp.

1680 {
1681  return SetConfig(PrivateKey(ID, group, key), value);
1682 }

References key, PrivateKey(), and SetConfig().

Referenced by Effect::SetPrivateConfig().

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

◆ SetSharedConfig() [1/5]

bool PluginManager::SetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const bool &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1607 of file PluginManager.cpp.

1608 {
1609  return SetConfig(SharedKey(ID, group, key), value);
1610 }

References key, SetConfig(), and SharedKey().

Here is the call graph for this function:

◆ SetSharedConfig() [2/5]

bool PluginManager::SetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const double &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1617 of file PluginManager.cpp.

1618 {
1619  return SetConfig(SharedKey(ID, group, key), value);
1620 }

References key, SetConfig(), and SharedKey().

Here is the call graph for this function:

◆ SetSharedConfig() [3/5]

bool PluginManager::SetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const float &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1612 of file PluginManager.cpp.

1613 {
1614  return SetConfig(SharedKey(ID, group, key), value);
1615 }

References key, SetConfig(), and SharedKey().

Here is the call graph for this function:

◆ SetSharedConfig() [4/5]

bool PluginManager::SetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const int &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1602 of file PluginManager.cpp.

1603 {
1604  return SetConfig(SharedKey(ID, group, key), value);
1605 }

References key, SetConfig(), and SharedKey().

Here is the call graph for this function:

◆ SetSharedConfig() [5/5]

bool PluginManager::SetSharedConfig ( const PluginID ID,
const RegistryPath group,
const RegistryPath key,
const wxString &  value 
)
overridevirtual

Implements PluginManagerInterface.

Definition at line 1597 of file PluginManager.cpp.

1598 {
1599  return SetConfig(SharedKey(ID, group, key), value);
1600 }

References key, SetConfig(), and SharedKey().

Referenced by Effect::SetSharedConfig().

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

◆ SettingsPath()

RegistryPath PluginManager::SettingsPath ( const PluginID ID,
bool  shared 
)
private

Definition at line 3003 of file PluginManager.cpp.

3004 {
3005  // All the strings reported by PluginDescriptor and used in this function
3006  // persist in the plugin settings configuration file, so they should not
3007  // be changed across Audacity versions, or else compatibility of the
3008  // configuration files will break.
3009 
3010  if (mPlugins.find(ID) == mPlugins.end())
3011  {
3012  return wxEmptyString;
3013  }
3014 
3015  const PluginDescriptor & plug = mPlugins[ID];
3016 
3017  wxString id = GetPluginTypeString(plug.GetPluginType()) +
3018  wxT("_") +
3019  plug.GetEffectFamily() + // is empty for non-Effects
3020  wxT("_") +
3021  plug.GetVendor() +
3022  wxT("_") +
3023  (shared ? wxT("") : plug.GetSymbol().Internal());
3024 
3025  return SETROOT +
3026  ConvertID(id) +
3027  wxCONFIG_PATH_SEPARATOR +
3028  (shared ? wxT("shared") : wxT("private")) +
3029  wxCONFIG_PATH_SEPARATOR;
3030 }

References ConvertID(), PluginDescriptor::GetEffectFamily(), PluginDescriptor::GetPluginType(), GetPluginTypeString(), PluginDescriptor::GetSymbol(), PluginDescriptor::GetVendor(), ComponentInterfaceSymbol::Internal(), mPlugins, and SETROOT.

Referenced by PrivateGroup(), and SharedGroup().

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

◆ SharedGroup()

RegistryPath PluginManager::SharedGroup ( const PluginID ID,
const RegistryPath group 
)
private

Definition at line 3033 of file PluginManager.cpp.

3034 {
3035  wxString path = SettingsPath(ID, true);
3036 
3037  wxFileName ff(group);
3038  if (!ff.GetName().empty())
3039  {
3040  path += ff.GetFullPath(wxPATH_UNIX) + wxCONFIG_PATH_SEPARATOR;
3041  }
3042 
3043  return path;
3044 }

References SettingsPath().

Referenced by GetSharedConfigSubgroups(), HasSharedConfigGroup(), RemoveSharedConfigSubgroup(), and SharedKey().

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

◆ SharedKey()

RegistryPath PluginManager::SharedKey ( const PluginID ID,
const RegistryPath group,
const RegistryPath key 
)
private

Definition at line 3047 of file PluginManager.cpp.

3048 {
3049  auto path = SharedGroup(ID, group);
3050  if (path.empty())
3051  {
3052  return path;
3053  }
3054 
3055  return path + key;
3056 }

References key, and SharedGroup().

Referenced by GetSharedConfig(), RemoveSharedConfig(), and SetSharedConfig().

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

◆ ShowManager()

bool PluginManager::ShowManager ( wxWindow *  parent,
EffectType  type = EffectTypeNone 
)

Definition at line 2478 of file PluginManager.cpp.

2479 {
2480  CheckForUpdates();
2481 
2482  PluginRegistrationDialog dlg(parent, type);
2483  return dlg.ShowModal() == wxID_OK;
2484 }

References CheckForUpdates().

Here is the call graph for this function:

◆ Terminate()

void PluginManager::Terminate ( )

Definition at line 1791 of file PluginManager.cpp.

1792 {
1793  // Get rid of all non-module plugins first
1794  PluginMap::iterator iter = mPlugins.begin();
1795  while (iter != mPlugins.end())
1796  {
1797  PluginDescriptor & plug = iter->second;
1798  if (plug.GetPluginType() == PluginTypeEffect)
1799  {
1800  mPlugins.erase(iter++);
1801  continue;
1802  }
1803 
1804  ++iter;
1805  }
1806 
1807  // Now get rid of the modules
1808  iter = mPlugins.begin();
1809  while (iter != mPlugins.end())
1810  {
1811  mPlugins.erase(iter++);
1812  }
1813 }

References PluginDescriptor::GetPluginType(), mPlugins, and PluginTypeEffect.

Referenced by AudacityApp::OnExit(), and ~PluginManager().

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

◆ UnregisterPlugin()

void PluginManager::UnregisterPlugin ( const PluginID ID)

Definition at line 2509 of file PluginManager.cpp.

2510 {
2511  if (mPlugins.find(ID) == mPlugins.end())
2512  {
2513  return;
2514  }
2515 
2516  mPlugins.erase(ID);
2517 }

References mPlugins.

Referenced by EffectManager::UnregisterEffect().

Here is the caller graph for this function:

Friends And Related Function Documentation

◆ PluginRegistrationDialog

friend class PluginRegistrationDialog
friend

Definition at line 324 of file PluginManager.h.

Member Data Documentation

◆ mCurrentIndex

int PluginManager::mCurrentIndex
private

Definition at line 319 of file PluginManager.h.

◆ mDirty

bool PluginManager::mDirty
private

Definition at line 318 of file PluginManager.h.

◆ mInstance

std::unique_ptr< PluginManager > PluginManager::mInstance {}
staticprivate

Definition at line 312 of file PluginManager.h.

Referenced by Get().

◆ mPlugins

PluginMap PluginManager::mPlugins
private

◆ mPluginsIter

PluginMap::iterator PluginManager::mPluginsIter
private

◆ mSettings

std::unique_ptr<FileConfig> PluginManager::mSettings
private

Definition at line 316 of file PluginManager.h.

Referenced by GetSettings(), and PluginManager().


The documentation for this class was generated from the following files:
PluginManager::b64decode
int b64decode(const wxString &in, void *out)
Definition: PluginManager.cpp:3153
FileConfig::SetPath
virtual void SetPath(const wxString &strPath) wxOVERRIDE
Definition: FileConfig.cpp:101
TranslatableString
Definition: Types.h:290
FileNames::PluginRegistry
AUDACITY_DLL_API FilePath PluginRegistry()
KEY_EFFECTFAMILY
#define KEY_EFFECTFAMILY
Definition: PluginManager.cpp:1363
PluginManager::Save
void Save()
Definition: PluginManager.cpp:2272
FileNames::DoCopyFile
AUDACITY_DLL_API bool DoCopyFile(const FilePath &file1, const FilePath &file2, bool overwrite=true)
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
PluginDescriptor::IsEffectInteractive
bool IsEffectInteractive() const
Definition: PluginManager.cpp:1252
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:625
PluginManager::GetPluginTypeString
static wxString GetPluginTypeString(PluginType type)
Definition: PluginManager.cpp:2729
PluginDescriptor::IsEffectRealtime
bool IsEffectRealtime() const
Definition: PluginManager.cpp:1267
ComponentInterfaceSymbol::Translation
const wxString Translation() const
Definition: ComponentInterface.h:91
PluginManager::mPlugins
PluginMap mPlugins
Definition: PluginManager.h:321
ComponentInterface::GetSymbol
virtual ComponentInterfaceSymbol GetSymbol()=0
PluginDescriptor::GetEffectFamily
wxString GetEffectFamily() const
Definition: PluginManager.cpp:1242
KEY_EFFECTTYPE_NONE
#define KEY_EFFECTTYPE_NONE
Definition: PluginManager.cpp:1368
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
PluginDescriptor::SetPath
void SetPath(const PluginPath &path)
Definition: PluginManager.cpp:1210
PluginManager::SharedKey
RegistryPath SharedKey(const PluginID &ID, const RegistryPath &group, const RegistryPath &key)
Definition: PluginManager.cpp:3047
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
PluginDescriptor::GetImporterExtensions
const FileExtensions & GetImporterExtensions() const
Definition: PluginManager.cpp:1324
PluginManager::mPluginsIter
PluginMap::iterator mPluginsIter
Definition: PluginManager.h:322
PluginDescriptor::SetEffectAutomatable
void SetEffectAutomatable(bool automatable)
Definition: PluginManager.cpp:1307
PluginManager::GetConfig
bool GetConfig(const RegistryPath &key, wxString &value, const wxString &defval=L"")
Definition: PluginManager.cpp:2865
PluginDescriptor::GetProviderID
const wxString & GetProviderID() const
Definition: PluginManager.cpp:1160
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:58
PluginManager::GetSymbol
const ComponentInterfaceSymbol & GetSymbol(const PluginID &ID)
Definition: PluginManager.cpp:2653
PluginType
PluginType
Definition: PluginManager.h:33
cset
static const wxChar cset[]
Definition: PluginManager.cpp:3110
PluginDescriptor::GetPluginType
PluginType GetPluginType() const
Definition: PluginManager.cpp:1150
KEY_IMPORTEREXTENSIONS
#define KEY_IMPORTEREXTENSIONS
Definition: PluginManager.cpp:1376
Format
Abstract base class used in importing a file.
KEY_PATH
#define KEY_PATH
Definition: PluginManager.cpp:1352
EffectTypeNone
@ EffectTypeNone
Definition: EffectInterface.h:56
SETVERKEY
#define SETVERKEY
Definition: PluginManager.cpp:1347
EffectDefinitionInterface::IsInteractive
virtual bool IsInteractive()=0
FileConfig::DeleteEntry
virtual bool DeleteEntry(const wxString &key, bool bDeleteGroupIfEmpty=true) wxOVERRIDE
Definition: FileConfig.cpp:217
XO
#define XO(s)
Definition: Internat.h:32
PluginDescriptor::SetEffectInteractive
void SetEffectInteractive(bool interactive)
Definition: PluginManager.cpp:1287
PluginDescriptor::IsEffectAutomatable
bool IsEffectAutomatable() const
Definition: PluginManager.cpp:1272
ModuleInterface::InstallPath
virtual FilePath InstallPath()=0
KEY_IMPORTERIDENT
#define KEY_IMPORTERIDENT
Definition: PluginManager.cpp:1374
EffectDefinitionInterface::SupportsRealtime
virtual bool SupportsRealtime()=0
PluginRegistrationDialog
Definition: PluginManager.cpp:419
ModuleManager::IsPluginValid
bool IsPluginValid(const PluginID &provider, const PluginPath &path, bool bFast)
Definition: ModuleManager.cpp:612
FileConfig::GetFirstGroup
virtual bool GetFirstGroup(wxString &str, long &lIndex) const wxOVERRIDE
Definition: FileConfig.cpp:111
EffectDefinitionInterface::SupportsAutomation
virtual bool SupportsAutomation()=0
PluginManager::HasGroup
bool HasGroup(const RegistryPath &group)
Definition: PluginManager.cpp:2811
ComponentInterfaceSymbol::Msgid
const TranslatableString & Msgid() const
Definition: ComponentInterface.h:89
wxArrayStringEx
Definition: MemoryX.h:663
ModuleManager::DiscoverProviders
bool DiscoverProviders()
Definition: ModuleManager.cpp:404
PluginDescriptor::SetProviderID
void SetProviderID(const PluginID &providerID)
Definition: PluginManager.cpp:1205
PluginTypeImporter
@ PluginTypeImporter
Definition: PluginManager.h:39
desc
const TranslatableString desc
Definition: ExportPCM.cpp:56
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
PluginManager::SettingsPath
RegistryPath SettingsPath(const PluginID &ID, bool shared)
Definition: PluginManager.cpp:3003
PluginDescriptor::SetImporterExtensions
void SetImporterExtensions(FileExtensions extensions)
Definition: PluginManager.cpp:1330
ImporterInterface::GetPluginStringID
virtual wxString GetPluginStringID()=0
KEY_VENDOR
#define KEY_VENDOR
Definition: PluginManager.cpp:1355
ComponentInterface::GetVendor
virtual VendorSymbol GetVendor()=0
PluginTypeModule
@ PluginTypeModule
Definition: PluginManager.h:40
ModuleInterface
Definition: ModuleInterface.h:68
PluginDescriptor::GetVendor
wxString GetVendor() const
Definition: PluginManager.cpp:1180
PluginDescriptor::SetSymbol
void SetSymbol(const ComponentInterfaceSymbol &symbol)
Definition: PluginManager.cpp:1215
FileConfig::GetNextGroup
virtual bool GetNextGroup(wxString &str, long &lIndex) const wxOVERRIDE
Definition: FileConfig.cpp:116
KEY_EFFECTINTERACTIVE
#define KEY_EFFECTINTERACTIVE
Definition: PluginManager.cpp:1365
PluginDescriptor::SetValid
void SetValid(bool valid)
Definition: PluginManager.cpp:1235
ModuleManager::IsProviderValid
bool IsProviderValid(const PluginID &provider, const PluginPath &path)
Definition: ModuleManager.cpp:594
ModuleManager
Definition: ModuleManager.h:79
KEY_NAME
#define KEY_NAME
Definition: PluginManager.cpp:1354
KEY_PROVIDERID
#define KEY_PROVIDERID
Definition: PluginManager.cpp:1361
PluginManager::SharedGroup
RegistryPath SharedGroup(const PluginID &ID, const RegistryPath &group)
Definition: PluginManager.cpp:3033
XPC
#define XPC(sing, plur, n, c)
Definition: Internat.h:101
ComponentInterface::GetPath
virtual PluginPath GetPath()=0
KEY_ENABLED
#define KEY_ENABLED
Definition: PluginManager.cpp:1359
AudacityFileConfig::Create
static std::unique_ptr< AudacityFileConfig > Create(const wxString &appName={}, const wxString &vendorName={}, const wxString &localFilename={}, const wxString &globalFilename={}, long style=wxCONFIG_USE_LOCAL_FILE|wxCONFIG_USE_GLOBAL_FILE, const wxMBConv &conv=wxConvAuto())
Require a call to this factory, to guarantee proper two-phase initialization.
Definition: AudacityFileConfig.cpp:36
PluginID
wxString PluginID
Definition: EffectManager.h:30
ModuleManager::Get
static ModuleManager & Get()
Definition: ModuleManager.cpp:394
PluginManager::mSettings
std::unique_ptr< FileConfig > mSettings
Definition: PluginManager.h:316
PluginDescriptor::GetUntranslatedVersion
wxString GetUntranslatedVersion() const
Definition: PluginManager.cpp:1175
name
const TranslatableString name
Definition: Distortion.cpp:98
SETVERCUR
#define SETVERCUR
Definition: PluginManager.cpp:1348
EffectTypeTool
@ EffectTypeTool
Definition: EffectInterface.h:61
SETROOT
#define SETROOT
Definition: PluginManager.cpp:1349
ModuleManager::FindPluginsForProvider
PluginPaths FindPluginsForProvider(const PluginID &provider, const PluginPath &path)
Definition: ModuleManager.cpp:532
PluginDescriptor::SetImporterIdentifier
void SetImporterIdentifier(const wxString &identifier)
Definition: PluginManager.cpp:1319
PluginDescriptor
Definition: PluginManager.h:45
EffectDefinitionInterface::GetType
virtual EffectType GetType()=0
FileNames::PluginSettings
AUDACITY_DLL_API FilePath PluginSettings()
EffectTypeHidden
@ EffectTypeHidden
Definition: EffectInterface.h:57
PluginManager::Load
void Load()
Definition: PluginManager.cpp:1929
PluginDescriptor::SetEffectFamily
void SetEffectFamily(const wxString &family)
Definition: PluginManager.cpp:1277
PluginManager::SaveGroup
void SaveGroup(FileConfig *pRegistry, PluginType type)
Definition: PluginManager.cpp:2303
KEY_EFFECTDEFAULT
#define KEY_EFFECTDEFAULT
Definition: PluginManager.cpp:1364
KEY_EFFECTAUTOMATABLE
#define KEY_EFFECTAUTOMATABLE
Definition: PluginManager.cpp:1367
EffectDefinitionInterface::GetClassification
virtual EffectType GetClassification()
Definition: EffectInterface.h:81
KEY_SYMBOL
#define KEY_SYMBOL
Definition: PluginManager.cpp:1353
FileConfig::DeleteGroup
virtual bool DeleteGroup(const wxString &key) wxOVERRIDE
Definition: FileConfig.cpp:227
id
int id
Definition: WaveTrackControls.cpp:589
KEY_VERSION
#define KEY_VERSION
Definition: PluginManager.cpp:1356
PluginDescriptor::GetID
const wxString & GetID() const
Definition: PluginManager.cpp:1155
PluginManager::mInstance
static std::unique_ptr< PluginManager > mInstance
Definition: PluginManager.h:312
PluginManagerInterface::DefaultRegistrationCallback
static const PluginID & DefaultRegistrationCallback(ModuleInterface *provider, ComponentInterface *ident)
Definition: PluginManager.cpp:1384
PluginManager::CreatePlugin
PluginDescriptor & CreatePlugin(const PluginID &id, ComponentInterface *ident, PluginType type)
Definition: PluginManager.cpp:2762
PluginDescriptor::GetEffectType
EffectType GetEffectType() const
Definition: PluginManager.cpp:1247
FileNames::PlugInDir
AUDACITY_DLL_API FilePath PlugInDir()
The user plug-in directory (not a system one)
PluginManager::CheckForUpdates
void CheckForUpdates(bool bFast=false)
Definition: PluginManager.cpp:2388
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:151
PluginManager::b64encode
wxString b64encode(const void *in, int len)
Definition: PluginManager.cpp:3113
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:196
PluginDescriptor::IsEnabled
bool IsEnabled() const
Definition: PluginManager.cpp:1185
PluginManager
PluginManager maintains a list of all plug ins. That covers modules, effects, generators,...
Definition: PluginManager.h:172
KEY_EFFECTREALTIME
#define KEY_EFFECTREALTIME
Definition: PluginManager.cpp:1366
PluginDescriptor::SetEffectRealtime
void SetEffectRealtime(bool realtime)
Definition: PluginManager.cpp:1302
names
static TranslatableStrings names
Definition: Tags.cpp:743
KEY_EFFECTTYPE_ANALYZE
#define KEY_EFFECTTYPE_ANALYZE
Definition: PluginManager.cpp:1369
PluginDescriptor::GetInstance
ComponentInterface * GetInstance()
Definition: PluginManager.cpp:1120
PluginManager::GetID
static PluginID GetID(ModuleInterface *module)
Definition: PluginManager.cpp:2687
KEY_EFFECTTYPE
#define KEY_EFFECTTYPE
Definition: PluginManager.cpp:1362
PluginTypeNone
@ PluginTypeNone
Definition: PluginManager.h:34
REGROOT
#define REGROOT
Definition: PluginManager.cpp:1344
EffectTypeAnalyze
@ EffectTypeAnalyze
Definition: EffectInterface.h:60
KEY_EFFECTTYPE_GENERATE
#define KEY_EFFECTTYPE_GENERATE
Definition: PluginManager.cpp:1370
PluginDescriptor::GetImporterIdentifier
const wxString & GetImporterIdentifier() const
Definition: PluginManager.cpp:1314
Verbatim
TranslatableString Verbatim(wxString str)
Definition: Types.h:581
PluginDescriptor::SetEffectType
void SetEffectType(EffectType type)
Definition: PluginManager.cpp:1282
KEY_DESCRIPTION
#define KEY_DESCRIPTION
Definition: PluginManager.cpp:1357
ModuleInterface::GetOptionalFamilySymbol
virtual EffectFamilySymbol GetOptionalFamilySymbol()=0
PluginDescriptor::GetSymbol
const ComponentInterfaceSymbol & GetSymbol() const
Definition: PluginManager.cpp:1170
ComponentInterfaceSymbol::Internal
const wxString & Internal() const
Definition: ComponentInterface.h:88
PluginDescriptor::IsEffectLegacy
bool IsEffectLegacy() const
Definition: PluginManager.cpp:1262
PluginManager::GetFirstPlugin
const PluginDescriptor * GetFirstPlugin(int type)
Definition: PluginManager.cpp:2544
KEY_EFFECTTYPE_PROCESS
#define KEY_EFFECTTYPE_PROCESS
Definition: PluginManager.cpp:1371
ImporterInterface::GetSupportedExtensions
virtual FileExtensions GetSupportedExtensions()=0
ComponentInterface
ComponentInterface provides name / vendor / version functions to identify plugins....
Definition: ComponentInterface.h:121
PluginTypeExporter
@ PluginTypeExporter
Definition: PluginManager.h:38
PluginDescriptor::IsEffectDefault
bool IsEffectDefault() const
Definition: PluginManager.cpp:1257
PluginDescriptor::IsValid
bool IsValid() const
Definition: PluginManager.cpp:1190
TranslatableString::MSGID
Identifier MSGID() const
Definition: Types.h:335
PluginDescriptor::SetEnabled
void SetEnabled(bool enable)
Definition: PluginManager.cpp:1230
PluginDescriptor::SetVendor
void SetVendor(const wxString &vendor)
Definition: PluginManager.cpp:1225
KEY_EFFECTTYPE_HIDDEN
#define KEY_EFFECTTYPE_HIDDEN
Definition: PluginManager.cpp:1373
PluginDescriptor::GetPath
const PluginPath & GetPath() const
Definition: PluginManager.cpp:1165
REGVERCUR
#define REGVERCUR
Definition: PluginManager.cpp:1343
PluginDescriptor::SetVersion
void SetVersion(const wxString &version)
Definition: PluginManager.cpp:1220
PluginDescriptor::SetEffectLegacy
void SetEffectLegacy(bool legacy)
Definition: PluginManager.cpp:1297
PluginManager::ConvertID
wxString ConvertID(const PluginID &ID)
Definition: PluginManager.cpp:3086
PluginManager::GetSubgroups
bool GetSubgroups(const RegistryPath &group, RegistryPaths &subgroups)
Definition: PluginManager.cpp:2828
PluginTypeAudacityCommand
@ PluginTypeAudacityCommand
Definition: PluginManager.h:37
PluginManager::PrivateKey
RegistryPath PrivateKey(const PluginID &ID, const RegistryPath &group, const RegistryPath &key)
Definition: PluginManager.cpp:3073
ComponentInterface::GetVersion
virtual wxString GetVersion()=0
EffectType
EffectType
Definition: EffectInterface.h:55
safenew
#define safenew
Definition: MemoryX.h:8
settings
static Settings & settings()
Definition: TrackInfo.cpp:87
PluginManager::LoadGroup
void LoadGroup(FileConfig *pRegistry, PluginType type)
Definition: PluginManager.cpp:2013
PluginManager::GetNextPlugin
const PluginDescriptor * GetNextPlugin(int type)
Definition: PluginManager.cpp:2568
KEY_EFFECTTYPE_TOOL
#define KEY_EFFECTTYPE_TOOL
Definition: PluginManager.cpp:1372
PluginManager::PrivateGroup
RegistryPath PrivateGroup(const PluginID &ID, const RegistryPath &group)
Definition: PluginManager.cpp:3059
EffectDefinitionInterface::GetFamily
virtual EffectFamilySymbol GetFamily()=0
PluginManager::Terminate
void Terminate()
Definition: PluginManager.cpp:1791
PlatformCompatibility::GetExecutablePath
static const FilePath & GetExecutablePath()
Definition: PlatformCompatibility.cpp:33
PluginTypeEffect
@ PluginTypeEffect
Definition: PluginManager.h:36
PluginManager::GetPlugin
const PluginDescriptor * GetPlugin(const PluginID &ID)
Definition: PluginManager.cpp:2534
PluginManager::GetPluginEnabledSetting
RegistryPath GetPluginEnabledSetting(const PluginID &ID)
Definition: PluginManager.cpp:1407
KEY_VALID
#define KEY_VALID
Definition: PluginManager.cpp:1360
ArrayOf< char >
REGVERKEY
#define REGVERKEY
Definition: PluginManager.cpp:1342
PluginDescriptor::SetInstance
void SetInstance(ComponentInterface *instance)
Definition: PluginManager.cpp:1137
PluginDescriptor::SetEffectDefault
void SetEffectDefault(bool dflt)
Definition: PluginManager.cpp:1292
PluginTypeStub
@ PluginTypeStub
Definition: PluginManager.h:35
EffectDefinitionInterface::IsDefault
virtual bool IsDefault()=0
PluginDescriptor::SetPluginType
void SetPluginType(PluginType type)
Definition: PluginManager.cpp:1195
PluginDescriptor::SetID
void SetID(const PluginID &ID)
Definition: PluginManager.cpp:1200
PluginManager::GetSettings
FileConfig * GetSettings()
Definition: PluginManager.cpp:2780
PluginManager::SetConfig
bool SetConfig(const RegistryPath &key, const wxString &value)
Definition: PluginManager.cpp:2921
padc
static const char padc
Definition: PluginManager.cpp:3111
FileConfig::GetPath
virtual const wxString & GetPath() const wxOVERRIDE
Definition: FileConfig.cpp:106