summaryrefslogtreecommitdiff
path: root/src/playit.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-05-31 22:23:15 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-05-31 22:26:49 -0700
commit095ce46f0ee7cad07d7bafb2d771cac235574d1c (patch)
tree87bc71a08014dd0f92c81b8c5b34847754827ef9 /src/playit.h
parent10338bf9283a86471aaf1a4702e8f02e6c9c4f52 (diff)
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.
Diffstat (limited to 'src/playit.h')
-rw-r--r--src/playit.h13
1 files changed, 13 insertions, 0 deletions
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
© All Rights Reserved