ncmixer

ncurses audio mixer for DJ'ing
git clone git://git.2f30.org/ncmixer
Log | Files | Refs | README | LICENSE

commit 88796cc688f1fa869161f1b533a2e25daa25253a
parent 4467d76f3e607b64e5bcba38c80acfbe143f1df4
Author: sin <sin@2f30.org>
Date:   Sat, 11 Jun 2016 10:54:46 +0100

Attenuate inputs once

Diffstat:
Mncmixer.c | 17+++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/ncmixer.c b/ncmixer.c @@ -479,6 +479,15 @@ loop(void) } } + /* attenuate inputs based on cross-fader position */ + if (xfpos <= 0) { + attenuate(&inputs[0], 1.0f); + attenuate(&inputs[1], 1.0f - fabsf(xfpos)); + } else { + attenuate(&inputs[0], 1.0f - fabsf(xfpos)); + attenuate(&inputs[1], 1.0f); + } + /* play dat shit! */ for (i = 0; i < LEN(outputs); i++) { out = &outputs[i]; @@ -488,14 +497,6 @@ loop(void) if (out->sio_hdl == NULL) continue; } - /* attenuate inputs based on cross-fader position */ - if (xfpos <= 0) { - attenuate(&inputs[0], 1.0f); - attenuate(&inputs[1], 1.0f - fabsf(xfpos)); - } else { - attenuate(&inputs[0], 1.0f - fabsf(xfpos)); - attenuate(&inputs[1], 1.0f); - } memset(out->buf, 0, sizeof(out->buf)); out->mix(out, &inputs[0], &inputs[1]); ret = audio_play(out->sio_hdl, out->buf,