mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-21 14:02:57 +02:00
Initialize tables of effect and command names properly
This commit is contained in:
@@ -100,14 +100,16 @@ enum
|
||||
// Redefine COMMAND() to add the COMMAND's name to an array
|
||||
//
|
||||
#undef COMMAND
|
||||
#define COMMAND(n, i, args) (n ## _PLUGIN_SYMBOL).Internal(),
|
||||
#define COMMAND(n, i, args) results.push_back( (n ## _PLUGIN_SYMBOL).Internal() );
|
||||
|
||||
//
|
||||
// Create the COMMAND name array
|
||||
//
|
||||
static const wxChar *kCOMMANDNames[] =
|
||||
static const std::vector<wxString> kCOMMANDNames()
|
||||
{
|
||||
COMMAND_LIST
|
||||
std::vector<wxString> results;
|
||||
COMMAND_LIST;
|
||||
return results;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -203,10 +205,11 @@ wxString BuiltinCommandsModule::GetDescription()
|
||||
|
||||
bool BuiltinCommandsModule::Initialize()
|
||||
{
|
||||
for (size_t i = 0; i < WXSIZEOF(kCOMMANDNames); i++)
|
||||
const auto &names = kCOMMANDNames();
|
||||
for (const auto &name : names)
|
||||
{
|
||||
wxLogDebug("Adding %s", kCOMMANDNames[i] );
|
||||
mNames.Add(wxString(BUILTIN_GENERIC_COMMAND_PREFIX) + kCOMMANDNames[i]);
|
||||
wxLogDebug("Adding %s", name );
|
||||
mNames.Add(wxString(BUILTIN_GENERIC_COMMAND_PREFIX) + name);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -228,9 +231,10 @@ void BuiltinCommandsModule::Terminate()
|
||||
bool BuiltinCommandsModule::AutoRegisterPlugins(PluginManagerInterface & pm)
|
||||
{
|
||||
wxString ignoredErrMsg;
|
||||
for (size_t i = 0; i < WXSIZEOF(kCOMMANDNames); i++)
|
||||
const auto &names = kCOMMANDNames();
|
||||
for (const auto &name : names)
|
||||
{
|
||||
wxString path(wxString(BUILTIN_GENERIC_COMMAND_PREFIX) + kCOMMANDNames[i]);
|
||||
wxString path(wxString(BUILTIN_GENERIC_COMMAND_PREFIX) + name);
|
||||
|
||||
if (!pm.IsPluginRegistered(path))
|
||||
{
|
||||
|
Reference in New Issue
Block a user