Revert r14786 which resulted in a substantial reduction in accuracy to save a 7.6KB...
[kugel-rb.git] / apps / cuesheet.h
blobe80b4396df9749e8b31a8d3aac3d7192d67f7451
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"
25 #include "file.h"
26 #include "id3.h"
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 */
38 struct cuesheet {
39 char path[MAX_PATH];
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];
46 int track_count;
47 struct cue_track_info tracks[MAX_TRACKS];
49 int curr_track_idx;
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);
90 #endif
92 #endif