Sample Directory
/CRIWARE/SDK/pc/samples/criatomex/playback_block
Sample Description
This sample program demonstrates how to branch to a jingle sound (that is a block Cue) during playback.
The block Cue is created in CRI Atom Craft.
For details, refer to the following:
Block playback
In the program,
specify the first block index to the player with the
criAtomExPlayer_SetFirstBlockIndex function,
and then specify the next block indexes for the playback ID with the
criAtomExPlayback_SetNextBlockIndex.
The following code demonstrates how to play and control a block Cue that branches during playback.
:
if (status_of_something) {
} else {
}
void criAtomExPlayback_SetNextBlockIndex(CriAtomExPlaybackId id, CriAtomExBlockIndex index)
Set the index of the next block.
void criAtomExPlayer_SetFirstBlockIndex(CriAtomExPlayerHn player, CriAtomExBlockIndex index)
Set the start block (by specifying a block index)
void criAtomExPlayer_SetCueName(CriAtomExPlayerHn player, CriAtomExAcbHn acb_hn, const CriChar8 *cue_name)
Set the sound data to play (specifying a Cue name)
CriAtomExPlaybackId criAtomExPlayer_Start(CriAtomExPlayerHn player)
Start the playback.
CriAtomExPlayerHn criAtomExPlayer_Create(const CriAtomExPlayerConfig *config, void *work, CriSint32 work_size)
Create an AtomEx player.
CriUint32 CriAtomExPlaybackId
Playback ID.
Definition: cri_le_atom_ex.h:3722
You can also use the
criAtomExPlayer_SetBlockTransitionCallback function, as shown in the code below, to receive a callback when the block transitions.
void main()
{
app_obj->player, &user_transition_callback_func, app_obj);
}
void user_transition_callback_func(
{
printf("PlaybackId:%d, BlockIndex:%d\n", id, index);
}
CriSint32 CriAtomExBlockIndex
Block Index.
Definition: cri_le_atom_ex.h:2304
void criAtomExPlayer_SetBlockTransitionCallback(CriAtomExPlayerHn player, CriAtomExPlayerBlockTransitionCbFunc func, void *obj)
Register the block transition callback function.