C4 Engine
C4 Engine API Documentation

Sound::SetLoopCallback

Defined in:  C4Sound.h
Installs a callback function that is invoked when a sound loops.
Prototype

void SetLoopCallback(LoopCallback *callback, void *cookie = nullptr);

Parameters
callback The loop callback function. This parameter may be nullptr, in which case the sound has no loop callback function.
cookie The cookie that is passed to the loop callback function as its last parameter.
Description
The SetLoopCallback function sets the callback function that is invoked when the sound loops to that given by the callback parameter. The LoopCallback type is defined as

typedef void LoopCallback(Sound *, void *);

When the function pointed to by the callback parameter is called, the pointer to the sound object and the value supplied in the cookie parameter are passed to it. By default, there is no loop callback function installed.

If the callback parameter is nullptr, then no callback function is invoked when the sound loops.
See Also

Sound::GetLoopCount

Sound::SetLoopCount

Sound::GetLoopIndex

Sound::SetLoopIndex