summaryrefslogtreecommitdiff
path: root/apps/plugins/midi
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/midi
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/midi')
-rw-r--r--apps/plugins/midi/midiplay.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c
index 40b4f1c83c..1412d4c742 100644
--- a/apps/plugins/midi/midiplay.c
+++ b/apps/plugins/midi/midiplay.c
@@ -319,7 +319,7 @@ static inline void synthbuf(void)
319 samples_in_buf = BUF_SIZE-i; 319 samples_in_buf = BUF_SIZE-i;
320} 320}
321 321
322static void get_more(unsigned char** start, size_t* size) 322static void get_more(const void** start, size_t* size)
323{ 323{
324#ifndef SYNC 324#ifndef SYNC
325 if(lastswap != swap) 325 if(lastswap != swap)
@@ -333,10 +333,10 @@ static void get_more(unsigned char** start, size_t* size)
333 333
334 *size = samples_in_buf*sizeof(int32_t); 334 *size = samples_in_buf*sizeof(int32_t);
335#ifndef SYNC 335#ifndef SYNC
336 *start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE)); 336 *start = swap ? gmbuf : gmbuf + BUF_SIZE;
337 swap = !swap; 337 swap = !swap;
338#else 338#else
339 *start = (unsigned char*)(gmbuf); 339 *start = gmbuf;
340#endif 340#endif
341} 341}
342 342
@@ -396,7 +396,7 @@ static int midimain(const void * filename)
396 samples_this_second = 0; 396 samples_this_second = 0;
397 397
398 synthbuf(); 398 synthbuf();
399 rb->pcm_play_data(&get_more, NULL, 0); 399 rb->pcm_play_data(&get_more, NULL, NULL, 0);
400 400
401 while (!quit) 401 while (!quit)
402 { 402 {
@@ -445,7 +445,7 @@ static int midimain(const void * filename)
445 seekBackward(5); 445 seekBackward(5);
446 midi_debug("Rewind to %d:%02d\n", playing_time/60, playing_time%60); 446 midi_debug("Rewind to %d:%02d\n", playing_time/60, playing_time%60);
447 if (is_playing) 447 if (is_playing)
448 rb->pcm_play_data(&get_more, NULL, 0); 448 rb->pcm_play_data(&get_more, NULL, NULL, 0);
449 break; 449 break;
450 } 450 }
451 451
@@ -455,7 +455,7 @@ static int midimain(const void * filename)
455 seekForward(5); 455 seekForward(5);
456 midi_debug("Skip to %d:%02d\n", playing_time/60, playing_time%60); 456 midi_debug("Skip to %d:%02d\n", playing_time/60, playing_time%60);
457 if (is_playing) 457 if (is_playing)
458 rb->pcm_play_data(&get_more, NULL, 0); 458 rb->pcm_play_data(&get_more, NULL, NULL, 0);
459 break; 459 break;
460 } 460 }
461 461
@@ -470,7 +470,7 @@ static int midimain(const void * filename)
470 { 470 {
471 midi_debug("Playing from %d:%02d\n", playing_time/60, playing_time%60); 471 midi_debug("Playing from %d:%02d\n", playing_time/60, playing_time%60);
472 is_playing = true; 472 is_playing = true;
473 rb->pcm_play_data(&get_more, NULL, 0); 473 rb->pcm_play_data(&get_more, NULL, NULL, 0);
474 } 474 }
475 break; 475 break;
476 } 476 }