From 8c9efb6d586213138def6b8e03ee82c7c24a5527 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 3 Mar 2020 19:50:46 +0100 Subject: Better music command handling --- src/ft_get_music.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/ft_get_music.c') diff --git a/src/ft_get_music.c b/src/ft_get_music.c index eb25af3..280a6c2 100644 --- a/src/ft_get_music.c +++ b/src/ft_get_music.c @@ -21,19 +21,12 @@ static void uint8_t len; len = ft_strlen(mlist->music_path); - if (FT_OS == 2) - len += 22; - else - len += 18; - ft_memdel((void**)&mlist->music_cmd); + len += ft_strlen(FT_MUS_CMD); + ft_memdel((void**)&mlist->music_cmd) - 2; if (!(mlist->music_cmd = (char *)malloc((len + 1) * sizeof(char)))) return ; - if (FT_OS == 2) - { - ft_sprintf(mlist->music_cmd, "aplay -f cd -t wav -q %s", - mlist->music_path); - } - else {} + ft_sprintf(mlist->music_cmd, FT_MUS_CMD, + mlist->music_path); } int8_t -- cgit v1.2.3