|
|
|
@ -29,6 +29,33 @@ |
|
|
|
|
// Written by Holger Wirtz
|
|
|
|
|
// 20191205 - initial version
|
|
|
|
|
|
|
|
|
|
static const audio_block_t zeroblock = { |
|
|
|
|
0, 0, 0, { |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 16 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 32 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 48 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 64 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 80 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 96 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
#if AUDIO_BLOCK_SAMPLES > 112 |
|
|
|
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
void AudioEffectAutoPan::update(void) |
|
|
|
|
{ |
|
|
|
|
audio_block_t *in; |
|
|
|
@ -37,11 +64,11 @@ void AudioEffectAutoPan::update(void) |
|
|
|
|
|
|
|
|
|
in = receiveReadOnly(0); |
|
|
|
|
if (!in) |
|
|
|
|
return; |
|
|
|
|
in = (audio_block_t*)&zeroblock; |
|
|
|
|
|
|
|
|
|
mod = receiveReadOnly(1); |
|
|
|
|
if (!mod) |
|
|
|
|
return; |
|
|
|
|
mod = (audio_block_t*)&zeroblock; |
|
|
|
|
|
|
|
|
|
out[0] = allocate(); |
|
|
|
|
out[1] = allocate(); |
|
|
|
@ -66,10 +93,15 @@ void AudioEffectAutoPan::update(void) |
|
|
|
|
{ |
|
|
|
|
release(in); |
|
|
|
|
} |
|
|
|
|
if (mod) |
|
|
|
|
if (in != (audio_block_t*)&zeroblock) |
|
|
|
|
{ |
|
|
|
|
release(in); |
|
|
|
|
} |
|
|
|
|
if (mod != (audio_block_t*)&zeroblock) |
|
|
|
|
{ |
|
|
|
|
release(mod); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < 2; i++) |
|
|
|
|
{ |
|
|
|
|
if (out[i]) |
|
|
|
|