From 06ba9e05c166c48a739683766f09c4abf242fb81 Mon Sep 17 00:00:00 2001 From: sowgro Date: Fri, 17 Oct 2025 22:01:03 -0400 Subject: Complete project --- project/Core/Src/Project/project.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'project/Core/Src/Project/project.c') diff --git a/project/Core/Src/Project/project.c b/project/Core/Src/Project/project.c index 379f380..1311219 100644 --- a/project/Core/Src/Project/project.c +++ b/project/Core/Src/Project/project.c @@ -11,6 +11,8 @@ #include #include "hw4.h" #include +#include "song_info.h" +#include "song.h" #define PLAYING_STATE (1) #define PAUSED_STATE (2) @@ -80,7 +82,21 @@ void help() { } void next() { - // TODO + static int current_song = -1; + current_song++; + if (current_song > 4) + current_song = 0; + + void *song = get_song(current_song).p_song; + song_info_t song_info = get_song_info(song); + + printf("Song #%i\r\n", current_song + 1); + if (song_info.title) + printf("Title: %s\r\n", song_info.title); + if (song_info.copyright) + printf("Copyright: %s\r\n", song_info.copyright); + if (song_info.tempo) + printf("Tempo: %i\r\n", song_info.tempo); } void play() { -- cgit v1.2.3