Jeffrey Goode | 9a4420b | 2009-10-31 19:17:36 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 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 Gjenero | fdc29d0 | 2011-12-19 20:12:52 +0000 | [diff] [blame] | 26 | #include "config.h" |
Jeffrey Goode | 9a4420b | 2009-10-31 19:17:36 +0000 | [diff] [blame] | 27 | |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 28 | /* codec identity */ |
Jeffrey Goode | 9a4420b | 2009-10-31 19:17:36 +0000 | [diff] [blame] | 29 | const char *get_codec_filename(int cod_spec); |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 30 | |
| 31 | /* codec thread */ |
Boris Gjenero | fdc29d0 | 2011-12-19 20:12:52 +0000 | [diff] [blame] | 32 | void codec_thread_init(void) INIT_ATTR; |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 33 | |
| 34 | /* Audio MUST be stopped before requesting callback! */ |
Jeffrey Goode | 9a4420b | 2009-10-31 19:17:36 +0000 | [diff] [blame] | 35 | void codec_thread_do_callback(void (*fn)(void), |
| 36 | unsigned int *codec_thread_id); |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 37 | |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 38 | #ifdef HAVE_PRIORITY_SCHEDULING |
| 39 | int codec_thread_get_priority(void); |
| 40 | int codec_thread_set_priority(int priority); |
Jeffrey Goode | 9a4420b | 2009-10-31 19:17:36 +0000 | [diff] [blame] | 41 | #endif |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 42 | |
| 43 | /* codec commands - on audio thread only! */ |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 44 | bool codec_load(int hid, int cod_spec); |
Michael Sevakis | c537d59 | 2011-04-27 03:08:23 +0000 | [diff] [blame] | 45 | void codec_go(void); |
| 46 | bool codec_pause(void); |
| 47 | void codec_seek(long time); |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 48 | void codec_stop(void); |
Michael Sevakis | 4888131 | 2013-06-22 16:41:16 -0400 | [diff] [blame] | 49 | #ifdef HAVE_RECORDING |
| 50 | size_t codec_finish_stream(void); |
| 51 | #endif |
Michael Sevakis | c537d59 | 2011-04-27 03:08:23 +0000 | [diff] [blame] | 52 | void codec_unload(void); |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 53 | int codec_loaded(void); |
Michael Sevakis | c537d59 | 2011-04-27 03:08:23 +0000 | [diff] [blame] | 54 | |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 55 | /* */ |
| 56 | |
| 57 | #endif /* _CODEC_THREAD_H */ |