UserBufferProcessor

Callback function called by ssplProcessSignals(), ssplAbort(), and ssplReset().

Synopsis

void (*UserBufferProcessor) ( SoundSpooler *sspl, SoundBufferNode *sbn )

Description

This user callback function is called by ssplProcessSignals() for each buffer that has finished playing and ssplAbort() for each buffer that is removed from the active buffer queue. This function can be used as notification that the sound spooler is done with a given buffer. For example, if sound is being spooled from a network connection, this function could be used to reply the network packet that contained the sample data for a given buffer.

Using the SoundBufferNode's UserData field can help identify the buffer being passed to this function (for example, UserData could be a pointer to the aforementioned network packet). See ssplGetUserData().

It is not legal to do anything to disturb the sound spooler's active buffer queue during this function. In particular, do not call ssplSendBuffer() or anything that might call ssplSendBuffer() as this will confuse the list processor in ssplProcessSignals().

The state of SSPL_STATUS_F_ACTIVE is undefined when inside a UserBufferProcessor function.

Arguments

sspl
Pointer to the SoundSpooler passed to ssplProcessSignals() or ssplAbort().
sbn
Pointer to the completed (or aborted) SoundBufferNode that was just removed from the active queue.

Return Value

None

Implementation

Client-supplied callback function used by music.lib V21.

Note

This facility has been superceded by the SoundBufferFunc system.

There are plenty of sound spooler functions in which buffers can be removed from the active queue without any means for the client to provide a UserBufferProcessor function. This list includes, but is not limited to ssplDeleteSoundSpooler(), ssplAttachInstrument(), ssplDetachInstrument(), and ssplPlayData(). Consider using a SoundBufferFunc instead of a UserBufferProcessor.

See Also

SoundBufferFunc(), ssplProcessSignals(), ssplAbort(), ssplReset()