Added old.t
[kugel-rb.git] / apps / playback.h
blob187ac0090e5de88351d4ff3318954ff1b516249d
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 Miika Pekkarinen
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 _PLAYBACK_H
21 #define _PLAYBACK_H
23 #include <stdlib.h>
24 #include <ctype.h>
25 #include <stdbool.h>
27 #include "id3.h"
28 #include "mp3data.h"
30 #define CODEC_IDX_AUDIO 0
31 #define CODEC_IDX_VOICE 1
33 /* Not yet implemented. */
34 #define CODEC_SET_AUDIOBUF_WATERMARK 4
36 #define MAX_TRACK 32
37 struct track_info {
38 struct mp3entry id3; /* TAG metadata */
39 char *codecbuf; /* Pointer to codec buffer */
40 long codecsize; /* Codec length in bytes */
42 off_t filerem; /* Remaining bytes of file NOT in buffer */
43 off_t filesize; /* File total length */
44 off_t filepos; /* Read position of file for next buffer fill */
45 off_t start_pos; /* Position to first bytes of file in buffer */
46 volatile int available; /* Available bytes to read from buffer */
47 bool taginfo_ready; /* Is metadata read */
48 int playlist_offset; /* File location in playlist */
49 bool event_sent; /* Has event callback functions been called? */
52 /* Functions */
53 void audio_set_track_changed_event(void (*handler)(struct mp3entry *id3));
54 void audio_set_track_buffer_event(void (*handler)(struct mp3entry *id3,
55 bool last_track));
56 void audio_set_track_unbuffer_event(void (*handler)(struct mp3entry *id3,
57 bool last_track));
58 void audio_invalidate_tracks(void);
59 void voice_init(void);
61 extern void audio_next_dir(void);
62 extern void audio_prev_dir(void);
64 void audio_preinit(void);
66 #endif