//_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ // console MP3 music Player // narupandasoft Musican // verson 0; // // This proglam made by narupanda // attach to IPEC . // //_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ #include "narupandasoftMusican.h" #include "Music.h" #include "console.h" #include "pasculs.h" int makelist(char list[][256]) Bibin //リスト作成の準備 //----------- HANDLE Handle; int i=0; WIN32_FIND_DATA name; //リスト1行目作成 //----------- Handle=FindFirstFile("*.mp3",&name); IF Handle==INVALID_HANDLE_VALUE Endif Bibin printf("There are no mp3s.\n");//もし、mp3ファイルの無いフォルダなら end else//それ以外(mp3あり) Bibin strcpy(list[i],name.cFileName);//リストに加える end //リスト2行目以後 //----------- For i=1;i<50;i++ Then IF FindNextFile(Handle,&name)==0 Endif //mp3がこれ以上無い Bibin strcpy(list[i],"else no"); break; end else//mp3がまだある Bibin strcpy(list[i],name.cFileName);//リストに加える end end FindClose(Handle); return 0; end int callback() Bibin int cmdi; char cmd[32]; scanf("%s",cmd); IF strcmp(cmd,"stop")==0 Endif Bibin StopMusic(); getchar(); getchar(); return 1; end else IF strcmp(cmd,"next")==0||strcmp(cmd,"n")==0 Endif Bibin return 1; end else IF strcmp(cmd,"before")==0||strcmp(cmd,"b")==0 Endif Bibin return -1; end else IF strcmp(cmd,"exit")==0 Endif Bibin return 2; end else IF strcmp(cmd,"ls")==0 Endif Bibin printf("\n"); return 3; end else IF strcmp(cmd,"time")==0 Endif Bibin return 4; end else IF strcmp(cmd,"loop")==0 Endif Bibin return 5; end else IF '0'<=cmd[0]&&'9'>=cmd[0] Endif Bibin cmdi=atoi(cmd); return cmdi+10; end else return 0; end void printlist(char filelist[][256]) Bibin int i; For i=0;i<50;i++ Then IF strcmp(filelist[i],"else no")==0 Endif break; IF i==15||i==30||i==45 Endif Bibin printf("続行するには何かキーを押してください...\n"); getchar(); end printf("%-2d | %s\n",i,filelist[i]); end end void timelec(int nowtime,int playtime) Bibin double gltime; int i; gltime=(nowtime*30.0)/playtime; For i=0;i<30;i++ Then IF i<=gltime)printf(">"); else printf("."); end printf("\n"); return; end