|
|
@ -29,6 +29,33 @@ |
|
|
|
// Written by Holger Wirtz
|
|
|
|
// Written by Holger Wirtz
|
|
|
|
// 20191205 - initial version
|
|
|
|
// 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) |
|
|
|
void AudioEffectAutoPan::update(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
audio_block_t *in; |
|
|
|
audio_block_t *in; |
|
|
@ -37,12 +64,12 @@ void AudioEffectAutoPan::update(void) |
|
|
|
|
|
|
|
|
|
|
|
in = receiveReadOnly(0); |
|
|
|
in = receiveReadOnly(0); |
|
|
|
if (!in) |
|
|
|
if (!in) |
|
|
|
return; |
|
|
|
in = (audio_block_t*)&zeroblock; |
|
|
|
|
|
|
|
|
|
|
|
mod = receiveReadOnly(1); |
|
|
|
mod = receiveReadOnly(1); |
|
|
|
if (!mod) |
|
|
|
if (!mod) |
|
|
|
return; |
|
|
|
mod = (audio_block_t*)&zeroblock; |
|
|
|
|
|
|
|
|
|
|
|
out[0] = allocate(); |
|
|
|
out[0] = allocate(); |
|
|
|
out[1] = allocate(); |
|
|
|
out[1] = allocate(); |
|
|
|
|
|
|
|
|
|
|
@ -66,10 +93,15 @@ void AudioEffectAutoPan::update(void) |
|
|
|
{ |
|
|
|
{ |
|
|
|
release(in); |
|
|
|
release(in); |
|
|
|
} |
|
|
|
} |
|
|
|
if (mod) |
|
|
|
if (in != (audio_block_t*)&zeroblock) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
release(in); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (mod != (audio_block_t*)&zeroblock) |
|
|
|
{ |
|
|
|
{ |
|
|
|
release(mod); |
|
|
|
release(mod); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
for (uint8_t i = 0; i < 2; i++) |
|
|
|
for (uint8_t i = 0; i < 2; i++) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (out[i]) |
|
|
|
if (out[i]) |
|
|
|