1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Nicolas Pennequin, Jonathan Gordon
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
28 #define MAX_NAME 80 /* Max length of information strings */
29 #define MAX_TRACKS 99 /* Max number of tracks in a cuesheet */
31 struct cue_track_info
{
32 char title
[MAX_NAME
*3+1];
33 char performer
[MAX_NAME
*3+1];
34 char songwriter
[MAX_NAME
*3+1];
35 unsigned long offset
; /* ms from start of track */
40 char audio_filename
[MAX_PATH
];
42 char title
[MAX_NAME
*3+1];
43 char performer
[MAX_NAME
*3+1];
44 char songwriter
[MAX_NAME
*3+1];
47 struct cue_track_info tracks
[MAX_TRACKS
];
50 struct cue_track_info
*curr_track
;
53 extern struct cuesheet
*curr_cue
;
54 extern struct cuesheet
*temp_cue
;
56 /* returns true if cuesheet support is initialised */
57 bool cuesheet_is_enabled(void);
59 /* allocates the cuesheet buffer */
60 void cuesheet_init(void);
62 /* looks if there is a cuesheet file that has a name matching "trackpath" */
63 bool look_for_cuesheet_file(const char *trackpath
, char *found_cue_path
);
65 /* parse cuesheet "file" and store the information in "cue" */
66 bool parse_cuesheet(char *file
, struct cuesheet
*cue
);
68 /* reads a cuesheet to find the audio track associated to it */
69 bool get_trackname_from_cuesheet(char *filename
, char *buf
);
71 /* display a cuesheet struct */
72 void browse_cuesheet(struct cuesheet
*cue
);
74 /* display a cuesheet file after parsing and loading it to the plugin buffer */
75 bool display_cuesheet_content(char* filename
);
77 /* finds the index of the current track played within a cuesheet */
78 int cue_find_current_track(struct cuesheet
*cue
, unsigned long curpos
);
80 /* update the id3 info to that of the currently playing track in the cuesheet */
81 void cue_spoof_id3(struct cuesheet
*cue
, struct mp3entry
*id3
);
83 /* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */
84 bool curr_cuesheet_skip(int direction
, unsigned long curr_pos
);
86 #ifdef HAVE_LCD_BITMAP
87 /* draw track markers on the progressbar */
88 void cue_draw_markers(struct screen
*screen
, unsigned long tracklen
,
89 int x1
, int x2
, int y
, int h
);