diff options
| author | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-11-23 21:52:24 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrikboy@gmail.com> | 2024-11-23 21:52:24 +0100 |
| commit | 6f7374c2fa58c8692b51018864b802e6b876d305 (patch) | |
| tree | a7e8ead757e9f4de1920395336dcac1c8a989576 /src/music.c | |
A new start
Diffstat (limited to 'src/music.c')
| -rw-r--r-- | src/music.c | 22 |
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 |
