From 7f52b9c23cb6e70c90cd01316f4a703962c3f92f Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 2 Feb 2022 21:52:47 -0500 Subject: Initial implementation of src/bank.c Initial implementation of src/bank.c to act as a sample bank --- include/xas/bank.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 include/xas/bank.h (limited to 'include') diff --git a/include/xas/bank.h b/include/xas/bank.h new file mode 100644 index 0000000..6d7aeb1 --- /dev/null +++ b/include/xas/bank.h @@ -0,0 +1,46 @@ +#ifndef _XAS_BANK_H +#define _XAS_BANK_H + +#include + +#include + +#define XAS_BANK_IDLE 0 +#define XAS_BANK_ACTIVE (1 << 0) + +typedef struct _xas_bank_entry { + size_t duration; +} xas_bank_entry; + +typedef struct _xas_bank { + size_t sample_size, + sample_rate, + entry_size, + entry_count; + + int flags; + float force; + + size_t entry, + index; +} xas_bank; + +xas_bank *xas_bank_new(size_t sample_size, + size_t sample_rate, + size_t entry_size, + size_t entry_count); + +void xas_bank_destroy(xas_bank *bank); + +int xas_bank_play(xas_bank *bank, size_t entry, float force); + +void xas_bank_stop(xas_bank *bank); + +ssize_t xas_bank_record(xas_bank *bank, + xas_audio_stream *input, + size_t entry, + size_t count); + +xas_audio_stream *xas_bank_stream_new(xas_bank *bank); + +#endif /* _XAS_BANK_H */ -- cgit v1.2.3