CRI ADX  Last Updated: 2024-07-17 10:48 p
CriAtomExTween API

结构体

struct  CriAtomExTweenConfigTag
 Configuration structure used to create a Tween 更多...
 

宏定义

#define criAtomExTween_SetDefaultConfig(p_config)
 Assign the default values to the configuration structure used to create a Tween 更多...
 

类型定义

typedef enum CriAtomExTweenParameterTypeTag CriAtomExTweenParameterType
 Parameter type for a Tween 更多...
 
typedef struct CriAtomExTweenConfigTag CriAtomExTweenConfig
 Configuration structure used to create a Tween 更多...
 
typedef struct CriAtomExTweenTag * CriAtomExTweenHn
 Tween handle 更多...
 

枚举

enum  CriAtomExTweenParameterTypeTag { CRIATOMEX_PARAMETER_TYPE_BASIC , CRIATOMEX_PARAMETER_TYPE_AISAC , CRIATOMEX_PARAMETER_TYPE_ENUM_SIZE_IS_4BYTES = 0x7FFFFFFF }
 Parameter type for a Tween 更多...
 

函数

CriSint32 criAtomExTween_CalculateWorkSize (const CriAtomExTweenConfig *config)
 Calculate the size of the work buffer required to create a Tween 更多...
 
CriAtomExTweenHn criAtomExTween_Create (const CriAtomExTweenConfig *config, void *work, CriSint32 work_size)
 Create Tween 更多...
 
void criAtomExTween_Destroy (CriAtomExTweenHn tween)
 Destroy a Tween 更多...
 
CriFloat32 criAtomExTween_GetValue (CriAtomExTweenHn tween)
 Get the current value of the Tween 更多...
 
void criAtomExTween_MoveTo (CriAtomExTweenHn tween, CriUint16 time_ms, CriFloat32 value)
 Smoothly change the current value of the parameter to the specified value 更多...
 
void criAtomExTween_MoveFrom (CriAtomExTweenHn tween, CriUint16 time_ms, CriFloat32 value)
 Smoothly change the specified value to the current value 更多...
 
void criAtomExTween_Stop (CriAtomExTweenHn tween)
 Stop the Tween 更多...
 
void criAtomExTween_Reset (CriAtomExTweenHn tween)
 Reset the Tween 更多...
 

详细描述

宏定义说明

◆ criAtomExTween_SetDefaultConfig

#define criAtomExTween_SetDefaultConfig (   p_config)
值:
{\
(p_config)->id.parameter_id = CRIATOMEX_PARAMETER_ID_VOLUME;\
(p_config)->parameter_type = CRIATOMEX_PARAMETER_TYPE_BASIC;\
}
@ CRIATOMEX_PARAMETER_ID_VOLUME
Definition: cri_le_atom_ex.h:4007
@ CRIATOMEX_PARAMETER_TYPE_BASIC
Basic parameters
Definition: cri_le_atom_ex.h:5024

Assign the default values to the configuration structure used to create a Tween

参数
[out]p_configpointer to the configuration structure used to create a Tween
Description:
Assigns the default values to the configuration structure ( CriAtomExTweenConfig ) passed to the criAtomExTween_Create function.
参见
CriAtomExTweenConfig

类型定义说明

◆ CriAtomExTweenParameterType

Parameter type for a Tween

Description:
Type of parameter controlled by a Tween.
参见
CriAtomExTweenConfig

◆ CriAtomExTweenConfig

Configuration structure used to create a Tween

Description:
Configuration structure used when creating a Tween.
It is passed to the criAtomExTween_Create function.
Before using this structure, call the criAtomExTween_SetDefaultConfig macro to initialize it.
参见
criAtomExTween_SetDefaultConfig, criAtomExTween_CalculateWorkSize, criAtomExTween_Create

◆ CriAtomExTweenHn

typedef struct CriAtomExTweenTag* CriAtomExTweenHn

Tween handle

Description:
Handle to use a Tween.
A Tween offers a simple way to change parameters over time. When the criAtomExTween_Create function is used to create a Tween, it returns a Tween handle.
The functions involving a Tween (such as starting the variation of a parameter) are all performed through a Tween handle.
The handle is also used to associate the Tween with an AtomEx Player.
参见
criAtomExTween_Create, criAtomExPlayer_AttachTween

枚举类型说明

◆ CriAtomExTweenParameterTypeTag

Parameter type for a Tween

Description:
Type of parameter controlled by a Tween.
参见
CriAtomExTweenConfig
枚举值
CRIATOMEX_PARAMETER_TYPE_BASIC 

Basic parameters

Description:
Use this type to control volume, pitch, and other parameters specified by CriAtomExParameterId.
CRIATOMEX_PARAMETER_TYPE_AISAC 

AISAC control value

Description:
Use this type to control AISAC control values.

函数说明

◆ criAtomExTween_CalculateWorkSize()

CriSint32 criAtomExTween_CalculateWorkSize ( const CriAtomExTweenConfig config)

Calculate the size of the work buffer required to create a Tween

参数
[in]configconfiguration structure used to create a Tween
返回
CriSint32 work buffer size
返回值
>=0 successfully completed
-1error occurred
Description:
Calculates the size of the work buffer required to create a Tween.
If you create a Tween without having registered a user-allocator, a memory buffer having the size returned by this function must be passed to criAtomExTween_Create.

When NULL is specified for the structure, the default settings (the same than the ones set by the criAtomExTween_SetDefaultConfig macro) are used to calculate the size of the work buffer.
If this function fails to calculate the size of the work buffer, it will return -1.
To know the reason of the failure, refer to the error callback message.
Remarks:
The information in the configuration structure is only used during the initialization and is not referenced after that. Therefore, it is safe to release it once the function has returned.
注意
The library must be initialized before executing this function.
参见
CriAtomExTweenConfig, criAtomExTween_Create

◆ criAtomExTween_Create()

CriAtomExTweenHn criAtomExTween_Create ( const CriAtomExTweenConfig config,
void *  work,
CriSint32  work_size 
)

Create Tween

参数
[in]configconfiguration structure used to create a Tween
[in]workwork buffer
[in]work_sizework buffer size
返回
CriAtomExTweenHn Tween handle
Description:
Creates a Tween based on the value of the parameters of the configuration structure.
When this function creates a Tween successfully, it returns a handle.
When creating a Tween, you must pass a work buffer.
The size of that buffer is calculated by calling the criAtomExTween_CalculateWorkSize function.
(If a user-allocator has already been registered by using the criAtomEx_SetUserAllocator macro, you do not need to pass the work buffer.)
To use the Tween that was created, attach it to the AtomEx Player by using the criAtomExPlayer_AttachTween function.
Remarks:
The initial values of the parameters held by the tween are the default values for each parameter if the parameter type is specified as CRIATOMEX_PARAMETER_TYPE_BASIC in the configuration structure, or 0.0f if the parameter type is specified as CRIATOMEX_PARAMETER_TYPE_AISAC .
注意
The library must be initialized before executing this function.
If there are any audios playing in an AtomEx player with a Tween handle attached, stop those audios or destroy the AtomEx player before executing this function.
参见
criAtomExTween_CalculateWorkSize, criAtomExTween_Destroy, criAtomExPlayer_AttachTween

◆ criAtomExTween_Destroy()

void criAtomExTween_Destroy ( CriAtomExTweenHn  tween)

Destroy a Tween

参数
[in]tweenTween handle
Description:
Destroys a Tween.
The memory allocated when you created the Tween is released when you execute this function.
Also, the Tween handle specified as an argument is disabled.
If any sounds are being played back on the AtomEx player to which the Tween is attached, you must first stop these sounds or destroy the AtomEx player, then only execute this function.
参见
criAtomExTween_Create

◆ criAtomExTween_GetValue()

CriFloat32 criAtomExTween_GetValue ( CriAtomExTweenHn  tween)

Get the current value of the Tween

参数
[in]tweenTween handle
Description:
Gets the current value of the parameter associated to a Tween.

◆ criAtomExTween_MoveTo()

void criAtomExTween_MoveTo ( CriAtomExTweenHn  tween,
CriUint16  time_ms,
CriFloat32  value 
)

Smoothly change the current value of the parameter to the specified value

参数
[in]tweenTween handle
[in]time_mstime over which the change is made (in milliseconds)
[in]valuefinal value
Description:
Takes the time specified by time_ms to change a Tween parameter from its current value (i.e. when this function is called) to the value specified.
The variation curve is linear.

◆ criAtomExTween_MoveFrom()

void criAtomExTween_MoveFrom ( CriAtomExTweenHn  tween,
CriUint16  time_ms,
CriFloat32  value 
)

Smoothly change the specified value to the current value

参数
[in]tweenTween handle
[in]time_mstime over which the change is made (in milliseconds)
[in]valueinitial value
Description:
Takes the time specified by time_ms to change a Tween parameter from the value specified to the currently value of the Tween (when this function is called).
The variation curve is linear.

◆ criAtomExTween_Stop()

void criAtomExTween_Stop ( CriAtomExTweenHn  tween)

Stop the Tween

参数
[in]tweenTween handle
Description:
Stops the variation of the Tween parameter over time.

◆ criAtomExTween_Reset()

void criAtomExTween_Reset ( CriAtomExTweenHn  tween)

Reset the Tween

参数
[in]tweenTween handle
Description:
Resets the parameter associated with the Tween handle and reverts it to its initial value.
The initial values of the parameters held by the tween are the default values for each parameter if the parameter type is specified as CRIATOMEX_PARAMETER_TYPE_BASIC in the configuration structure, or 0.0f if the parameter type is specified as CRIATOMEX_PARAMETER_TYPE_AISAC .
Remarks:
Stops the variation of the Tween parameter if it is in progress.