summaryrefslogtreecommitdiff
path: root/project/Core/Src/Project/song_info.c
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-12-14 00:21:02 -0500
committersowgro <tpoke.ferrari@gmail.com>2025-12-14 00:21:02 -0500
commite68a05b29de507a56b8747557707e8d6cdd68542 (patch)
tree1f7c457159af75ae198258a2301a55531d7baff5 /project/Core/Src/Project/song_info.c
parent519f868c445a86b988772307ea1f1e2fc95fe54a (diff)
download340-repo-Sowgro-e68a05b29de507a56b8747557707e8d6cdd68542.tar.gz
340-repo-Sowgro-e68a05b29de507a56b8747557707e8d6cdd68542.tar.bz2
340-repo-Sowgro-e68a05b29de507a56b8747557707e8d6cdd68542.zip
Refactor
Diffstat (limited to 'project/Core/Src/Project/song_info.c')
-rw-r--r--project/Core/Src/Project/song_info.c51
1 files changed, 0 insertions, 51 deletions
diff --git a/project/Core/Src/Project/song_info.c b/project/Core/Src/Project/song_info.c
deleted file mode 100644
index 5be94e5..0000000
--- a/project/Core/Src/Project/song_info.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * song_info.c
- *
- * Created on: Oct 9, 2025
- * Author: sowgro
- */
-
-#include "song.h"
-#include "activity4.h"
-#include <stdint.h>
-#include "song_info.h"
-#include "endian_converters.h"
-
-uint8_t *get_song_info(uint8_t *p_song, song_info_t *ret) {
- ret->copyright = 0;
- ret->tempo = 0;
- ret->title = 0;
-
- p_song += 4; // move past MTrk label
- uint32_t MTrk_len = convert_to_uint32(p_song); // read in size of MTrk
- p_song += sizeof(MTrk_len);
-
- for (uint8_t *p_end = p_song + MTrk_len; p_song != p_end; p_song++) {
- // FF 02 - copyright
- if (convert_to_uint16(p_song) == 0xFF02) {
- p_song += sizeof(uint16_t);
- uint8_t ev_len = *(uint8_t *) p_song;
- p_song += sizeof(ev_len);
- ret->copyright = (char *) p_song;
- ret->copyright[ev_len] = 0;
- }
-
- // FF 03 - title
- if (convert_to_uint16(p_song) == 0xFF03) {
- p_song += sizeof(uint16_t);
- uint8_t ev_len = *(uint8_t *) p_song;
- p_song += sizeof(ev_len);
- ret->title = (char *) p_song;
- ret->title[ev_len] = 0;
- }
-
- // FF 51 - tempo
- if (convert_to_uint16(p_song) == 0xFF51) {
- p_song += sizeof(uint16_t);
- p_song += sizeof(uint8_t); // skip length, always 03
- ret->tempo = convert_to_uint24(p_song);
- }
- }
-
- return p_song;
-}