1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 08:30:06 +02:00

Fix Windows build

This commit is contained in:
Paul Licameli 2017-12-31 20:03:52 -05:00
parent 765ca0c813
commit 2e8a73bab1
9 changed files with 23 additions and 12 deletions

View File

@ -116,7 +116,8 @@ public:
// even if some plugins are also discovered successfully.
// Return value is the number of plugins found.
using RegistrationCallback =
std::function< void(ModuleInterface *, EffectIdentInterface *) >;
std::function<
const PluginID &(ModuleInterface *, EffectIdentInterface *) >;
virtual unsigned DiscoverPluginsAtPath(
const wxString & path, wxString &errMsg,
const RegistrationCallback &callback =

View File

@ -1761,8 +1761,8 @@ bool PluginManager::DropFile(const wxString &fileName)
if (!ff.empty() && module->PathsAreFiles()) {
wxString errMsg;
// Do dry-run test of the file format
unsigned nPlugIns = module->DiscoverPluginsAtPath(fileName, errMsg,
[](ModuleInterface *, EffectIdentInterface *){});
unsigned nPlugIns =
module->DiscoverPluginsAtPath(fileName, errMsg, {});
if (nPlugIns) {
// File contents are good for this module, so check no others.
// All branches of this block return true, even in case of
@ -1813,10 +1813,12 @@ bool PluginManager::DropFile(const wxString &fileName)
[&](ModuleInterface *provider, EffectIdentInterface *ident){
// Register as by default, but also collecting the PluginIDs
// and names
ids.push_back(
const auto &id =
PluginManagerInterface::DefaultRegistrationCallback(
provider, ident) );
provider, ident);
ids.push_back(id);
names.push_back( wxGetTranslation( ident->GetName() ) );
return id;
});
if ( ! nPlugIns ) {
// Unlikely after the dry run succeeded

View File

@ -319,7 +319,8 @@ unsigned BuiltinEffectsModule::DiscoverPluginsAtPath(
auto effect = Instantiate(path);
if (effect)
{
callback(this, effect.get());
if (callback)
callback(this, effect.get());
return 1;
}

View File

@ -630,7 +630,8 @@ unsigned VSTEffectsModule::DiscoverPluginsAtPath(
if (!skip && cont)
{
valid = true;
callback( this, &proc );
if (callback)
callback( this, &proc );
++nFound;
}
}

View File

@ -193,7 +193,9 @@ unsigned AudioUnitEffectsModule::DiscoverPluginsAtPath(
return 0;
}
callback(this, &effect);
if(callback)
callback(this, &effect);
return 1;
}

View File

@ -250,7 +250,8 @@ unsigned LadspaEffectsModule::DiscoverPluginsAtPath(
LadspaEffect effect(path, index);
if (effect.SetHost(NULL)) {
++nLoaded;
callback( this, &effect );
if (callback)
callback( this, &effect );
}
else
errMsg = _("Could not load the library");

View File

@ -253,7 +253,8 @@ unsigned LV2EffectsModule::DiscoverPluginsAtPath(
LV2Effect effect(plug);
if (effect.SetHost(NULL))
{
callback( this, &effect );
if (callback)
callback( this, &effect );
return 1;
}
}

View File

@ -223,7 +223,8 @@ unsigned NyquistEffectsModule::DiscoverPluginsAtPath(
NyquistEffect effect(path);
if (effect.IsOk())
{
callback(this, &effect);
if (callback)
callback(this, &effect);
return 1;
}

View File

@ -211,7 +211,8 @@ unsigned VampEffectsModule::DiscoverPluginsAtPath(
if (vp)
{
VampEffect effect(std::move(vp), path, output, hasParameters);
callback( this, &effect );
if (callback)
callback( this, &effect );
return 1;
}