More catching up on old work. Refine audio interface setup on Coldfire. Stop the...
[Rockbox.git] / firmware / export / pcm_playback.h
blob28409c01d97ce8d7074c902ac1bc42cd6a147550
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
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.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
19 #ifndef PCM_PLAYBACK_H
20 #define PCM_PLAYBACK_H
22 #include <sys/types.h>
24 /* Typedef for registered callback (play and record) */
25 typedef void (*pcm_more_callback_type)(unsigned char **start,
26 size_t *size);
27 typedef int (*pcm_more_callback_type2)(int status);
29 void pcm_init(void);
31 /* set the pcm frequency - use values in hw_sampr_list
32 * use -1 for the default frequency
34 void pcm_set_frequency(unsigned int frequency);
35 /* apply settings to hardware immediately */
36 void pcm_apply_settings(void);
38 /* This is for playing "raw" PCM data */
39 void pcm_play_data(pcm_more_callback_type get_more,
40 unsigned char* start, size_t size);
42 void pcm_calculate_peaks(int *left, int *right);
43 size_t pcm_get_bytes_waiting(void);
45 void pcm_play_stop(void);
46 void pcm_mute(bool mute);
47 void pcm_play_pause(bool play);
48 bool pcm_is_paused(void);
49 bool pcm_is_playing(void);
51 /** The following are for internal use between pcm_playback.c and target-
52 specific portion **/
54 /* the registered callback function to ask for more mp3 data */
55 extern volatile pcm_more_callback_type pcm_callback_for_more;
56 extern volatile bool pcm_playing;
57 extern volatile bool pcm_paused;
59 extern void pcm_play_dma_start(const void *addr, size_t size);
60 extern void pcm_play_dma_stop(void);
61 extern void pcm_play_pause_pause(void);
62 extern void pcm_play_pause_unpause(void);
64 #endif /* PCM_PLAYBACK_H */