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
|
|
|
|
|
2011-08-28 07:45:35 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
|
2009-11-06 04:13:36 +00:00
|
|
|
/* Commit PCM data */
|
|
|
|
void *pcmbuf_request_buffer(int *count);
|
2011-08-28 07:45:35 +00:00
|
|
|
void pcmbuf_write_complete(int count, unsigned long elapsed, off_t offset);
|
2009-11-06 04:13:36 +00:00
|
|
|
|
|
|
|
/* Init */
|
2012-04-27 20:51:54 +00:00
|
|
|
size_t pcmbuf_init(void *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);
|
2012-02-20 05:47:21 +00:00
|
|
|
|
|
|
|
/* Track change */
|
2011-08-28 07:45:35 +00:00
|
|
|
|
|
|
|
/* Track change origin type */
|
|
|
|
enum pcm_track_change_type
|
|
|
|
{
|
|
|
|
TRACK_CHANGE_NONE = 0, /* No track change pending */
|
|
|
|
TRACK_CHANGE_MANUAL, /* Manual change (from user) */
|
|
|
|
TRACK_CHANGE_AUTO, /* Automatic change (from codec) */
|
2017-04-06 23:32:35 +00:00
|
|
|
TRACK_CHANGE_AUTO_PILEUP, /* Auto change during pending change */
|
2011-08-28 07:45:35 +00:00
|
|
|
TRACK_CHANGE_END_OF_DATA, /* Expect no more data (from codec) */
|
|
|
|
};
|
2012-02-20 05:47:21 +00:00
|
|
|
void pcmbuf_monitor_track_change(bool monitor);
|
2011-08-28 07:45:35 +00:00
|
|
|
void pcmbuf_start_track_change(enum pcm_track_change_type type);
|
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
|
2011-08-28 07:45:35 +00:00
|
|
|
void pcmbuf_request_crossfade_enable(int setting);
|
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 */
|
2011-08-28 07:45:35 +00:00
|
|
|
static FORCE_INLINE void pcmbuf_request_crossfade_enable(bool on_off)
|
2011-04-27 03:08:23 +00:00
|
|
|
{ return; (void)on_off; }
|
2011-08-28 07:45:35 +00:00
|
|
|
static FORCE_INLINE bool pcmbuf_is_same_size(void)
|
2011-04-27 03:08:23 +00:00
|
|
|
{ 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
|
|
|
/* 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_used_descs(void);
|
2012-02-20 05:47:21 +00:00
|
|
|
int pcmbuf_descs(void);
|
2005-07-13 12:48:22 +00:00
|
|
|
|
2012-02-20 05:47:21 +00:00
|
|
|
/* Fading and channel volume control */
|
2011-06-29 06:37:04 +00:00
|
|
|
void pcmbuf_fade(bool fade, bool in);
|
2011-08-23 01:37:59 +00:00
|
|
|
bool pcmbuf_fading(void);
|
2011-06-29 06:37:04 +00:00
|
|
|
void pcmbuf_soft_mode(bool shhh);
|
2012-02-20 05:47:21 +00:00
|
|
|
|
|
|
|
/* Time and position */
|
|
|
|
unsigned int pcmbuf_get_position_key(void);
|
|
|
|
void pcmbuf_sync_position_update(void);
|
|
|
|
|
|
|
|
/* 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);
|
2013-05-23 17:58:51 +00:00
|
|
|
void pcmbuf_update_frequency(void);
|
|
|
|
unsigned int pcmbuf_get_frequency(void);
|
2005-08-20 11:13:19 +00:00
|
|
|
|
2012-02-20 05:47:21 +00:00
|
|
|
#endif /* PCMBUF_H */
|