aboutsummaryrefslogtreecommitdiff
path: root/include/ubox_sound.h
blob: d52962b55e4b84fabb62b4597fa1deec3b85d308 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 */