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

Data Structures

struct  CriAtomExTweenConfigTag
 Configuration structure used to create a Tween. More...
 

Macros

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

Typedefs

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

Enumerations

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

Functions

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

Detailed Description

Macro Definition Documentation

◆ criAtomExTween_SetDefaultConfig

#define criAtomExTween_SetDefaultConfig (   p_config)
Value:
{\
(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.

Parameters
[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.
See also
CriAtomExTweenConfig

Typedef Documentation

◆ CriAtomExTweenParameterType

Parameter type for a Tween.

Description:
Type of parameter controlled by a Tween.
See also
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.
See also
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.
See also
criAtomExTween_Create, criAtomExPlayer_AttachTween

Enumeration Type Documentation

◆ CriAtomExTweenParameterTypeTag

Parameter type for a Tween.

Description:
Type of parameter controlled by a Tween.
See also
CriAtomExTweenConfig
Enumerator
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.

Function Documentation

◆ criAtomExTween_CalculateWorkSize()

CriSint32 criAtomExTween_CalculateWorkSize ( const CriAtomExTweenConfig config)

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

Parameters
[in]configconfiguration structure used to create a Tween
Returns
CriSint32 work buffer size
Return values
>=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.
Attention
The library must be initialized before executing this function.
See also
CriAtomExTweenConfig, criAtomExTween_Create

◆ criAtomExTween_Create()

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

Create Tween.

Parameters
[in]configconfiguration structure used to create a Tween
[in]workwork buffer
[in]work_sizework buffer size
Returns
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 .
Attention
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.
See also
criAtomExTween_CalculateWorkSize, criAtomExTween_Destroy, criAtomExPlayer_AttachTween

◆ criAtomExTween_Destroy()

void criAtomExTween_Destroy ( CriAtomExTweenHn  tween)

Destroy a Tween.

Parameters
[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.
See also
criAtomExTween_Create

◆ criAtomExTween_GetValue()

CriFloat32 criAtomExTween_GetValue ( CriAtomExTweenHn  tween)

Get the current value of the Tween.

Parameters
[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.

Parameters
[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.

Parameters
[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.

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

◆ criAtomExTween_Reset()

void criAtomExTween_Reset ( CriAtomExTweenHn  tween)

Reset the Tween.

Parameters
[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.