Specifications
* and to write to
*/
song_name_ptr = &song_name[0];
songs_ptr = &songs[0];
ReadFile (PlayList, &songs[0], 100000, &bytes, NULL) ;
songs[bytes] = NULL;
/* extract the path and file name */
if(*songs_ptr == '#') crt_num--; //for winamp playlists
/* loop til the end of the buffer */
while(*songs_ptr != NULL){
/* if the CRT count is one less than song number */
if(crt_num == song){
if(*songs_ptr == 0x5C){
net_address = 1;
} else {
net_address = 0;
}
/* Read the path out on the next line of the buffer */
while(*songs_ptr != 0x0D){
*song_name_ptr = *songs_ptr;
if((*songs_ptr == 0x5C) && (net_address == 0)){
song_name_ptr++;
*song_name_ptr = *songs_ptr;
}
songs_ptr++;
song_name_ptr++;
}
*song_name_ptr = NULL;
break;
} else {
/* If character equals character return increment count */
if(*songs_ptr == 0x0D){
crt_num++;
songs_ptr++;
if(*(songs_ptr + 1) == '#') crt_num--;
}
songs_ptr++;
}
}
CloseHandle(PlayList);
/* The song number is past play list boundaries */
if (*songs_ptr == NULL){
printf("End of list\n");
/* in repeat mode go back to start */
if(repeat){
song_no = 1;
open_MP3 (song_no);
/* else stay at current file */
} else {
song_no = song - 1;
open_MP3 (song_no);
}
83










