The effect
class provides a foundation for managing sound effects in a program. It serves as a base class for more specific sound effects, such as reverbs.
effect(string&in type)
- Initializes the effect with a specified type.
effect()
- Default constructor.
bool in_range(float value, float min, float max)
- Checks if a value falls within a specified range (
min
tomax
, inclusive).- Remarks: Used internally to validate parameter values.
- Checks if a value falls within a specified range (
bool is_safe(sound@handle)
- Checks if a sound handle is valid and active.
- Remarks: Ensures that the sound handle is usable.
- Checks if a sound handle is valid and active.
bool attach(sound@handle)
- Attaches the effect to a sound handle, if safe, and configures the effect.
- Remarks: Can be used to apply the effect to a regular sound object or a sound pool.
- Attaches the effect to a sound handle, if safe, and configures the effect.
bool configure_effect(sound@handle)
- Configures the effect for a given sound handle.
- Remarks: Should be overridden by derived classes to implement specific effect configurations.
- Configures the effect for a given sound handle.
- The
effect
class provides a foundation for implementing various sound effects. - This class can be used with regular sound objects or the sound pool.
The delay_node
class represents a delay effect, which is an audio effect that repeats a sound after a certain amount of time, creating an echo-like effect. It inherits from the effect
class.
delay_node(float dry, float wet, float decay)
- Initializes the delay effect with specified parameters: dryness, wetness, and decay.
delay_node()
- Default constructor. Initializes the delay effect with default parameter values.
bool set_dry(float value)
- Sets the dry parameter of the delay effect.
bool set_wet(float value)
- Sets the wet parameter of the delay effect.
bool set_decay(float value)
- Sets the decay parameter of the delay effect.
bool config_from_preset(delay_node_preset@preset)
- Configures the delay effect based on a preset.
bool configure_effect(sound@handle)
- Configures the delay effect for a given sound handle.
- The
delay_node
class provides functionality for managing delay effects in audio processing. - Parameter values should be in the range from 0.1 to 1.0.
- This class can be used with regular sound objects or the sound pool.
The reverb
class represents a reverb effect, a type of audio effect commonly used in digital signal processing to simulate reverberation in an environment.
effect
reverb(float dry, float wet, float room_size, float damping, float mode)
- Initializes the reverb effect with specified parameters (
dry
,wet
,room_size
,damping
,mode
). Each parameter should be in the range from 0.1 to 1.0.
- Initializes the reverb effect with specified parameters (
reverb()
- Default constructor.
bool set_dry(float value)
- Sets the dry parameter of the reverb effect.
bool set_wet(float value)
- Sets the wet parameter of the reverb effect.
bool set_room_size(float value)
- Sets the room size parameter of the reverb effect.
bool set_damping(float value)
- Sets the damping parameter of the reverb effect.
bool set_mode(float value)
- Sets the mode parameter of the reverb effect.
bool config_from_preset(reverb_preset@preset)
- Configures the reverb effect based on a preset.
bool configure_effect(sound@handle)
- Configures the reverb effect for a given sound handle.
- The
reverb
class represents a specific type of audio effect used to simulate reverberation. - It inherits from the
effect
class and provides methods to configure reverb parameters. - This class can be used with regular sound objects or the sound pool.
The effect_presets
class stores and manages presets for various sound effects.
effect_presets
: A dictionary used to store effect presets.
effect_preset@find_effect_preset(const string&in name)
: Finds an effect preset by name.
- This class allows for easy retrieval and management of effect presets.
- Presets are stored based on their names and can be accessed using the
find_effect_preset
method.
The effect_preset
class represents a generic sound effect preset.
name
: The name of the preset.effect_type
: The type of effect associated with the preset.
effect_preset(const string&in name, int effect_type)
: Initializes the effect preset with a name and effect type.
- This class serves as a base class for more specific effect presets.
- Effect presets can be of different types, such as reverb or delay.
The reverb_preset
class represents a preset for a reverb effect.
effect_preset
dry
: The dry parameter of the reverb effect.wet
: The wet parameter of the reverb effect.room_size
: The room size parameter of the reverb effect.damping
: The damping parameter of the reverb effect.mode
: The mode parameter of the reverb effect.
reverb_preset(string&in name, float dry, float wet, float room_size, float damping, float mode)
: Initializes the reverb preset with specified parameters.
- This class represents a specific preset for a reverb effect.
- It inherits properties and methods from the
effect_preset
class.
The delay_node_preset
class represents a preset for a delay effect.
effect_preset
dry
: The dry parameter of the delay effect.wet
: The wet parameter of the delay effect.decay
: The decay parameter of the delay effect.
delay_node_preset(string&in name, float dry, float wet, float decay)
: Initializes the delay preset with specified parameters.
- This class represents a specific preset for a delay effect.
- It inherits properties and methods from the
effect_preset
class.