Allow sims to shut down normally from panic code.
[maemo-rb.git] / apps / cuesheet.h
blobde5151219502019160a6d81a11012155b5240bc1
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2007 Nicolas Pennequin, Jonathan Gordon
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef _CUESHEET_H_
23 #define _CUESHEET_H_
25 #include <stdbool.h>
26 #include "screens.h"
27 #include "file.h"
28 #include "metadata.h"
30 #define MAX_NAME 80 /* Max length of information strings */
31 #define MAX_TRACKS 99 /* Max number of tracks in a cuesheet */
33 struct cue_track_info {
34 char title[MAX_NAME*3+1];
35 char performer[MAX_NAME*3+1];
36 char songwriter[MAX_NAME*3+1];
37 unsigned long offset; /* ms from start of track */
40 struct cuesheet {
41 char path[MAX_PATH];
42 char audio_filename[MAX_PATH];
44 char title[MAX_NAME*3+1];
45 char performer[MAX_NAME*3+1];
46 char songwriter[MAX_NAME*3+1];
48 int track_count;
49 struct cue_track_info tracks[MAX_TRACKS];
51 int curr_track_idx;
52 struct cue_track_info *curr_track;
55 extern struct cuesheet *curr_cue;
56 extern struct cuesheet *temp_cue;
58 /* returns true if cuesheet support is initialised */
59 bool cuesheet_is_enabled(void);
61 /* allocates the cuesheet buffer */
62 void cuesheet_init(void);
64 /* looks if there is a cuesheet file that has a name matching "trackpath" */
65 bool look_for_cuesheet_file(const char *trackpath, char *found_cue_path);
67 /* parse cuesheet "file" and store the information in "cue" */
68 bool parse_cuesheet(char *file, struct cuesheet *cue);
70 /* reads a cuesheet to find the audio track associated to it */
71 bool get_trackname_from_cuesheet(char *filename, char *buf);
73 /* display a cuesheet struct */
74 void browse_cuesheet(struct cuesheet *cue);
76 /* display a cuesheet file after parsing and loading it to the plugin buffer */
77 bool display_cuesheet_content(char* filename);
79 /* finds the index of the current track played within a cuesheet */
80 int cue_find_current_track(struct cuesheet *cue, unsigned long curpos);
82 /* update the id3 info to that of the currently playing track in the cuesheet */
83 void cue_spoof_id3(struct cuesheet *cue, struct mp3entry *id3);
85 /* skip to next track in the cuesheet towards "direction" (which is 1 or -1) */
86 bool curr_cuesheet_skip(int direction, unsigned long curr_pos);
88 #ifdef HAVE_LCD_BITMAP
89 /* draw track markers on the progressbar */
90 void cue_draw_markers(struct screen *screen, unsigned long tracklen,
91 int x1, int x2, int y, int h);
92 #endif
94 #endif