From 36b0f83075c15fc8d107ece20bd6be95a8d2588c Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 10 Oct 2022 19:52:03 -0700 Subject: play: introduce play_run_slice() Sometimes a more granular main loop integration is required. In such situations play_run() taking over is untenable, so this splits out the body of play_run()'s loop as a separately callable function. Existing main loops can use this to run the play main loop for a single slice. The impetus for this has been experimenting with escripten support in SARS, e.g. emscripten_set_main_loop_arg((void(*)(void *))play_run_slice, play, -1, 1); --- src/play.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/play.h') diff --git a/src/play.h b/src/play.h index 1d4ec6b..b3c56b5 100644 --- a/src/play.h +++ b/src/play.h @@ -57,6 +57,7 @@ typedef struct play_ops_t { play_t * play_startup(int argc, char *argv[], unsigned flags, const play_ops_t *ops[]); int play_shutdown(play_t *play); +int play_run_slice(play_t *play); void play_run(play_t *play); void play_music_set(play_t *play, unsigned flags, const char *fmt, ...); -- cgit v1.2.3