diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -107,8 +107,31 @@ Resume a channel. This function has no effect if the channel is already playing. +### `void mossrose_channel_set_callback(int channel, mossrose_channel_callback_t callback, void *userdata)` ### + +Set a callback to run each time playback of audio on a channel completes. + + * `channel` - the channel to attach to + * `callback` - pointer to the callback function. + * `userdata` - pointer to data to pass to the callback function. + +The callback function should return `void` and have signature `(int channel, +void *userdata)`, where + + * `channel` is the index of the channel triggering the callback + * `userdata` is the user data bound to the callback via the `userdata` + argument to the setter function. + +Callbacks will not be triggered on their own! You must periodically call +`mossrose_poll_callbacks` to trigger them. + + +### `void mossrose_poll_callbacks()` ### + +Check all channels for playback-finished callbacks and run them if necessary. + + todo ---- - * playback finished callback * audio loading |