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 | * |
| 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 | #ifndef PCMBUF_H |
| 20 | #define PCMBUF_H |
| 21 | |
| 22 | /* Guard buffer for crossfader when dsp is enabled. */ |
| 23 | #define PCMBUF_GUARD 32768 |
| 24 | |
Miika Pekkarinen | f090dc3 | 2005-07-21 11:44:00 +0000 | [diff] [blame] | 25 | void pcmbuf_init(long bufsize); |
| 26 | long pcmbuf_get_bufsize(void); |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 27 | |
| 28 | void pcmbuf_play_stop(void); |
| 29 | bool pcmbuf_is_crossfade_active(void); |
| 30 | |
| 31 | /* These functions are for playing chained buffers of PCM data */ |
| 32 | bool pcmbuf_add_chunk(void *addr, int size, void (*callback)(void)); |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 33 | |
Miika Pekkarinen | 65d43a2 | 2005-08-28 19:55:30 +0000 | [diff] [blame] | 34 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
Miika Pekkarinen | 29aad55 | 2005-08-28 14:16:03 +0000 | [diff] [blame] | 35 | void pcmbuf_boost(bool state); |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 36 | void pcmbuf_set_boost_mode(bool state); |
Miika Pekkarinen | 65d43a2 | 2005-08-28 19:55:30 +0000 | [diff] [blame] | 37 | #else |
| 38 | #define pcmbuf_boost(state) do { } while(0) |
| 39 | #define pcmbuf_set_boost_mode(state) do { } while(0) |
| 40 | #endif |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 41 | bool pcmbuf_is_lowdata(void); |
| 42 | void pcmbuf_flush_audio(void); |
Miika Pekkarinen | 159c52d | 2005-08-20 11:13:19 +0000 | [diff] [blame] | 43 | void pcmbuf_play_start(void); |
Miika Pekkarinen | e7461b3 | 2005-11-06 16:40:20 +0000 | [diff] [blame] | 44 | bool pcmbuf_crossfade_init(void); |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 45 | void pcmbuf_add_event(void (*event_handler)(void)); |
Brandon Low | a3868d3 | 2006-01-21 22:42:44 +0000 | [diff] [blame] | 46 | void pcmbuf_set_position_callback(void (*callback)(int size)); |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 47 | unsigned int pcmbuf_get_latency(void); |
| 48 | bool pcmbuf_insert_buffer(char *buf, long length); |
| 49 | void pcmbuf_flush_buffer(long length); |
| 50 | void* pcmbuf_request_buffer(long length, long *realsize); |
| 51 | bool pcmbuf_is_crossfade_enabled(void); |
| 52 | void pcmbuf_crossfade_enable(bool on_off); |
| 53 | |
Miika Pekkarinen | 159c52d | 2005-08-20 11:13:19 +0000 | [diff] [blame] | 54 | int pcmbuf_usage(void); |
| 55 | int pcmbuf_mix_usage(void); |
| 56 | void pcmbuf_beep(int frequency, int duration, int amplitude); |
| 57 | void pcmbuf_reset_mixpos(void); |
| 58 | void pcmbuf_mix(char *buf, long length); |
| 59 | |
Miika Pekkarinen | 20b3897 | 2005-07-13 12:48:22 +0000 | [diff] [blame] | 60 | #endif |