summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/beatbox/beatbox.c8
-rw-r--r--apps/plugins/doom/i_sound.c6
-rw-r--r--apps/plugins/fft/fft.c4
-rw-r--r--apps/plugins/metronome.c2
-rw-r--r--apps/plugins/midi/midiplay.c14
-rw-r--r--apps/plugins/mikmod/mikmod.c10
-rw-r--r--apps/plugins/mpegplayer/pcm_output.c2
-rw-r--r--apps/plugins/pacbox/pacbox.c6
-rw-r--r--apps/plugins/pdbox/PDa/src/s_audio_rockbox.c10
-rw-r--r--apps/plugins/pitch_detector.c7
-rw-r--r--apps/plugins/rockboy/rbsound.c6
-rw-r--r--apps/plugins/test_sampr.c6
-rw-r--r--apps/plugins/zxbox/spsound.c9
13 files changed, 43 insertions, 47 deletions
diff --git a/apps/plugins/beatbox/beatbox.c b/apps/plugins/beatbox/beatbox.c
index 8ecbabd..8c7413c 100644
--- a/apps/plugins/beatbox/beatbox.c
+++ b/apps/plugins/beatbox/beatbox.c
@@ -509,7 +509,7 @@ void redrawScreen(unsigned char force)
rb->lcd_update();
}
-void get_more(unsigned char** start, size_t* size)
+void get_more(const void** start, size_t* size)
{
#ifndef SYNC
if(lastswap!=swap)
@@ -523,10 +523,10 @@ void get_more(unsigned char** start, size_t* size)
*size = BUF_SIZE*sizeof(short);
#ifndef SYNC
- *start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE));
+ *start = swap ? gmbuf : gmbuf + BUF_SIZE;
swap=!swap;
#else
- *start = (unsigned char*)(gmbuf);
+ *start = gmbuf;
#endif
}
@@ -537,7 +537,7 @@ int beatboxmain()
numberOfSamples=44100/10;
synthbuf();
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
rb->lcd_set_background(0x000000);
rb->lcd_clear_display();
diff --git a/apps/plugins/doom/i_sound.c b/apps/plugins/doom/i_sound.c
index 2d7b592..bdf70c1 100644
--- a/apps/plugins/doom/i_sound.c
+++ b/apps/plugins/doom/i_sound.c
@@ -457,11 +457,11 @@ void I_UpdateSound( void )
// only output be done asynchronous?
//
-void get_more(unsigned char** start, size_t* size)
+void get_more(const void** start, size_t* size)
{
I_UpdateSound(); // Force sound update
- *start = (unsigned char*)(mixbuffer);
+ *start = mixbuffer;
*size = SAMPLECOUNT*2*sizeof(short);
}
@@ -471,7 +471,7 @@ void I_SubmitSound(void)
if (!enable_sound)
return;
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
}
void I_ShutdownSound(void)
diff --git a/apps/plugins/fft/fft.c b/apps/plugins/fft/fft.c
index 1c4e1b4..f7d8943 100644
--- a/apps/plugins/fft/fft.c
+++ b/apps/plugins/fft/fft.c
@@ -1186,8 +1186,8 @@ static inline bool fft_init_fft_lib(void)
static inline bool fft_get_fft(void)
{
int count;
- int16_t *value =
- (int16_t *) rb->mixer_channel_get_buffer(PCM_MIXER_CHAN_PLAYBACK, &count);
+ const int16_t *value =
+ rb->mixer_channel_get_buffer(PCM_MIXER_CHAN_PLAYBACK, &count);
/* This block can introduce discontinuities in our data. Meaning, the
* FFT will not be done a continuous segment of the signal. Which can
* be bad. Or not.
diff --git a/apps/plugins/metronome.c b/apps/plugins/metronome.c
index da035a7..2974055 100644
--- a/apps/plugins/metronome.c
+++ b/apps/plugins/metronome.c
@@ -721,7 +721,7 @@ static void prepare_tock(void)
static void play_tock(void)
{
- rb->pcm_play_data(NULL,(unsigned char *)sndbuf,sizeof(sndbuf));
+ rb->pcm_play_data(NULL, NULL, sndbuf, sizeof(sndbuf));
}
#endif /* CONFIG_CODEC != SWCODEC */
diff --git a/apps/plugins/midi/midiplay.c b/apps/plugins/midi/midiplay.c
index 40b4f1c..1412d4c 100644
--- a/apps/plugins/midi/midiplay.c
+++ b/apps/plugins/midi/midiplay.c
@@ -319,7 +319,7 @@ static inline void synthbuf(void)
samples_in_buf = BUF_SIZE-i;
}
-static void get_more(unsigned char** start, size_t* size)
+static void get_more(const void** start, size_t* size)
{
#ifndef SYNC
if(lastswap != swap)
@@ -333,10 +333,10 @@ static void get_more(unsigned char** start, size_t* size)
*size = samples_in_buf*sizeof(int32_t);
#ifndef SYNC
- *start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE));
+ *start = swap ? gmbuf : gmbuf + BUF_SIZE;
swap = !swap;
#else
- *start = (unsigned char*)(gmbuf);
+ *start = gmbuf;
#endif
}
@@ -396,7 +396,7 @@ static int midimain(const void * filename)
samples_this_second = 0;
synthbuf();
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
while (!quit)
{
@@ -445,7 +445,7 @@ static int midimain(const void * filename)
seekBackward(5);
midi_debug("Rewind to %d:%02d\n", playing_time/60, playing_time%60);
if (is_playing)
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
break;
}
@@ -455,7 +455,7 @@ static int midimain(const void * filename)
seekForward(5);
midi_debug("Skip to %d:%02d\n", playing_time/60, playing_time%60);
if (is_playing)
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
break;
}
@@ -470,7 +470,7 @@ static int midimain(const void * filename)
{
midi_debug("Playing from %d:%02d\n", playing_time/60, playing_time%60);
is_playing = true;
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
}
break;
}
diff --git a/apps/plugins/mikmod/mikmod.c b/apps/plugins/mikmod/mikmod.c
index a7eeb50..eb3be13 100644
--- a/apps/plugins/mikmod/mikmod.c
+++ b/apps/plugins/mikmod/mikmod.c
@@ -268,7 +268,7 @@ static inline void synthbuf(void)
VC_WriteBytes(outptr, BUF_SIZE);
}
-void get_more(unsigned char** start, size_t* size)
+void get_more(const void** start, size_t* size)
{
#ifndef SYNC
if (lastswap != swap)
@@ -282,10 +282,10 @@ void get_more(unsigned char** start, size_t* size)
*size = BUF_SIZE;
#ifndef SYNC
- *start = (unsigned char*)((swap ? gmbuf : gmbuf + BUF_SIZE));
+ *start = swap ? gmbuf : gmbuf + BUF_SIZE;
swap = !swap;
#else
- *start = (unsigned char*)(gmbuf);
+ *start = gmbuf;
#endif
}
@@ -660,7 +660,7 @@ int playfile(char* filename)
{
display = DISPLAY_INFO;
Player_Start(module);
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
}
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
@@ -804,7 +804,7 @@ int playfile(char* filename)
}
else
{
- rb->pcm_play_data(&get_more, NULL, 0);
+ rb->pcm_play_data(&get_more, NULL, NULL, 0);
}
Player_TogglePause();
break;
diff --git a/apps/plugins/mpegplayer/pcm_output.c b/apps/plugins/mpegplayer/pcm_output.c
index 8db9531..8694ae4 100644
--- a/apps/plugins/mpegplayer/pcm_output.c
+++ b/apps/plugins/mpegplayer/pcm_output.c
@@ -85,7 +85,7 @@ static inline ssize_t pcm_output_bytes_free(void)
}
/* Audio DMA handler */
-static void get_more(unsigned char **start, size_t *size)
+static void get_more(const void **start, size_t *size)
{
ssize_t sz;
diff --git a/apps/plugins/pacbox/pacbox.c b/apps/plugins/pacbox/pacbox.c
index 5165ff3..efba47b 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;
/*
Audio callback
*/
-static void get_more(unsigned char **start, size_t *size)
+static void get_more(const void **start, size_t *size)
{
int32_t *out, *outend;
int16_t *raw;
@@ -306,7 +306,7 @@ static void get_more(unsigned char **start, size_t *size)
}
while (out < outend);
- *start = (unsigned char *)sound_buf;
+ *start = sound_buf;
*size = NBSAMPLES*sizeof(sound_buf[0]);
}
@@ -339,7 +339,7 @@ static void start_sound(void)
wsg3_set_sampling_rate(rb->hw_freq_sampr[sr_index]);
rb->pcm_set_frequency(rb->hw_freq_sampr[sr_index]);
- rb->pcm_play_data(get_more, NULL, 0);
+ rb->pcm_play_data(get_more, NULL, NULL, 0);
sound_playing = true;
}
diff --git a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c
index 76a50fa..6571f74 100644
--- a/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c
+++ b/apps/plugins/pdbox/PDa/src/s_audio_rockbox.c
@@ -26,7 +26,7 @@
#include "s_stuff.h"
/* Declare functions that go to IRAM. */
-void pdbox_get_more(unsigned char** start, size_t* size) ICODE_ATTR;
+void pdbox_get_more(const void** start, size_t* size) ICODE_ATTR;
int rockbox_send_dacs(void) ICODE_ATTR;
/* Extern variables. */
@@ -90,12 +90,12 @@ void rockbox_close_audio(void)
}
/* Rockbox audio callback. */
-void pdbox_get_more(unsigned char** start, size_t* size)
+void pdbox_get_more(const void** start, size_t* size)
{
if(outbuf_fill > 0)
{
/* Store output data address and size. */
- *start = (unsigned char*) outbuf[outbuf_tail].data;
+ *start = outbuf[outbuf_tail].data;
*size = sizeof(outbuf[outbuf_tail].data);
/* Free this part of output buffer. */
@@ -116,8 +116,6 @@ void pdbox_get_more(unsigned char** start, size_t* size)
playing = false;
/* Nothing to play. */
- *start = NULL;
- *size = 0;
}
}
@@ -185,7 +183,7 @@ int rockbox_send_dacs(void)
if(!playing && outbuf_fill > 0)
{
/* Start playing. */
- rb->pcm_play_data(pdbox_get_more, NULL, 0);
+ rb->pcm_play_data(pdbox_get_more, NULL, NULL, 0);
/* Set status flag. */
playing = true;
diff --git a/apps/plugins/pitch_detector.c b/apps/plugins/pitch_detector.c
index c30d48a..4ae43b3 100644
--- a/apps/plugins/pitch_detector.c
+++ b/apps/plugins/pitch_detector.c
@@ -952,7 +952,7 @@ static uint32_t ICODE_ATTR buffer_magnitude(int16_t *input)
}
/* Stop the recording when the buffer is full */
-static void recording_callback(int status, void **start, size_t *size)
+static void recording_callback(void **start, size_t *size)
{
int tail = audio_tail ^ 1;
@@ -963,8 +963,6 @@ static void recording_callback(int status, void **start, size_t *size)
/* Always record full buffer, even if not required */
*start = audio_data[tail];
*size = BUFFER_SIZE * sizeof (int16_t);
-
- (void)status;
}
#endif /* SIMULATOR */
@@ -973,7 +971,8 @@ static void record_data(void)
{
#ifndef SIMULATOR
/* Always record full buffer, even if not required */
- rb->pcm_record_data(recording_callback, audio_data[audio_tail],
+ rb->pcm_record_data(recording_callback, NULL,
+ audio_data[audio_tail],
BUFFER_SIZE * sizeof (int16_t));
#endif
}
diff --git a/apps/plugins/rockboy/rbsound.c b/apps/plugins/rockboy/rbsound.c
index c0d0277..628879b 100644
--- a/apps/plugins/rockboy/rbsound.c
+++ b/apps/plugins/rockboy/rbsound.c
@@ -16,10 +16,10 @@ static unsigned short *buf=0, *hwbuf=0;
static bool newly_started;
-static void get_more(unsigned char** start, size_t* size)
+static void get_more(const void** start, size_t* size)
{
memcpy(hwbuf, &buf[pcm.len*doneplay], BUF_SIZE*sizeof(short));
- *start = (unsigned char*)(hwbuf);
+ *start = hwbuf;
*size = BUF_SIZE*sizeof(short);
doneplay=1;
}
@@ -76,7 +76,7 @@ int rockboy_pcm_submit(void)
if(newly_started)
{
- rb->pcm_play_data(&get_more,NULL,0);
+ rb->pcm_play_data(&get_more, NULL, NULL,0);
newly_started = false;
}
diff --git a/apps/plugins/test_sampr.c b/apps/plugins/test_sampr.c
index db8301b..fc2f695 100644
--- a/apps/plugins/test_sampr.c
+++ b/apps/plugins/test_sampr.c
@@ -90,13 +90,13 @@ static int16_t ICODE_ATTR fsin(uint32_t phase)
}
/* ISR handler to get next block of data */
-static void get_more(unsigned char **start, size_t *size)
+static void get_more(const void **start, size_t *size)
{
/* Free previous buffer */
output_head += output_step;
output_step = 0;
- *start = (unsigned char *)output_buf[output_head & OUTPUT_CHUNK_MASK];
+ *start = output_buf[output_head & OUTPUT_CHUNK_MASK];
*size = OUTPUT_CHUNK_SIZE;
/* Keep repeating previous if source runs low */
@@ -236,7 +236,7 @@ static void play_tone(bool volume_set)
IF_PRIO(, PRIORITY_PLAYBACK)
IF_COP(, CPU));
- rb->pcm_play_data(get_more, NULL, 0);
+ rb->pcm_play_data(get_more, NULL, NULL, 0);
#ifndef HAVE_VOLUME_IN_LIST
if (volume_set)
diff --git a/apps/plugins/zxbox/spsound.c b/apps/plugins/zxbox/spsound.c
index 8b3aa3d..9d3eefa 100644
--- a/apps/plugins/zxbox/spsound.c
+++ b/apps/plugins/zxbox/spsound.c
@@ -189,12 +189,11 @@ void autoclose_sound(void)
}
#endif
}
-static void get_more(unsigned char** start, size_t* size)
+static void get_more(const void** start, size_t* size)
{
doneplay = 1;
- rb->pcm_play_stop();
- (void)*start;
- (void)*size;
+ (void)start;
+ (void)size;
}
/* sp_sound_buf is Unsigned 8 bit, Rate 8000 Hz, Mono */
@@ -219,7 +218,7 @@ static void write_buf(void){
= my_buf[j+10] = my_buf[j+11] \
= (((byte)sp_sound_buf[i])<<8) >> settings.volume;
- rb->pcm_play_data(&get_more,(unsigned char*)(my_buf),TMNUM*4*3*2);
+ rb->pcm_play_data(&get_more,NULL,(unsigned char*)(my_buf),TMNUM*4*3*2);
#if 0
/* can use to save and later analyze what we produce */