akkera 102
/
apuplay
SPC music playback tools for real snes apu
Diff: main.cpp
- Revision:
- 6:0e2e1c4d3c8f
- Parent:
- 5:37f42381cca9
--- a/main.cpp Fri Jan 13 06:19:35 2017 +0000 +++ b/main.cpp Sat Jan 14 13:27:06 2017 +0000 @@ -6,16 +6,29 @@ int main(void) { + DIR *d; + struct dirent *p; + char buf[64]; + for(;;) { - // playlist - cmd("/local/1.spc"); -/* - cmd("/local/2.spc"); - cmd("/local/3.spc"); - cmd("/local/4.spc"); - cmd("/local/5.spc"); - cmd("/local/6.spc"); -*/ + if((d = opendir("/local")) == NULL) + { + return -1; + } + + while((p = readdir(d)) != NULL) + { + if(strstr(p->d_name, ".SPC") != NULL) + { + sprintf(buf, "/local/%s", p->d_name); + cmd(buf); + } + } + + printf("All done.\n"); + wait(1); + + closedir(d); } }