From e35cff6d299a07d9b34f303717083a9299a37e82 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Mon, 28 Aug 2023 15:16:12 +0100 Subject: Initial import --- include/ubox_sound.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 include/ubox_sound.h (limited to 'include/ubox_sound.h') diff --git a/include/ubox_sound.h b/include/ubox_sound.h new file mode 100644 index 0000000..d52962b --- /dev/null +++ b/include/ubox_sound.h @@ -0,0 +1,32 @@ +#ifndef _UBOX_SOUND_H +#define _UBOX_SOUND_H + +#ifndef UBOX_SOUND_DIVIDER +/* ubox_sound_update will be called from the timer int, so we update every + * 1080ms approx by using a counter and updating 1 in 20 interrupts */ +#define UBOX_SOUND_DIVIDER 20 +#endif + +typedef struct +{ + const char *data; + size_t len; +} ubox_sound_data; + +/* mus is expected to be a IT module, efx are samples */ +uint8_t ubox_sound_init(const ubox_sound_data *mus, const ubox_sound_data *efx, uint8_t efx_cnt); +void ubox_sound_free(); +void ubox_sound_update(); + +void ubox_sound_music_pattern(uint16_t pat); + +/* priority based efx player using order: + * The effects plays if nothing is playing or if the effect playing has equal + * or less priority. + */ +void ubox_sound_play_efx(uint8_t efxno); + +void ubox_sound_mute(); +void ubox_sound_unmute(); + +#endif /* _UBOX_SOUND_H */ -- cgit v1.2.3