summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2012-02-23 08:14:46 -0500
committerMichael Sevakis <jethead71@rockbox.org>2012-03-03 07:23:38 +0100
commit286a4c5caa1945c8d1cb365a3d90fb09d5700cb2 (patch)
tree4835f46d16ec78d035ec9f49333079fe618384c1 /apps/plugins/pacbox
parent3f82f3aca14eb954e55f761721ffdd2684f0e812 (diff)
downloadrockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.tar.gz
rockbox-286a4c5caa1945c8d1cb365a3d90fb09d5700cb2.zip
Revise the PCM callback system after adding multichannel audio.
Additional status callback is added to pcm_play/rec_data instead of using a special function to set it. Status includes DMA error reporting to the status callback. Playback and recording callback become more alike except playback uses "const void **addr" (because the data should not be altered) and recording uses "void **addr". "const" is put in place throughout where appropriate. Most changes are fairly trivial. One that should be checked in particular because it isn't so much is telechips, if anyone cares to bother. PP5002 is not so trivial either but that tested as working. Change-Id: I4928d69b3b3be7fb93e259f81635232df9bd1df2 Reviewed-on: http://gerrit.rockbox.org/166 Reviewed-by: Michael Sevakis <jethead71@rockbox.org> Tested-by: Michael Sevakis <jethead71@rockbox.org>
Diffstat (limited to 'apps/plugins/pacbox')
-rw-r--r--apps/plugins/pacbox/pacbox.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 5165ff3047..efba47b576 100644
--- a/apps/plugins/pacbox/pacbox.c
+++ b/apps/plugins/pacbox/pacbox.c
@@ -286,7 +286,7 @@ static int16_t raw_buf[NBSAMPLES] IBSS_ATTR;
286/* 286/*
287 Audio callback 287 Audio callback
288 */ 288 */
289static void get_more(unsigned char **start, size_t *size) 289static void get_more(const void **start, size_t *size)
290{ 290{
291 int32_t *out, *outend; 291 int32_t *out, *outend;
292 int16_t *raw; 292 int16_t *raw;
@@ -306,7 +306,7 @@ static void get_more(unsigned char **start, size_t *size)
306 } 306 }
307 while (out < outend); 307 while (out < outend);
308 308
309 *start = (unsigned char *)sound_buf; 309 *start = sound_buf;
310 *size = NBSAMPLES*sizeof(sound_buf[0]); 310 *size = NBSAMPLES*sizeof(sound_buf[0]);
311} 311}
312 312
@@ -339,7 +339,7 @@ static void start_sound(void)
339 wsg3_set_sampling_rate(rb->hw_freq_sampr[sr_index]); 339 wsg3_set_sampling_rate(rb->hw_freq_sampr[sr_index]);
340 340
341 rb->pcm_set_frequency(rb->hw_freq_sampr[sr_index]); 341 rb->pcm_set_frequency(rb->hw_freq_sampr[sr_index]);
342 rb->pcm_play_data(get_more, NULL, 0); 342 rb->pcm_play_data(get_more, NULL, NULL, 0);
343 343
344 sound_playing = true; 344 sound_playing = true;
345} 345}