MCPcopy Create free account
hub / github.com/audacity/audacity / Load

Method Load

libraries/lib-ladspa/LadspaEffectBase.cpp:360–397  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358// ============================================================================
359
360bool LadspaEffectBase::Load()
361{
362 if (mLib.IsLoaded())
363 {
364 return true;
365 }
366
367 wxFileName ff = mPath;
368 wxString envpath;
369 bool hadpath = wxGetEnv(wxT("PATH"), &envpath);
370 wxSetEnv(wxT("PATH"), ff.GetPath() + wxFILE_SEP_PATH + envpath);
371 wxString saveOldCWD = ff.GetCwd();
372 ff.SetCwd();
373
374 LADSPA_Descriptor_Function mainFn = NULL;
375
376 if (mLib.Load(mPath, wxDL_NOW))
377 {
378 wxLogNull logNo;
379
380 mainFn = (LADSPA_Descriptor_Function) mLib.GetSymbol(wxT("ladspa_descriptor"));
381 if (mainFn)
382 {
383 mData = mainFn(mIndex);
384 return true;
385 }
386 }
387
388 if (mLib.IsLoaded())
389 {
390 mLib.Unload();
391 }
392
393 wxSetWorkingDirectory(saveOldCWD);
394 hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));
395
396 return false;
397}
398
399void LadspaEffectBase::Unload()
400{

Callers 1

DiscoverPluginsAtPathMethod · 0.45

Calls 3

GetPathMethod · 0.45
GetSymbolMethod · 0.45
UnloadMethod · 0.45

Tested by

no test coverage detected