Пример #1
0
static void start()
{
  memset(&songinfo, 0, sizeof(SONGINFO));
  read_song_info_for_song(&(songlist.list[current_song_index]), &songinfo);
  assert(f_open( &file, get_full_filename(songlist.list[current_song_index].filename), FA_OPEN_EXISTING|FA_READ) == FR_OK);
  iprintf("title: %s\n", songinfo.title);
  iprintf("artist: %s\n", songinfo.artist);
  iprintf("album: %s\n", songinfo.album);
  iprintf("skipping: %i\n", songinfo.data_start);
  f_lseek(&file, songinfo.data_start);
  
  if (songinfo.type != UNKNOWN) {
		//assert(f_open( &file, get_full_filename(fileinfo.fname), FA_OPEN_EXISTING|FA_READ) == FR_OK);
		//puts("File opened.");
	
		switch(songinfo.type) {
  		case AAC:
  			aac_alloc();
  			aac_reset();
  		  break;
	
  		case MP4:
  			aac_alloc();
  			aac_reset();
  			aac_setup_raw();
  		  break;
		
  		case MP3:
  			mp3_alloc();
  			mp3_reset();
  		  break;
		}
		
		puts("playing");
		malloc_stats();
		state = PLAYING;
	} else {
		puts("unknown file type");
    stop();
	}
}
void SoundManagerClass::reset()
{
	mp3_reset();
}