1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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
,
27 typedef int (*pcm_more_callback_type2
)(int status
);
30 void pcm_postinit(void);
32 /* set the pcm frequency - use values in hw_sampr_list
33 * use -1 for the default frequency
35 void pcm_set_frequency(unsigned int frequency
);
36 /* apply settings to hardware immediately */
37 void pcm_apply_settings(void);
39 /* This is for playing "raw" PCM data */
40 void pcm_play_data(pcm_more_callback_type get_more
,
41 unsigned char* start
, size_t size
);
43 void pcm_calculate_peaks(int *left
, int *right
);
44 size_t pcm_get_bytes_waiting(void);
46 void pcm_play_stop(void);
47 void pcm_mute(bool mute
);
48 void pcm_play_pause(bool play
);
49 bool pcm_is_paused(void);
50 bool pcm_is_playing(void);
52 /** The following are for internal use between pcm_playback.c and target-
55 /* the registered callback function to ask for more mp3 data */
56 extern volatile pcm_more_callback_type pcm_callback_for_more
;
57 extern volatile bool pcm_playing
;
58 extern volatile bool pcm_paused
;
60 extern void pcm_play_dma_start(const void *addr
, size_t size
);
61 extern void pcm_play_dma_stop(void);
62 extern void pcm_play_pause_pause(void);
63 extern void pcm_play_pause_unpause(void);
65 #endif /* PCM_PLAYBACK_H */