Document the Play Next option. (adjusted FS#6486)
[Rockbox.git] / apps / cuesheet.h
blob9dff370e09d5ff646199ae6f24ecd01d3b8fc6d2
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $$
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 64 /* 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 unsigned long offset; /* ms from start of track */
35 struct cuesheet {
36 char path[MAX_PATH];
37 char audio_filename[MAX_PATH];
39 char title[MAX_NAME];
40 char performer[MAX_NAME];
42 int track_count;
43 struct cue_track_info tracks[MAX_TRACKS];
45 int curr_track_idx;
46 struct cue_track_info *curr_track;
49 struct cuesheet *curr_cue;
50 struct cuesheet *temp_cue;
52 /* returns true if cuesheet support is initialised */
53 bool cuesheet_is_enabled(void);
55 /* allocates the cuesheet buffer */
56 void cuesheet_init(void);
58 /* looks if there is a cuesheet file that has a name matching "trackpath" */
59 bool look_for_cuesheet_file(const char *trackpath);
61 /* parse cuesheet "file" and store the information in "cue" */
62 bool parse_cuesheet(char *file, struct cuesheet *cue);
64 /* reads a cuesheet to find the audio track associated to it */
65 bool get_trackname_from_cuesheet(char *filename, char *buf);
67 /* displays a cuesheet to the screen (it is stored in the plugin buffer) */
68 bool display_cuesheet_content(char* filename);
70 /* finds the index of the current track played within a cuesheet */
71 int cue_find_current_track(struct cuesheet *cue, unsigned long curpos);
73 /* update the id3 info to that of the currently playing track in the cuesheet */
74 void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3);
76 /* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */
77 bool curr_cuesheet_skip(int direction, unsigned long curr_pos);
79 #ifdef HAVE_LCD_BITMAP
80 /* draw track markers on the progressbar */
81 void cue_draw_markers(struct screen *screen, unsigned long tracklen,
82 int x1, int x2, int y, int h);
83 #endif
85 #endif