SFXParameter
Engine/source/sfx/sfxParameter.h
Parameter for interactive audio.
Callbacks
DECLARE_CALLBACK(void , onUpdate , () )
Public Types
Signal< void(SFXParameter *parameter, SFXParameterEvent event) >
EventSignal
Parent
Protected Attributes
The channel being controlled by this parameter.
Value assigned to the parameter on creation and reset.
Help text.
The signal used to notify attached sources of parameter events.
Protected Static Functions
Public Functions
DECLARE_CATEGORY("SFX" )
DECLARE_DESCRIPTION("" )
Return the parameter channel that is being affected by this parameter.
Return the default value of this parameter.
Return the description text supplied for this parameter.
Return the event signal for this parameter.
bool
onAdd()
Called when the object is added to the sim.
setChannel(SFXChannel channel)
Set the parameter channel that is being affected by this parameter.
setDefaultValue(F32 value)
Set the default value of this parameter.
setDescription(const String & str)
Set the description text for this parameter.
Public Static Functions
find(StringTableEntry name)
Look up a parameter by the given name.
Detailed Description
Parameter for interactive audio.
Parameters are tied to sound sources and will signal value changes so that sound sources may react.
All parameters are global. The name of a parameter is its internal object name.
Like sources, parameters are exclusively client-side.
Callbacks
DECLARE_CALLBACK(void , onUpdate , () )
Public Types
typedef Signal< void(SFXParameter *parameter, SFXParameterEvent event) > EventSignal
typedef SimObject Parent
Protected Attributes
SFXChannel mChannel
The channel being controlled by this parameter.
F32 mDefaultValue
Value assigned to the parameter on creation and reset.
String mDescription
Help text.
EventSignal mEventSignal
The signal used to notify attached sources of parameter events.
Point2F mRange
The min/max range of the parameter's value. Both inclusive.
F32 mValue
The current value.
Protected Static Functions
_setChannel(void * object, const char * index, const char * data)
_setDefaultValue(void * object, const char * index, const char * data)
_setRange(void * object, const char * index, const char * data)
_setValue(void * object, const char * index, const char * data)
Public Functions
SFXParameter()
~SFXParameter()
DECLARE_CATEGORY("SFX" )
DECLARE_CONOBJECT(SFXParameter )
DECLARE_DESCRIPTION("" )
getChannel()
Return the parameter channel that is being affected by this parameter.
getDefaultValue()
Return the default value of this parameter.
This is the value the parameter will be set to when it is added to the system.
getDescription()
Return the description text supplied for this parameter.
This is used to help identify the purpose of a parameter.
getEventSignal()
Return the event signal for this parameter.
getRange()
Return the range of valid values that this parameter may take.
getValue()
Return the current value of this parameter.
onAdd()
Reimplemented from: SimObject
onRemove()
Reimplemented from: SimObject
reset()
Reset the parameter's value to its default.
setChannel(SFXChannel channel)
Set the parameter channel that is being affected by this parameter.
setDefaultValue(F32 value)
Set the default value of this parameter.
This is the value the parameter is set to when it is added to the system.
setDescription(const String & str)
Set the description text for this parameter.
This may be used to help identify the purpose of a parameter.
setRange(const Point2F & range)
Set the valid range for the value of this parameter.
Note that both min and max are inclusive.
setRange(F32 minValue, F32 maxValue)
Set the valid range for the value of this parameter.
Note that both min and max are inclusive.
setValue(F32 value)
Set the parameter's current value.
Will be clamped against the parameter's valid value range. If a value change occurs, a SFXParameterEvent_ValueChange event is fired.
update()
Update the parameter's value.
The default implementation will invoke a script 'onUpdate' method if it is defined and do nothing otherwise.
Public Static Functions
find(StringTableEntry name)
Look up a parameter by the given name.
initPersistFields()