Fader¶
Base class used to create faders.
Detailed Description¶
A fader is used to move a value to a target value during a specific amount of time and according to a fading algorithm. The Fader class implements factory methods to create instances of FaderInstance objects, which are where the value is being transitioned to its target.
The Fader class follows the plugin architecture, and thus, you are able to create your own faders and register them to the Engine by inheriting from this class and by implementing the necessary dependencies.
Public Functions¶
| Type | Name |
|---|---|
| virtual std::shared_ptr< FaderInstance > | CreateInstance () = 0 Creates a new instance of the fader. |
| Fader (AmString name) a new fader instance. | |
| Fader () Default fader constructor. | |
| virtual BezierCurveControlPoints | GetControlPoints () const = 0 Gets the control points of the transition curve used by this fader. |
| const AmString & | GetName () const Gets the name of this fader. |
| virtual | ~Fader () Default destructor. |
Public Static Functions¶
| Type | Name |
|---|---|
| std::shared_ptr< FaderInstance > | Construct (const AmString & name) Creates a new instance of the fader with the given name and returns its pointer. |
| std::shared_ptr< Fader > | Find (const AmString & name) Look up a fader by name. |
| const std::map< AmString, std::shared_ptr< Fader > > & | GetRegistry () Gets the list of registered faders. |
| void | LockRegistry () Locks the faders' registry. |
| void | Register (std::shared_ptr< Fader > fader) Registers a new fader. |
| void | UnlockRegistry () Unlocks the faders' registry. |
| void | Unregister (std::shared_ptr< const Fader > fader) Unregisters a fader. |
Protected Attributes¶
| Type | Name |
|---|---|
| AmString | m_name The name of this fader. |
Public Functions Documentation¶
CreateInstance
Creates a new instance of the fader.
Returns:
A new instance of the fader.
Fader[1/2]
a new fader instance.
Parameters:
nameThe fader name, e.g., "MiniAudioLinear".
Fader[2/2]
Default fader constructor.
Warning:
This constructor is meant for internal faders only.
GetControlPoints
Gets the control points of the transition curve used by this fader.
Returns:
The control points of the transition curve used by this fader.
GetName
Gets the name of this fader.
Returns:
The name of this fader.
Public Static Functions Documentation¶
Construct
Creates a new instance of the fader with the given name and returns its pointer.
Parameters:
-
nameThe name of the fader.
Returns:
The fader with the given name, or nullptr if not found.
Find
Look up a fader by name.
Parameters:
-
nameThe name of the fader to find.
Returns:
The fader with the given name, or nullptr if not found.
GetRegistry
Gets the list of registered faders.
Returns:
The registry of faders.
LockRegistry
Locks the faders' registry.
Warning:
This function is mainly used for internal purposes. It's called before the Engine initialization, to discard the registration of new faders after the engine is fully loaded.
Register
Registers a new fader.
Note:
This method does nothing if the registry is locked.
Parameters:
-
faderThe fader to add in the registry.
See also: LockRegistry, UnlockRegistry
UnlockRegistry
Unlocks the faders' registry.
Warning:
This function is mainly used for internal purposes. It's called after the Engine deinitialization, to allow the registration of new faders after the engine is fully unloaded.
Unregister
Unregisters a fader.
Note:
This method does nothing if the registry is locked.
Parameters:
-
faderThe Fader to remove from the registry.
See also: LockRegistry, UnlockRegistry
Protected Attributes Documentation¶
The documentation for this class was generated from the following file: include/SparkyStudios/Audio/Amplitude/Sound/Fader.h