A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

rockboy: rename pcm_*() functions to avoid namespace clash with rockbox

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26327 a1c6a512-1295-4272-9138-f99709370657

+20 -20
+6 -6
apps/plugins/rockboy/HACKING
··· 364 364 each frame. 365 365 366 366 The main sound module interfaces with the system-specific code through 367 - one structure, pcm, and a few functions: pcm_init, pcm_close, and 368 - pcm_submit. While the first two should be obvious, pcm_submit needs 367 + one structure, pcm, and a few functions: rockboy_pcm_init, rockboy_pcm_close, and 368 + rockboy_pcm_submit. While the first two should be obvious, rockboy_pcm_submit needs 369 369 some explaining. Whenever realtime sound output is operational, 370 - pcm_submit is responsible for timing, and should not return until it 370 + rockboy_pcm_submit is responsible for timing, and should not return until it 371 371 has successfully processed all the data in its input buffer (pcm.buf). 372 372 On *nix sound devices, this typically means just waiting for the write 373 373 syscall to return, but on systems such as DOS where low level IO must 374 - be handled in the program, pcm_submit needs to delay until the current 374 + be handled in the program, rockboy_pcm_submit needs to delay until the current 375 375 position in the DMA buffer has advanced sufficiently to make space for 376 376 the new samples, then copy them. 377 377 378 378 For special sound output implementations like write-to-file or the 379 - dummy sound device, pcm_submit should write the data immediately and 379 + dummy sound device, rockboy_pcm_submit should write the data immediately and 380 380 return 0, indicating to the caller that other methods must be used for 381 381 timing. On real sound devices that are presently functional, 382 - pcm_submit should return 1, regardless of whether it buffered or 382 + rockboy_pcm_submit should return 1, regardless of whether it buffered or 383 383 actually wrote the sound data. 384 384 385 385 And yes, for unices without OSS, we hope to add piped audio output
+1 -1
apps/plugins/rockboy/emu.c
··· 56 56 if (options.sound || !plugbuf) 57 57 { 58 58 sound_mix(); 59 - pcm_submit(); 59 + rockboy_pcm_submit(); 60 60 } 61 61 62 62 doevents();
+1 -1
apps/plugins/rockboy/menu.c
··· 85 85 "Load Game", "Save Game", 86 86 "Options", "Quit"); 87 87 88 - pcm_init(); 88 + rockboy_pcm_init(); 89 89 90 90 while(!done) 91 91 {
+3 -3
apps/plugins/rockboy/pcm.h
··· 15 15 16 16 extern struct pcm pcm; 17 17 18 - void pcm_init(void); 19 - int pcm_submit(void); 20 - void pcm_close(void); 18 + void rockboy_pcm_init(void); 19 + int rockboy_pcm_submit(void); 20 + void rockboy_pcm_close(void); 21 21 22 22 #endif 23 23
+6 -6
apps/plugins/rockboy/rbsound.c
··· 24 24 doneplay=1; 25 25 } 26 26 27 - void pcm_init(void) 27 + void rockboy_pcm_init(void) 28 28 { 29 29 if(plugbuf) 30 30 return; ··· 61 61 rb->pcm_set_frequency(pcm.hz); /* 44100 22050 11025 */ 62 62 } 63 63 64 - void pcm_close(void) 64 + void rockboy_pcm_close(void) 65 65 { 66 66 memset(&pcm, 0, sizeof pcm); 67 67 newly_started = true; ··· 69 69 rb->pcm_set_frequency(HW_SAMPR_DEFAULT); 70 70 } 71 71 72 - int pcm_submit(void) 72 + int rockboy_pcm_submit(void) 73 73 { 74 74 if (!pcm.buf) return 0; 75 75 if (pcm.pos < pcm.len) return 1; ··· 91 91 92 92 #else 93 93 94 - void pcm_init(void) 94 + void rockboy_pcm_init(void) 95 95 { 96 96 pcm.hz = 44100; 97 97 pcm.stereo = 1; ··· 100 100 pcm.pos = 0; 101 101 } 102 102 103 - void pcm_close(void) 103 + void rockboy_pcm_close(void) 104 104 { 105 105 memset(&pcm, 0, sizeof pcm); 106 106 } 107 107 108 - int pcm_submit(void) 108 + int rockboy_pcm_submit(void) 109 109 { 110 110 pcm.pos =0; 111 111 return 0;
+2 -2
apps/plugins/rockboy/rockboy.c
··· 361 361 rb->lcd_puts(0,0,"Init video"); 362 362 vid_init(); 363 363 rb->lcd_puts(0,1,"Init sound"); 364 - pcm_init(); 364 + rockboy_pcm_init(); 365 365 rb->lcd_puts(0,2,"Loading rom"); 366 366 loader_init(rom); 367 367 if(shut) ··· 438 438 return PLUGIN_ERROR; 439 439 } 440 440 if(!rb->audio_status()) 441 - pcm_close(); 441 + rockboy_pcm_close(); 442 442 443 443 rb->splash(HZ/2, "Closing Rockboy"); 444 444
+1 -1
apps/plugins/rockboy/sound.c
··· 422 422 if (pcm.buf) 423 423 { 424 424 if (pcm.pos >= pcm.len) 425 - pcm_submit(); 425 + rockboy_pcm_submit(); 426 426 if (pcm.stereo) 427 427 { 428 428 pcm.buf[pcm.pos++] = l;