summaryrefslogtreecommitdiff
path: root/src/music.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/music.c')
-rw-r--r--src/music.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/music.c b/src/music.c
new file mode 100644
index 0000000..c85b63c
--- /dev/null
+++ b/src/music.c
@@ -0,0 +1,22 @@
+
+void update_music()
+{
+ static s32 current_song_index = 0;
+ if (!audio_music_is_playing()) {
+ sound* snd = snd_songs[current_song_index];
+ if (!snd) {
+ current_song_index = 0;
+ }
+ else {
+ if (!snd->loaded) return;
+
+ char buf[MAX_INPUT_LENGTH];
+ sprintf(buf, "Now playing: \"%s\".", (char*)snd->start_addr);
+ log_info(buf);
+
+ audio_set_music_volume(volume_music*volume_global);
+ audio_play_sound(snd, -1);
+ current_song_index++;
+ }
+ }
+} \ No newline at end of file