NAME
Snack_AddCallback, Snack_RemoveCallback, Snack_ExecCallbacks - track changes to Snack sound objectsSYNOPSIS
#include <snack.h>Snack_AddCallback(sound, procedure, clientData)
Snack_RemoveCallback(sound, id)
Snack_ExecCallbacks(sound, flag)
ARGUMENTS
Sound *sound (in)Sound object to attach the callback to.
updateProc *procedure (in)
Procedure to invoke when the sound data changes.
ClientData *clientData (in)
Arbitrary one-word value to pass to procedure.
int id (in)
Unique identifer for the callback.
int flag (in)
Flag which specifies how the sound changed.
DESCRIPTION
Snack_AddCallback adds a callback procedure to sound, that will be called whenever its content changes. It returns an id number that can be used by Snack_RemoveCallback to remove the callback. The clientData parameter to procedure is a copy of the clientData argument given to Snack_AddCallback whenthe callback was created. Typically, clientData points to a data structure containing application-specific
information about what to do in procedure.
Snack_ExecCallbacks is used in sub-commands so that changes to a sound can be tracked for example Snack´s canvas item types. The flag specifies whether all sound data has changed (SNACK_NEW_SOUND) or if new data has been appended (SNACK_MORE_DATA).