Factory class for creating and identifying different types of WavetableComponents.
More...
#include <wavetable_component_factory.h>
|
enum | ComponentType {
kWaveSource
, kLineSource
, kFileSource
, kNumSourceTypes
,
kShepardToneSource = kNumSourceTypes
, kBeginModifierTypes = kNumSourceTypes + 1
, kPhaseModifier = kBeginModifierTypes
, kWaveWindow
,
kFrequencyFilter
, kSlewLimiter
, kWaveFolder
, kWaveWarp
,
kNumComponentTypes
} |
| Enumerates all known WavetableComponents, including sources and modifiers. More...
|
|
Factory class for creating and identifying different types of WavetableComponents.
WavetableComponentFactory allows creation of source and modifier components by type enumerations or by name strings. It provides:
- A set of enumerated ComponentTypes representing both wave sources and waveform modifiers.
- Functions to create a component instance from a ComponentType or a string name.
- Methods to retrieve human-readable names of components.
- Separations of components into source and modifier categories.
◆ ComponentType
Enumerates all known WavetableComponents, including sources and modifiers.
Enumerator |
---|
kWaveSource | A basic wave source.
|
kLineSource | A line-based wave source.
|
kFileSource | A file-based audio source.
|
kNumSourceTypes | Marks the end of source types.
|
kShepardToneSource | |
kBeginModifierTypes | |
kPhaseModifier | Modifier that shifts phase.
|
kWaveWindow | Modifier that applies window functions to the wave.
|
kFrequencyFilter | Modifier that filters frequency components.
|
kSlewLimiter | Modifier that limits slew rate.
|
kWaveFolder | Modifier that applies wave folding.
|
kWaveWarp | Modifier that warps the waveform.
|
kNumComponentTypes | Total count of all component types.
|
◆ createComponent() [1/2]
◆ createComponent() [2/2]
WavetableComponent * WavetableComponentFactory::createComponent |
( |
const std::string & | type | ) |
|
|
static |
◆ getComponentName()
std::string WavetableComponentFactory::getComponentName |
( |
ComponentType | type | ) |
|
|
static |
Gets the human-readable name of a component from its enumerated type.
- Parameters
-
type | The ComponentType enumerated value. |
- Returns
- The corresponding component name as a std::string.
◆ getModifierType()
static ComponentType WavetableComponentFactory::getModifierType |
( |
int | type | ) |
|
|
inlinestatic |
Converts an integer index to a modifier ComponentType.
- Parameters
-
type | The integer index for modifier types. |
- Returns
- The corresponding ComponentType for a modifier.
◆ getSourceType()
static ComponentType WavetableComponentFactory::getSourceType |
( |
int | type | ) |
|
|
inlinestatic |
Converts an integer index to a source ComponentType.
- Parameters
-
type | The integer index representing a source type. |
- Returns
- The corresponding ComponentType.
◆ numComponentTypes()
static int WavetableComponentFactory::numComponentTypes |
( |
| ) |
|
|
inlinestatic |
Returns the total number of component types defined.
- Returns
- The total count of component types.
◆ numModifierTypes()
static int WavetableComponentFactory::numModifierTypes |
( |
| ) |
|
|
inlinestatic |
Returns the number of modifier types defined.
- Returns
- The number of modifier component types.
◆ numSourceTypes()
static int WavetableComponentFactory::numSourceTypes |
( |
| ) |
|
|
inlinestatic |
Returns the number of source types defined.
- Returns
- The number of source component types.
The documentation for this class was generated from the following files: