summaryrefslogtreecommitdiff
path: root/apps/plugins/beatbox/beatbox.c
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/beatbox/beatbox.c
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/beatbox/beatbox.c')
-rw-r--r--apps/plugins/beatbox/beatbox.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/plugins/beatbox/beatbox.c b/apps/plugins/beatbox/beatbox.c
index 8ecbabd1e5..8c7413cc99 100644
--- a/apps/plugins/beatbox/beatbox.c
+++ b/apps/plugins/beatbox/beatbox.c
@@ -509,7 +509,7 @@ void redrawScreen(unsigned char force)
509 rb->lcd_update(); 509 rb->lcd_update();
510} 510}
511 511
512void get_more(unsigned char** start, size_t* size) 512void get_more(const void** start, size_t* size)
513{ 513{
514#ifndef SYNC 514#ifndef SYNC
515 if(lastswap!=swap) 515 if(lastswap!=swap)
@@ -523,10 +523,10 @@ void get_more(unsigned char** start, size_t* size)
523 523
524 *size = BUF_SIZE*sizeof(short); 524 *size = BUF_SIZE*sizeof(short);
525#ifndef SYNC 525#ifndef SYNC
526 *start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE)); 526 *start = swap ? gmbuf : gmbuf + BUF_SIZE;
527 swap=!swap; 527 swap=!swap;
528#else 528#else
529 *start = (unsigned char*)(gmbuf); 529 *start = gmbuf;
530#endif 530#endif
531} 531}
532 532
@@ -537,7 +537,7 @@ int beatboxmain()
537 537
538 numberOfSamples=44100/10; 538 numberOfSamples=44100/10;
539 synthbuf(); 539 synthbuf();
540 rb->pcm_play_data(&get_more, NULL, 0); 540 rb->pcm_play_data(&get_more, NULL, NULL, 0);
541 541
542 rb->lcd_set_background(0x000000); 542 rb->lcd_set_background(0x000000);
543 rb->lcd_clear_display(); 543 rb->lcd_clear_display();