2005-07-13 12:48:22 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2005 by Miika Pekkarinen
|
|
|
|
*
|
2008-06-28 18:10:04 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2005-07-13 12:48:22 +00:00
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef PCMBUF_H
|
|
|
|
#define PCMBUF_H
|
|
|
|
|
2009-11-06 04:13:36 +00:00
|
|
|
/* Commit PCM data */
|
|
|
|
void *pcmbuf_request_buffer(int *count);
|
|
|
|
void pcmbuf_write_complete(int count);
|
|
|
|
|
|
|
|
/* Init */
|
2009-11-05 21:59:36 +00:00
|
|
|
size_t pcmbuf_init(unsigned char *bufend);
|
2009-11-06 04:13:36 +00:00
|
|
|
|
|
|
|
/* Playback */
|
2009-11-05 21:59:36 +00:00
|
|
|
void pcmbuf_play_start(void);
|
|
|
|
void pcmbuf_play_stop(void);
|
|
|
|
void pcmbuf_pause(bool pause);
|
2011-02-23 14:31:13 +00:00
|
|
|
void pcmbuf_monitor_track_change(bool monitor);
|
2011-04-27 03:08:23 +00:00
|
|
|
bool pcmbuf_start_track_change(bool manual_skip);
|
2005-07-13 12:48:22 +00:00
|
|
|
|
2009-11-06 04:13:36 +00:00
|
|
|
/* Crossfade */
|
2009-11-10 03:46:08 +00:00
|
|
|
#ifdef HAVE_CROSSFADE
|
2009-11-05 21:59:36 +00:00
|
|
|
bool pcmbuf_is_crossfade_active(void);
|
|
|
|
void pcmbuf_request_crossfade_enable(bool on_off);
|
2007-03-19 22:04:17 +00:00
|
|
|
bool pcmbuf_is_same_size(void);
|
2011-04-27 03:08:23 +00:00
|
|
|
#else
|
|
|
|
/* Dummy functions with sensible returns */
|
|
|
|
static inline bool pcmbuf_is_crossfade_active(void)
|
|
|
|
{ return false; }
|
|
|
|
static inline void pcmbuf_request_crossfade_enable(bool on_off)
|
|
|
|
{ return; (void)on_off; }
|
|
|
|
static inline bool pcmbuf_is_same_size(void)
|
|
|
|
{ return true; }
|
2009-11-10 03:46:08 +00:00
|
|
|
#endif
|
2009-11-05 21:59:36 +00:00
|
|
|
|
2009-11-06 04:13:36 +00:00
|
|
|
/* Voice */
|
2009-11-05 21:59:36 +00:00
|
|
|
void *pcmbuf_request_voice_buffer(int *count);
|
|
|
|
void pcmbuf_write_voice_complete(int count);
|
|
|
|
|
2009-11-06 04:13:36 +00:00
|
|
|
/* Debug menu, other metrics */
|
2009-11-05 21:59:36 +00:00
|
|
|
size_t pcmbuf_free(void);
|
2006-02-07 20:38:55 +00:00
|
|
|
size_t pcmbuf_get_bufsize(void);
|
2009-11-05 21:59:36 +00:00
|
|
|
int pcmbuf_descs(void);
|
|
|
|
int pcmbuf_used_descs(void);
|
2007-03-19 22:04:17 +00:00
|
|
|
#ifdef ROCKBOX_HAS_LOGF
|
2009-11-05 21:59:36 +00:00
|
|
|
unsigned char *pcmbuf_get_meminfo(size_t *length);
|
2007-03-19 22:04:17 +00:00
|
|
|
#endif
|
2005-07-13 12:48:22 +00:00
|
|
|
|
2009-11-08 04:27:27 +00:00
|
|
|
/* Misc */
|
2005-07-13 12:48:22 +00:00
|
|
|
bool pcmbuf_is_lowdata(void);
|
2006-02-07 19:17:51 +00:00
|
|
|
void pcmbuf_set_low_latency(bool state);
|
2009-11-05 21:59:36 +00:00
|
|
|
unsigned long pcmbuf_get_latency(void);
|
2009-11-06 04:13:36 +00:00
|
|
|
void pcmbuf_beep(unsigned int frequency, size_t duration, int amplitude);
|
2005-08-20 11:13:19 +00:00
|
|
|
|
2005-07-13 12:48:22 +00:00
|
|
|
#endif
|