blob: 6aa340bffeabac3754143f08a528d0fc52e317ee [file] [log] [blame]
Jeffrey Goode9a4420b2009-10-31 19:17:36 +00001/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2005 Miika Pekkarinen
11 *
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.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21
22#ifndef _CODEC_THREAD_H
23#define _CODEC_THREAD_H
24
25#include <stdbool.h>
Boris Gjenerofdc29d02011-12-19 20:12:52 +000026#include "config.h"
Jeffrey Goode9a4420b2009-10-31 19:17:36 +000027
Michael Sevakis65109732011-02-23 14:31:13 +000028/* codec identity */
Jeffrey Goode9a4420b2009-10-31 19:17:36 +000029const char *get_codec_filename(int cod_spec);
Michael Sevakis65109732011-02-23 14:31:13 +000030
31/* codec thread */
Boris Gjenerofdc29d02011-12-19 20:12:52 +000032void codec_thread_init(void) INIT_ATTR;
Michael Sevakis65109732011-02-23 14:31:13 +000033
34/* Audio MUST be stopped before requesting callback! */
Jeffrey Goode9a4420b2009-10-31 19:17:36 +000035void codec_thread_do_callback(void (*fn)(void),
36 unsigned int *codec_thread_id);
Michael Sevakis65109732011-02-23 14:31:13 +000037
Michael Sevakis65109732011-02-23 14:31:13 +000038#ifdef HAVE_PRIORITY_SCHEDULING
39int codec_thread_get_priority(void);
40int codec_thread_set_priority(int priority);
Jeffrey Goode9a4420b2009-10-31 19:17:36 +000041#endif
Michael Sevakis65109732011-02-23 14:31:13 +000042
43/* codec commands - on audio thread only! */
Michael Sevakis65109732011-02-23 14:31:13 +000044bool codec_load(int hid, int cod_spec);
Michael Sevakisc537d592011-04-27 03:08:23 +000045void codec_go(void);
46bool codec_pause(void);
47void codec_seek(long time);
Michael Sevakis65109732011-02-23 14:31:13 +000048void codec_stop(void);
Michael Sevakis48881312013-06-22 16:41:16 -040049#ifdef HAVE_RECORDING
50size_t codec_finish_stream(void);
51#endif
Michael Sevakisc537d592011-04-27 03:08:23 +000052void codec_unload(void);
Michael Sevakis65109732011-02-23 14:31:13 +000053int codec_loaded(void);
Michael Sevakisc537d592011-04-27 03:08:23 +000054
Michael Sevakis65109732011-02-23 14:31:13 +000055/* */
56
57#endif /* _CODEC_THREAD_H */