logo
Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related

SynthCore::moduleRegistry Class Reference

Register all modules in this class In order to load Synth presets from an XML file and in order to use the GUI the system needs to 'know' about the modules. It needs a pointer to a constructor so that it can create objects from string representations at run-time. Therefore it is neccesary to register using the 'add' method in the registry. More...

#include <Modules.h>

List of all members.

Public Types

typedef Module *(* newPtr )(SynthVoice *S)
 newPtr is a pointer to function taking a SynthVoice* as argument, and returning a Module*.


Public Methods

void add (string s, newPtr np)
ModulegetNew (string s, SynthVoice *S)
 Lookup the string and return new object.


Static Public Methods

moduleRegistry * getInstance ()


Detailed Description

Register all modules in this class In order to load Synth presets from an XML file and in order to use the GUI the system needs to 'know' about the modules. It needs a pointer to a constructor so that it can create objects from string representations at run-time. Therefore it is neccesary to register using the 'add' method in the registry.

There can only be one instance of this class (the constructor is private) - it is an example of a 'singleton' design pattern.

Definition at line 168 of file Modules.h.


Member Function Documentation

void SynthCore::moduleRegistry::add string    s,
newPtr    np
[inline]
 

Add module to registry. Every module MUST register here in order to be able to be serialized (saved) and in order for the GUI to function properly. The newPtr is a pointer to a static 'constructor' taking a SynthVoice* as argument and returning a new Module *.

Definition at line 179 of file Modules.h.

References newPtr.


The documentation for this class was generated from the following files:
Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen