SynthLab SDK
ModuleGetter Class Reference

Object for loading and unloading SyntLab-DM Dynamic Modules which are API-agnostic DLLs (Windows) or dylibs (MacOS). More...

#include <modulegetter.h>

Public Member Functions

 ModuleGetter ()
 

Static Public Member Functions

static SynthLab::ModuleCoreloadSynthDll (std::string moduleName)
 Loads a MacOS dylib. More...
 
static bool unLoadSynthDll (void *moduleHandle)
 Unload a MacOS dylib. More...
 

Detailed Description

Object for loading and unloading SyntLab-DM Dynamic Modules which are API-agnostic DLLs (Windows) or dylibs (MacOS).

  • These use longstanding and very basic functions for DLL management; these functions are extremely well documented.
  • The load/unload functions are static and so may be invoked without an underlying object declaration
  • It is important to retain the module handle that is returned from the creation functions; this handle is required to unload the module at destruction time.
Author
Will Pirkle http://www.willpirkle.com
Remarks
This object is included and described in further detail in Designing Software Synthesizer Plugins in C++ 2nd Ed. by Will Pirkle
Version
Revision : 1.0
Date
Date : 2021 / 04 / 26

Constructor & Destructor Documentation

◆ ModuleGetter()

ModuleGetter::ModuleGetter ( )
inline

empty constructor/destructor

Member Function Documentation

◆ loadSynthDll()

SynthLab::ModuleCore * ModuleGetter::loadSynthDll ( std::string  moduleName)
static

Loads a MacOS dylib.

two functions only: load and unload

  • opens the dylib
  • queries for creation function
  • uses returned function pointer to create module
Parameters
moduleNamethe name of the file, e.g. biquadfilters.dylib
Returns
a pointer to the object if sucessful, nullptr otherwise

◆ unLoadSynthDll()

bool ModuleGetter::unLoadSynthDll ( void *  moduleHandle)
static

Unload a MacOS dylib.

Parameters
moduleHandlethe cached handle that was returned when the object was created.
Returns
true if successful

The documentation for this class was generated from the following files: