blob: cfb1509b041e568a7cbc306e4b45c664b0a3d53d [file] [log] [blame]
Linus Nielsen Feltzing1c497e62005-06-05 23:05:10 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Miika Pekkarinen
11 *
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.
14 *
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
17 *
18 ****************************************************************************/
19
Dave Chapman3ad485b2005-06-14 22:27:57 +000020#ifndef _PLAYBACK_H
21#define _PLAYBACK_H
22
Dave Chapman3ad485b2005-06-14 22:27:57 +000023#include <stdbool.h>
24
25#include "id3.h"
26#include "mp3data.h"
Linus Nielsen Feltzing1c497e62005-06-05 23:05:10 +000027
Miika Pekkarinen68b9acd2005-06-10 15:02:10 +000028/* Not yet implemented. */
29#define CODEC_SET_AUDIOBUF_WATERMARK 4
30
Dave Chapman0a7ded32006-08-13 09:19:24 +000031#if MEM > 1
Nicolas Pennequin3e3c43c2007-10-25 21:27:45 +000032#define MAX_TRACK 128
Tomasz Malesinski28910e72006-08-12 23:01:52 +000033#else
Nicolas Pennequin3e3c43c2007-10-25 21:27:45 +000034#define MAX_TRACK 32
Tomasz Malesinski28910e72006-08-12 23:01:52 +000035#endif
36
Miika Pekkarinend43bff92006-07-29 17:25:31 +000037#define MAX_TRACK_MASK (MAX_TRACK-1)
38
Miika Pekkarinen7d6d1222005-06-29 21:36:30 +000039/* Functions */
Steve Bavin135cc752008-03-28 12:51:33 +000040const char *get_codec_filename(int cod_spec);
Nils Wallménius5b769362007-08-06 13:08:36 +000041void voice_wait(void);
Steve Bavinc9df8fd2008-03-28 11:24:24 +000042void audio_wait_for_init(void);
43int audio_track_count(void);
44long audio_filebufused(void);
45void audio_pre_ff_rewind(void);
Steve Bavin135cc752008-03-28 12:51:33 +000046void audio_set_crossfade(int type);
Steve Bavinc9df8fd2008-03-28 11:24:24 +000047
48void audio_hard_stop(void); /* Stops audio from serving playback */
49
50enum
51{
52 AUDIO_WANT_PLAYBACK = 0,
53 AUDIO_WANT_VOICE,
54};
Steve Bavin135cc752008-03-28 12:51:33 +000055bool audio_restore_playback(int type); /* Restores the audio buffer to handle the requested playback */
Steve Bavinc9df8fd2008-03-28 11:24:24 +000056
57#ifdef HAVE_ALBUMART
58int audio_current_aa_hid(void);
59#endif
Miika Pekkarinen7d6d1222005-06-29 21:36:30 +000060
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000061#if CONFIG_CODEC == SWCODEC /* This #ifdef is better here than gui/gwps.c */
Anton Oleynikov00928af2005-11-10 22:31:47 +000062extern void audio_next_dir(void);
63extern void audio_prev_dir(void);
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000064#else
Steve Bavinc9df8fd2008-03-28 11:24:24 +000065#define audio_next_dir()
Linus Nielsen Feltzing224c0a12006-08-15 12:27:07 +000066#define audio_prev_dir()
67#endif
Miika Pekkarinend3191162006-01-27 11:39:46 +000068
Linus Nielsen Feltzing1c497e62005-06-05 23:05:10 +000069#endif
70
71