Update several codec Makefiles so that the codec libs build again on Coldfire targets...
[Rockbox.git] / apps / playback.h
blobccf8b584722e6a61944657e8264f0662e2b95d5a
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 #if MEM > 1
37 #define MAX_TRACK 32
38 #else
39 #define MAX_TRACK 8
40 #endif
42 #define MAX_TRACK_MASK (MAX_TRACK-1)
44 struct track_info {
45 struct mp3entry id3; /* TAG metadata */
46 char *codecbuf; /* Pointer to codec buffer */
47 size_t codecsize; /* Codec length in bytes */
48 bool has_codec; /* Does this track have a codec on the buffer */
50 size_t buf_idx; /* Pointer to the track's buffer */
51 size_t filerem; /* Remaining bytes of file NOT in buffer */
52 size_t filesize; /* File total length */
53 size_t start_pos; /* Position to first bytes of file in buffer */
54 volatile size_t available; /* Available bytes to read from buffer */
56 bool taginfo_ready; /* Is metadata read */
58 bool event_sent; /* Was this track's buffered event sent */
61 /* Functions */
62 void audio_set_track_changed_event(void (*handler)(struct mp3entry *id3));
63 void audio_set_track_buffer_event(void (*handler)(struct mp3entry *id3,
64 bool last_track));
65 void audio_set_track_unbuffer_event(void (*handler)(struct mp3entry *id3,
66 bool last_track));
67 void voice_init(void);
68 void voice_stop(void);
70 #if CONFIG_CODEC == SWCODEC /* This #ifdef is better here than gui/gwps.c */
71 extern void audio_next_dir(void);
72 extern void audio_prev_dir(void);
73 #else
74 #define audio_next_dir()
75 #define audio_prev_dir()
76 #endif
77 void audio_preinit(void);
79 #endif