simplify my last commit. Thanks to obo for the hint.
[Rockbox.git] / apps / cuesheet.h
blobf66b25e8003083aa5bc0b7000390bb1b3f2a9fab
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 ****************************************************************************/
20 #ifndef _CUESHEET_H_
21 #define _CUESHEET_H_
23 #include <stdbool.h>
24 #include "screens.h"
26 #define MAX_NAME 80 /* Max length of information strings */
27 #define MAX_TRACKS 99 /* Max number of tracks in a cuesheet */
29 struct cue_track_info {
30 char title[MAX_NAME];
31 char performer[MAX_NAME];
32 char songwriter[MAX_NAME];
33 unsigned long offset; /* ms from start of track */
36 struct cuesheet {
37 char path[MAX_PATH];
38 char audio_filename[MAX_PATH];
40 char title[MAX_NAME];
41 char performer[MAX_NAME];
42 char songwriter[MAX_NAME];
44 int track_count;
45 struct cue_track_info tracks[MAX_TRACKS];
47 int curr_track_idx;
48 struct cue_track_info *curr_track;
51 struct cuesheet *curr_cue;
52 struct cuesheet *temp_cue;
54 /* returns true if cuesheet support is initialised */
55 bool cuesheet_is_enabled(void);
57 /* allocates the cuesheet buffer */
58 void cuesheet_init(void);
60 /* looks if there is a cuesheet file that has a name matching "trackpath" */
61 bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path);
63 /* parse cuesheet "file" and store the information in "cue" */
64 bool parse_cuesheet(char *file, struct cuesheet *cue);
66 /* reads a cuesheet to find the audio track associated to it */
67 bool get_trackname_from_cuesheet(char *filename, char *buf);
69 /* display a cuesheet struct */
70 void browse_cuesheet(struct cuesheet *cue);
72 /* display a cuesheet file after parsing and loading it to the plugin buffer */
73 bool display_cuesheet_content(char* filename);
75 /* finds the index of the current track played within a cuesheet */
76 int cue_find_current_track(struct cuesheet *cue, unsigned long curpos);
78 /* update the id3 info to that of the currently playing track in the cuesheet */
79 void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3);
81 /* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */
82 bool curr_cuesheet_skip(int direction, unsigned long curr_pos);
84 #ifdef HAVE_LCD_BITMAP
85 /* draw track markers on the progressbar */
86 void cue_draw_markers(struct screen *screen, unsigned long tracklen,
87 int x1, int x2, int y, int h);
88 #endif
90 #endif