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 | |
| 25 | /* PCM audio buffer. */ |
| 26 | #define PCMBUF_SIZE (1*1024*1024) |
| 27 | |
| 28 | void pcmbuf_init(void); |
| 29 | |
| 30 | void pcmbuf_play_stop(void); |
| 31 | bool pcmbuf_is_crossfade_active(void); |
| 32 | |
| 33 | /* These functions are for playing chained buffers of PCM data */ |
| 34 | bool pcmbuf_add_chunk(void *addr, int size, void (*callback)(void)); |
| 35 | int pcmbuf_num_used_buffers(void); |
| 36 | void pcmbuf_set_watermark(int numbytes, void (*callback)(int bytes_left)); |
| 37 | |
| 38 | void pcmbuf_set_boost_mode(bool state); |
| 39 | bool pcmbuf_is_lowdata(void); |
| 40 | void pcmbuf_flush_audio(void); |
| 41 | bool pcmbuf_crossfade_init(void); |
| 42 | void pcmbuf_add_event(void (*event_handler)(void)); |
| 43 | unsigned int pcmbuf_get_latency(void); |
| 44 | bool pcmbuf_insert_buffer(char *buf, long length); |
| 45 | void pcmbuf_flush_buffer(long length); |
| 46 | void* pcmbuf_request_buffer(long length, long *realsize); |
| 47 | bool pcmbuf_is_crossfade_enabled(void); |
| 48 | void pcmbuf_crossfade_enable(bool on_off); |
| 49 | |
| 50 | #endif |