aboutsummaryrefslogtreecommitdiff
path: root/include/ubox_sound.h
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-08-28 15:16:12 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-08-28 15:30:25 +0100
commite35cff6d299a07d9b34f303717083a9299a37e82 (patch)
tree7204099ad4978dfc67e04bc11df29d0f366af851 /include/ubox_sound.h
downloaduboxlib-dos-e35cff6d299a07d9b34f303717083a9299a37e82.tar.gz
uboxlib-dos-e35cff6d299a07d9b34f303717083a9299a37e82.zip
Initial import
Diffstat (limited to 'include/ubox_sound.h')
-rw-r--r--include/ubox_sound.h32
1 files changed, 32 insertions, 0 deletions
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 */