/*************************************************************************** * __________ __ ___. * Open \______ \ ____ ____ | | _\_ |__ _______ ___ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ * \/ \/ \/ \/ \/ * Copyright (C) 2002 by Dave Chapman * * All files in this archive are subject to the GNU General Public License. * See the file COPYING in the source tree root for full license agreement. * * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY * KIND, either express or implied. * ****************************************************************************/ #ifndef _CUEFILE_H_ #define _CUEFILE_H_ #ifdef DEBUG_STANDALONE #define MAX_PATH 255 #endif #define MAX_CUEFILE_SIZE 8192 /* Maximum size (in bytes) of a cue file */ #define MAX_TRACKS_IN_CUEFILE 99 /* Maximum number of tracks in a cue file */ struct cuefile_entry_t { /* These are offsets into the cuefile in memory. The closing " character in the cuefile is replaced by a zero for title and performer */ unsigned short title_ofs; unsigned short performer_ofs; unsigned short track_index_ofs; /* The actual track offset in the mpeg audio file (in milliseconds) */ int track_index; }; struct cuefile_t { char filename[MAX_PATH]; /* The cue file is read into memory */ unsigned short filesize; unsigned char buf[MAX_CUEFILE_SIZE]; /* Number of indexes in cue list */ unsigned char n; /* The information for each track */ struct cuefile_entry_t tracks[MAX_TRACKS_IN_CUEFILE+1]; }; int read_cuefile(struct cuefile_t* cuefile, char* mp3filename); void get_next_cue(int elapsed,struct cuefile_t* cuefile, int* next_subtrack); void get_prev_cue(int elapsed,struct cuefile_t* cuefile, int* prev_subtrack); #endif