-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsound.c
44 lines (39 loc) · 1010 Bytes
/
sound.c
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
33
34
35
36
37
38
39
40
41
42
43
44
#include "sound.h"
#include <stdio.h>
#include <string.h>
static bool s_sound_inited= false;
/*
* Minimal stubs for sound. On real hardware,
* would use the Audio Interface (AI) or RSP microcodes for audio playback.
*/
bool sound_init() {
s_sound_inited= true;
printf("[Sound] init ok.\n");
return true;
}
void sound_play_effect(SoundEffect sfx) {
if(!s_sound_inited) return;
switch(sfx){
case SFX_TOOL_SELECT:
printf("[Sound] sfx=TOOL_SELECT\n");
break;
case SFX_DRAW_LINE:
printf("[Sound] sfx=DRAW_LINE\n");
break;
case SFX_FILL_AREA:
printf("[Sound] sfx=FILL_AREA\n");
break;
case SFX_LAYER_SWITCH:
printf("[Sound] sfx=LAYER_SWITCH\n");
break;
default:
printf("[Sound] sfx=unknown?\n");
break;
}
}
void sound_close() {
if(s_sound_inited){
printf("[Sound] close.\n");
}
s_sound_inited= false;
}