summaryrefslogtreecommitdiff
path: root/firmware/export/pcm.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2011-06-29 06:37:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2011-06-29 06:37:04 +0000
commita2b6703a369f6cdbfec1f150c408dadc877631fb (patch)
tree3145a8c1372c44711d38feefeba39c7d4098f139 /firmware/export/pcm.h
parent8411614b8a068a4f274c3841aa55aab1df1bc246 (diff)
downloadrockbox-a2b6703a369f6cdbfec1f150c408dadc877631fb.tar.gz
rockbox-a2b6703a369f6cdbfec1f150c408dadc877631fb.zip
Commit FS#12150 - Fully-functional audio mixer - and finally whip old limitations about playback of voice and other sounds when paused. Channels are independent in state and amplitude. Fade on stop/pause is handled by the channel's volume control rather than global volume which means it now works from anywhere. Opens up the possibility of plugin sounds during music playback by merely adding an additional channel enum. If any PCM drivers were not properly modified, see one of the last comments in the task for a description of the simple change that is expected. Some params are tunable in firmware/export/pcm-mixer.h as well.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30097 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/pcm.h')
-rw-r--r--firmware/export/pcm.h44
1 files changed, 2 insertions, 42 deletions
diff --git a/firmware/export/pcm.h b/firmware/export/pcm.h
index 80b5b09a79..22c5ef350e 100644
--- a/firmware/export/pcm.h
+++ b/firmware/export/pcm.h
@@ -49,7 +49,7 @@
49 49
50/** RAW PCM routines used with playback and recording **/ 50/** RAW PCM routines used with playback and recording **/
51 51
52/* Typedef for registered callback */ 52/* Typedef for registered callbacks */
53typedef void (*pcm_play_callback_type)(unsigned char **start, 53typedef void (*pcm_play_callback_type)(unsigned char **start,
54 size_t *size); 54 size_t *size);
55typedef void (*pcm_rec_callback_type)(int status, void **start, size_t *size); 55typedef void (*pcm_rec_callback_type)(int status, void **start, size_t *size);
@@ -90,34 +90,7 @@ void pcm_play_pause(bool play);
90bool pcm_is_paused(void); 90bool pcm_is_paused(void);
91bool pcm_is_playing(void); 91bool pcm_is_playing(void);
92 92
93/** The following are for internal use between pcm.c and target- 93void pcm_play_set_dma_started_callback(void (* callback)(void));
94 specific portion **/
95
96/* Called by the bottom layer ISR when more data is needed. Returns non-
97 * zero size if more data is to be played. Setting start to NULL
98 * forces stop. */
99void pcm_play_get_more_callback(void **start, size_t *size);
100
101extern unsigned long pcm_curr_sampr;
102extern unsigned long pcm_sampr;
103extern int pcm_fsel;
104
105#ifdef HAVE_PCM_DMA_ADDRESS
106void * pcm_dma_addr(void *addr);
107#endif
108
109extern volatile bool pcm_playing;
110extern volatile bool pcm_paused;
111
112void pcm_play_dma_lock(void);
113void pcm_play_dma_unlock(void);
114void pcm_play_dma_init(void) INIT_ATTR;
115void pcm_play_dma_start(const void *addr, size_t size);
116void pcm_play_dma_stop(void);
117void pcm_play_dma_pause(bool pause);
118const void * pcm_play_dma_get_peak_buffer(int *count);
119
120void pcm_dma_apply_settings(void);
121 94
122#ifdef HAVE_RECORDING 95#ifdef HAVE_RECORDING
123 96
@@ -148,19 +121,6 @@ void pcm_rec_more_ready_callback(int status, void **start, size_t *size);
148 121
149void pcm_calculate_rec_peaks(int *left, int *right); 122void pcm_calculate_rec_peaks(int *left, int *right);
150 123
151/** The following are for internal use between pcm.c and target-
152 specific portion **/
153/* DMA transfer in is currently active */
154extern volatile bool pcm_recording;
155
156/* APIs implemented in the target-specific portion */
157void pcm_rec_dma_init(void);
158void pcm_rec_dma_close(void);
159void pcm_rec_dma_start(void *addr, size_t size);
160void pcm_rec_dma_record_more(void *start, size_t size);
161void pcm_rec_dma_stop(void);
162const void * pcm_rec_dma_get_peak_buffer(void);
163
164#endif /* HAVE_RECORDING */ 124#endif /* HAVE_RECORDING */
165 125
166#endif /* PCM_PLAYBACK_H */ 126#endif /* PCM_PLAYBACK_H */