SoundEffectorData Class Reference

#include <customgui_soundeffector.h>

Inheritance diagram for SoundEffectorData:

详细描述

Sound effector data type ( CUSTOMDATATYPE_SOUNDEFFECTOR ) for SoundEffectorCustomGui .

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.
由于
R19

Private Constructor/Destructor

  SoundEffectorData ()
  ~SoundEffectorData ()

Alloc/Free

static SoundEffectorData Alloc ()
static void  Free ( SoundEffectorData *&pData)

Init/Free Sampling

Bool   InitSampling ( BaseDocument *doc)
Bool   FreeSampling ()

拷贝

Bool   CopyTo ( SoundEffectorData *pDest)

Sample

Bool   Sample ( Int index, Int count, Float &value, 向量 &color)
Bool   SampleArray ( Int offset, Int count, Int totalCount, Float *values, 向量 *colors)
Bool   SampleArray ( Int offset, Int count, Int totalCount, Float *values, 向量 *colors) const

Probes

Int   CreateProbe ( Float left=1.0, Float right=22050.0, Float top=1.0, Float bottom=0.0, Bool selected=false)
Bool   CreateDefaultProbe ()
Int   GetProbeCount () const
Probe GetProbe ( Int index) const
Bool   DeleteProbe ( Int index)
void  UpdateProbeOrder ()

Range

void  GetRange ( Float *xmin, Float *xmax, Float *ymin, Float *ymax) const
void  SetRange ( Float xmin, Float xmax, Float ymin, Float ymax)

杂项

Float   GetLinLog () const
void  SetLinLog ( Float value)
Bool   GetFreeze () const
void  SetFreeze ( Bool freeze)
渐变 GetGradient () const
Int32   GetGradientDirection () const
void  SetGradientDirection ( Int32 direction)
Bool   IsFFTSamplingCacheDirty ( BaseDocument &doc) const

SoundTrack

Bool   SetActiveSoundTrack ( CTrack *track, BaseDocument *doc)
CTrack GetActiveSoundTrack ( BaseDocument *doc)

构造函数 & 析构函数文档编制

◆  SoundEffectorData()

SoundEffectorData () private

◆  ~SoundEffectorData()

~ SoundEffectorData () private

成员函数文档编制

◆  Alloc()

static SoundEffectorData * Alloc ( )
static

Allocates a SoundEffectorData . Destroy the allocated SoundEffectorData with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated sound effector data, or nullptr if the allocation failed.

◆  Free()

static void Free ( SoundEffectorData *&  pData )
static

Destructs SoundEffectorDatas allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] pData The sound effector data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  InitSampling()

Bool InitSampling ( BaseDocument doc )

Initializes the sampling functionality of the sound effector data.

警告
Must be called before either Sample() of SampleArray() 函数。 FreeSampling() must be invoked afterwards.
参数
[in] doc The document.
返回
true if successful, otherwise false .

◆  FreeSampling()

Bool FreeSampling ( )

Frees the memory used for sampling.

警告
Must be invoked after InitSampling() has been called.
返回
true if successful, otherwise false .

◆  CopyTo()

Bool CopyTo ( SoundEffectorData pDest )

Copies the sound effector data values into the destination sound effector data.

参数
[in] pDest The destination sound effector data data. The caller owns the pointed SoundEffectorData ..
返回
true if successful, otherwise false .

◆  Sample()

Bool Sample ( Int   index ,
Int   count ,
Float value ,
向量 color  
)

Samples the sound file using the probes.

参数
[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.
返回
true if successful, otherwise false .

◆  SampleArray() [1/2]

Bool SampleArray ( Int   offset ,
Int   count ,
Int   totalCount ,
Float values ,
向量 colors  
)

Samples a subset portion or whole array of elements simultaneously.

参数
[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 .
返回
true if successful, otherwise false .

◆  SampleArray() [2/2]

Bool SampleArray ( Int   offset ,
Int   count ,
Int   totalCount ,
Float values ,
向量 colors  
) const

Samples a subset portion or whole array of elements simultaneously (const version).

参数
[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 .
返回
true if successful, otherwise false .

◆  CreateProbe()

Int CreateProbe ( Float   left = 1.0 ,
Float   right = 22050.0 ,
Float   top = 1.0 ,
Float   bottom = 0.0 ,
Bool   selected = false  
)

Creates a probe.

参数
[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).
返回
The created probe's index.

◆  CreateDefaultProbe()

Bool CreateDefaultProbe ( )

Create default probe

返回
true if successful, otherwise false .

◆  GetProbeCount()

Int GetProbeCount ( ) const

Retrieves the number of probes owned by the sound effector data.

返回
The probe count.

◆  GetProbe()

Probe * GetProbe ( Int   index ) const

Retrieves the probe at the specified index .

参数
[in] index The probe index.
返回
The probe, or nullptr if the function fails. The SoundEffectorData owns the pointed probe.

◆  DeleteProbe()

Bool DeleteProbe ( Int   index )

Deletes the probe at the specified index .

参数
[in] index The index of the probe to delete.
返回
true if successful, otherwise false .

◆  UpdateProbeOrder()

void UpdateProbeOrder ( )

Updates the probes.

注意
Must be called after adjusting any probes left or right values to update the order that the probes are calculated in.

◆  GetRange()

void GetRange ( Float xmin ,
Float xmax ,
Float ymin ,
Float ymax  
) const

Retrieves the range of the sound effector data.

警告
Only valid if the sound effector data is shown in the sound data GUI.
参数
[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()

void SetRange ( Float   xmin ,
Float   xmax ,
Float   ymin ,
Float   ymax  
)

Sets the range of the sound effector data.

警告
Only valid if the sound effector data is shown in the sound data GUI.
参数
[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.

返回
The blend percentage: 0% = linear, 100% = log10.

◆  SetLinLog()

void SetLinLog ( Float   value )

Sets the the blend value for the linear/logarithmic slider.

参数
[in] value The blend percentage to set: 0% = linear, 100% = log10.

◆  GetFreeze()

Bool GetFreeze ( ) const

Retrieves the freeze state.

返回
true if freeze is enabled, otherwise false .

◆  SetFreeze()

void SetFreeze ( Bool   freeze )

Sets the freeze state.

参数
[in] freeze true to enable freeze, otherwise false .

◆  GetGradient()

渐变 * GetGradient ( ) const

Retrieves the global gradient.

返回
The global gradient, or nullptr if the function fails. The SoundEffectorData owns the pointed gradient.

◆  GetGradientDirection()

Int32 GetGradientDirection ( ) const

Retrieves the global gradient direction.

返回
The global gradient direction: 0 for vertical (volume), 1 for horizontal (frequency).

◆  SetGradientDirection()

void SetGradientDirection ( Int32   direction )

Sets the global gradient direction.

参数
[in] direction The global gradient direction to set: 0 for vertical (volume), 1 for horizontal (frequency).

◆  IsFFTSamplingCacheDirty()

Bool IsFFTSamplingCacheDirty ( BaseDocument doc ) const

Check if an FFT Cache is currently up to date.

参数
[in] doc The document.
返回
true if successful, otherwise false .

◆  SetActiveSoundTrack()

Bool SetActiveSoundTrack ( CTrack track ,
BaseDocument doc  
)

Sets the active sound track

参数
[in] track Sound track.
[in] doc The document.
返回
true if successful, otherwise false .

◆  GetActiveSoundTrack()

CTrack * GetActiveSoundTrack ( BaseDocument doc )

Retrieves the active sound track.

参数
[in] doc The document.
返回
The active sound track, or nullptr if the function fails. The SoundEffectorData owns the pointed CTrack .