1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-21 06:40:08 +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

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

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

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

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

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

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

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

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

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