/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_music.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/24 17:17:54 by rbousset #+# #+# */ /* Updated: 2020/02/24 17:17:56 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include #include void *ft_music(void *vargp) { char *cmd; uint8_t len; t_cub *cl; cl = (t_cub *)vargp; len = ft_strlen(cl->mlist->music_path); if (FT_OS == 2) len += 22; else len += 18; if (!(cmd = (char *)malloc((len + 1) * sizeof(char)))) return (NULL); if (FT_OS == 2) ft_sprintf(cmd, "aplay -f cd -t wav -q %s", cl->mlist->music_path); else {} ft_printf("%s\n", cmd); system(cmd); ft_memdel((void**)&cmd); return (NULL); }