#include <customgui_soundeffector.h>
Sound effector data type (CUSTOMDATATYPE_SOUNDEFFECTOR) for SoundEffectorCustomGui.
- Note
- Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Since
- R19
|
Bool | Sample (Int index, Int count, Float &value, Vector &color) |
|
Bool | SampleArray (Int offset, Int count, Int totalCount, Float *values, Vector *colors) |
|
Bool | SampleArray (Int offset, Int count, Int totalCount, Float *values, Vector *colors) const |
|
◆ SoundEffectorData()
◆ ~SoundEffectorData()
◆ Alloc()
◆ Free()
Destructs SoundEffectorDatas allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.
- Parameters
-
[in,out] | pData | The sound effector data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards. |
◆ InitSampling()
Initializes the sampling functionality of the sound effector data.
- Warning
- Must be called before either Sample() of SampleArray() functions. FreeSampling() must be invoked afterwards.
- Parameters
-
- Returns
- true if successful, otherwise false.
◆ FreeSampling()
Frees the memory used for sampling.
- Warning
- Must be invoked after InitSampling() has been called.
- Returns
- true if successful, otherwise false.
◆ CopyTo()
Copies the sound effector data values into the destination sound effector data.
- Parameters
-
[in] | pDest | The destination sound effector data data. The caller owns the pointed SoundEffectorData.. |
- Returns
- true if successful, otherwise false.
◆ Sample()
Samples the sound file using the probes.
- Parameters
-
[in] | index | The index of the element to sample. |
[in] | count | The number of elements in the array being sampled. |
[out] | value | The output value. |
[out] | color | The output color. |
- Returns
- true if successful, otherwise false.
◆ SampleArray() [1/2]
Samples a subset portion or whole array of elements simultaneously.
- Parameters
-
[in] | offset | The offset from the start of the array that sampling start at. |
[in] | count | The number of elements in this subset. |
[in] | totalCount | The total number of elements being sampled. |
[out] | values | The values, should be the same size as count. |
[out] | colors | The colors, should be the same size as count. |
- Returns
- true if successful, otherwise false.
◆ SampleArray() [2/2]
Samples a subset portion or whole array of elements simultaneously (const version).
- Parameters
-
[in] | offset | The offset from the start of the array that sampling start at. |
[in] | count | The number of elements in this subset. |
[in] | totalCount | The total number of elements being sampled. |
[out] | values | The values, should be the same size as count. |
[out] | colors | The colors, should be the same size as count. |
- Returns
- true if successful, otherwise false.
◆ CreateProbe()
Creates a probe.
- Parameters
-
[in] | left | The left side of the probe in Hertz [1...22050]. |
[in] | right | The right side of the probe in Hertz [1...22050]. |
[in] | top | The top edge of the probe in the range [0...1]. |
[in] | bottom | The bottom edge of the probe in the range [0...1]. |
[in] | selected | pass true to select the created probe (other probes are not deselected in the operation). |
- Returns
- The created probe's index.
◆ CreateDefaultProbe()
Bool CreateDefaultProbe |
( |
| ) |
|
Create default probe
- Returns
- true if successful, otherwise false.
◆ GetProbeCount()
Int GetProbeCount |
( |
| ) |
const |
Retrieves the number of probes owned by the sound effector data.
- Returns
- The probe count.
◆ GetProbe()
Retrieves the probe at the specified index.
- Parameters
-
[in] | index | The probe index. |
- Returns
- The probe, or nullptr if the function fails. The SoundEffectorData owns the pointed probe.
◆ DeleteProbe()
Deletes the probe at the specified index.
- Parameters
-
[in] | index | The index of the probe to delete. |
- Returns
- true if successful, otherwise false.
◆ UpdateProbeOrder()
void UpdateProbeOrder |
( |
| ) |
|
Updates the probes.
- Note
- Must be called after adjusting any probes left or right values to update the order that the probes are calculated in.
◆ GetRange()
Retrieves the range of the sound effector data.
- Warning
- Only valid if the sound effector data is shown in the sound data GUI.
- Parameters
-
[out] | xmin | Assigned the minimum X value. |
[out] | xmax | Assigned the maximum X value. |
[out] | ymin | Assigned the minimum Y value. |
[out] | ymax | Assigned the maximum Y value. |
◆ SetRange()
Sets the range of the sound effector data.
- Warning
- Only valid if the sound effector data is shown in the sound data GUI.
- Parameters
-
[in] | xmin | The minimum X value. |
[in] | xmax | The maximum X value. |
[in] | ymin | The minimum Y value. |
[in] | ymax | The maximum Y value. |
◆ GetLinLog()
Float GetLinLog |
( |
| ) |
const |
Retrieves the blend value for the linear/logarithmic slider.
- Returns
- The blend percentage: 0% = linear, 100% = log10.
◆ SetLinLog()
void SetLinLog |
( |
Float |
value | ) |
|
Sets the the blend value for the linear/logarithmic slider.
- Parameters
-
[in] | value | The blend percentage to set: 0% = linear, 100% = log10. |
◆ GetFreeze()
Retrieves the freeze state.
- Returns
- true if freeze is enabled, otherwise false.
◆ SetFreeze()
void SetFreeze |
( |
Bool |
freeze | ) |
|
Sets the freeze state.
- Parameters
-
[in] | freeze | true to enable freeze, otherwise false. |
◆ GetGradient()
Retrieves the global gradient.
- Returns
- The global gradient, or nullptr if the function fails. The SoundEffectorData owns the pointed gradient.
◆ GetGradientDirection()
Int32 GetGradientDirection |
( |
| ) |
const |
Retrieves the global gradient direction.
- Returns
- The global gradient direction: 0 for vertical (volume), 1 for horizontal (frequency).
◆ SetGradientDirection()
void SetGradientDirection |
( |
Int32 |
direction | ) |
|
Sets the global gradient direction.
- Parameters
-
[in] | direction | The global gradient direction to set: 0 for vertical (volume), 1 for horizontal (frequency). |
◆ IsFFTSamplingCacheDirty()
Check if an FFT Cache is currently up to date.
- Parameters
-
- Returns
- true if successful, otherwise false.
◆ SetActiveSoundTrack()
Sets the active sound track
- Parameters
-
[in] | track | Sound track. |
[in] | doc | The document. |
- Returns
- true if successful, otherwise false.
◆ GetActiveSoundTrack()
Retrieves the active sound track.
- Parameters
-
- Returns
- The active sound track, or nullptr if the function fails. The SoundEffectorData owns the pointed CTrack.