From 095ce46f0ee7cad07d7bafb2d771cac235574d1c Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Wed, 31 May 2017 22:23:15 -0700 Subject: playit: add public playit api The schism stuff isn't really appropriate for external use, its headers want to include its config.h. So this just keeps all the schism interfacing private to libplayit where the schism code resides, and the public api is all new with no dependency on the schism code for a clear separation. While at it I've added a seekable flag which renders the song in-memory for easy and accurate seeking within the rendered output. Note this commit obsoletes the examples in examples/* which were really only intended as examples of how to do rudimentary playback with the stripped down schism code. --- src/playit.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/playit.h (limited to 'src/playit.h') diff --git a/src/playit.h b/src/playit.h new file mode 100644 index 0000000..6fd9ddf --- /dev/null +++ b/src/playit.h @@ -0,0 +1,13 @@ +#ifndef _PLAYIT_H +#define _PLAYIT_H + +#define PLAYIT_FLAG_SEEKABLE 1 + +typedef struct playit_t playit_t; + +playit_t * playit_open_file(const char *file, unsigned flags); +unsigned playit_seek(playit_t *playit, unsigned frame); +int playit_update(playit_t *playit, void *buf, int len, unsigned *res_frame); +void playit_destroy(playit_t *playit); + +#endif -- cgit v1.2.3