Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2005 by Miika Pekkarinen |
| 11 | * |
Daniel Stenberg | 2acc0ac | 2008-06-28 18:10:04 +0000 | [diff] [blame] | 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. |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | #ifndef PCMBUF_H |
| 22 | #define PCMBUF_H |
| 23 | |
Jeffrey Goode | 37adbee | 2009-11-06 04:13:36 +0000 | [diff] [blame] | 24 | /* Commit PCM data */ |
| 25 | void *pcmbuf_request_buffer(int *count); |
| 26 | void pcmbuf_write_complete(int count); |
| 27 | |
| 28 | /* Init */ |
Michael Sevakis | e1dd10d | 2007-03-19 22:04:17 +0000 | [diff] [blame] | 29 | size_t pcmbuf_init(unsigned char *bufend); |
Jeffrey Goode | 37adbee | 2009-11-06 04:13:36 +0000 | [diff] [blame] | 30 | |
| 31 | /* Playback */ |
Miika Pekkarinen | 159c52d | 2005-08-20 11:13:19 +0000 | [diff] [blame] | 32 | void pcmbuf_play_start(void); |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 33 | void pcmbuf_play_stop(void); |
| 34 | void pcmbuf_pause(bool pause); |
Michael Sevakis | 6510973 | 2011-02-23 14:31:13 +0000 | [diff] [blame] | 35 | void pcmbuf_monitor_track_change(bool monitor); |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 36 | void pcmbuf_start_track_change(bool manual_skip); |
Brandon Low | 413da2a | 2006-02-07 20:38:55 +0000 | [diff] [blame] | 37 | |
Jeffrey Goode | 37adbee | 2009-11-06 04:13:36 +0000 | [diff] [blame] | 38 | /* Crossfade */ |
Jeffrey Goode | 9e09534 | 2009-11-10 03:46:08 +0000 | [diff] [blame] | 39 | #ifdef HAVE_CROSSFADE |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 40 | bool pcmbuf_is_crossfade_active(void); |
| 41 | void pcmbuf_request_crossfade_enable(bool on_off); |
| 42 | bool pcmbuf_is_same_size(void); |
Jeffrey Goode | 9e09534 | 2009-11-10 03:46:08 +0000 | [diff] [blame] | 43 | #endif |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 44 | |
Jeffrey Goode | 37adbee | 2009-11-06 04:13:36 +0000 | [diff] [blame] | 45 | /* Voice */ |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 46 | void *pcmbuf_request_voice_buffer(int *count); |
| 47 | void pcmbuf_write_voice_complete(int count); |
| 48 | |
Jeffrey Goode | 37adbee | 2009-11-06 04:13:36 +0000 | [diff] [blame] | 49 | /* Debug menu, other metrics */ |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 50 | size_t pcmbuf_free(void); |
| 51 | size_t pcmbuf_get_bufsize(void); |
Brandon Low | 413da2a | 2006-02-07 20:38:55 +0000 | [diff] [blame] | 52 | int pcmbuf_descs(void); |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 53 | int pcmbuf_used_descs(void); |
| 54 | #ifdef ROCKBOX_HAS_LOGF |
| 55 | unsigned char *pcmbuf_get_meminfo(size_t *length); |
| 56 | #endif |
| 57 | |
Jeffrey Goode | b6f15f2 | 2009-11-08 04:27:27 +0000 | [diff] [blame] | 58 | /* Misc */ |
Jeffrey Goode | 04b01e1 | 2009-11-05 21:59:36 +0000 | [diff] [blame] | 59 | bool pcmbuf_is_lowdata(void); |
| 60 | void pcmbuf_set_low_latency(bool state); |
| 61 | unsigned long pcmbuf_get_latency(void); |
Jeffrey Goode | 37adbee | 2009-11-06 04:13:36 +0000 | [diff] [blame] | 62 | void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude); |
Miika Pekkarinen | 159c52d | 2005-08-20 11:13:19 +0000 | [diff] [blame] | 63 | |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 64 | #endif |