From b22df31feeb7e695faabecfd7cc6fdd24609b0e1 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 28 Aug 2023 18:57:55 -0700 Subject: til: add preliminary audio backend This is an early implementation of something resembling an audio backend for rototiller/libtil. The assumption for now is that everything will use signed 16-bit native-endian stereo output @ 44.1khz. --- src/til_audio_context.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/til_audio_context.h (limited to 'src/til_audio_context.h') diff --git a/src/til_audio_context.h b/src/til_audio_context.h new file mode 100644 index 0000000..8efdbac --- /dev/null +++ b/src/til_audio_context.h @@ -0,0 +1,21 @@ +#ifndef _TIL_AUDIO_CONTEXT_H +#define _TIL_AUDIO_CONTEXT_H + +/* XXX: this isn't intended to be used outside of til_audio.[ch] */ + +#include + +typedef struct til_setup_t til_setup_t; +typedef struct til_audio_ops_t til_audio_ops_t; + +typedef struct til_audio_context_t { + til_setup_t *setup; + const til_audio_ops_t *ops; + const til_audio_hooks_t *hooks; + void *hooks_context; +} til_audio_context_t; + +void * til_audio_context_new(const til_audio_ops_t *ops, size_t size, til_setup_t *setup); +til_audio_context_t * til_audio_context_free(til_audio_context_t *audio_context); + +#endif -- cgit v1.2.1