Dusk Audio Framework
Loading...
Searching...
No Matches
Namespace Macros

Macros

#define DAF_NAMESPACE   DAF
#define START_NAMESPACE_DAF   namespace DAF_NAMESPACE {
#define END_NAMESPACE_DAF   }
#define USE_NAMESPACE_DAF   using namespace DAF_NAMESPACE;

Detailed Description

C Macros to use and customize DAF namespaces.

These are macros that serve as helpers around C++ namespaces, and also as a way to set custom namespaces during a build.

Macro Definition Documentation

◆ DAF_NAMESPACE

#define DAF_NAMESPACE   DAF

Compiler macro that sets the C++ namespace for DAF plugins.
If unset during build, it will use the name DAF by default.

Unless you know exactly what you are doing, you do need to modify this value.
The only probable useful case for customizing it is if you are building a big collection of very similar DAF-based plugins in your application.
For example, having 2 different versions of the same plugin that should behave differently but still exist within the same binary.

On macOS (where due to Objective-C restrictions all code that interacts with Cocoa needs to be in a flat namespace), DAF will automatically use the plugin name as prefix to flat namespace functions in order to avoid conflicts.

So, basically, it is DAF's job to make sure plugin binaries are 100% usable as-is.
You typically do not need to care about this at all.

◆ START_NAMESPACE_DAF

#define START_NAMESPACE_DAF   namespace DAF_NAMESPACE {

Compiler macro that begins the C++ namespace for DAF, as needed for (the DSP side of) plugins.
All classes in DAF are within this namespace except for UI/graphics stuff.

See also
END_NAMESPACE_DAF

◆ END_NAMESPACE_DAF

#define END_NAMESPACE_DAF   }

Close the namespace previously started by START_NAMESPACE_DAF.
This doesn't really need to be a macro, it is just prettier/more consistent that way.

◆ USE_NAMESPACE_DAF

#define USE_NAMESPACE_DAF   using namespace DAF_NAMESPACE;

Make the DAF namespace available in the current function scope.
This is not set by default in order to avoid conflicts with commonly used names such as "Parameter" and "Plugin".