cwFlowProc.cpp : Fix audio_mix and audio_split _value() to ignore var updates when chIdx == kAnyChIdx.

This commit is contained in:
kevin 2024-06-09 16:19:01 -04:00
parent e469be6a01
commit 53691fa480

View File

@ -1415,7 +1415,8 @@ namespace cw
break;
case kInGainPId:
assert( var->chIdx < p->iChN );
// skip kAnyChIdx because individual channels exist will be sent
if(var->chIdx != kAnyChIdx )
rc = var_get(var,p->igainV[ var->chIdx ]);
break;
@ -1423,7 +1424,8 @@ namespace cw
default:
if( kOutGainPId <= var->vid && var->vid < kOutGainPId + p->oVarN )
// skip kAnyChIdx because individual channels exist and will be sent
if( kOutGainPId <= var->vid && var->vid < kOutGainPId + p->oVarN && var->chIdx != kAnyChIdx )
{
unsigned oVarIdx = var->label_sfx_id - kBaseSfxId;
assert( oVarIdx < p->oVarN && var->chIdx < p->oVarA[oVarIdx].audioChN );
@ -1807,7 +1809,10 @@ namespace cw
break;
case kOutGainPId:
assert( var->chIdx < p->oag.audioChN);
assert( var->chIdx == kAnyChIdx || var->chIdx < p->oag.audioChN);
// (we skip kAnyChIdx because individual channels will follow)
if( var->chIdx != kAnyChIdx )
var_get(var,p->oag.gainV[var->chIdx] ); // ... update the associated gainV[] value
break;
@ -1816,14 +1821,17 @@ namespace cw
// if this is an in-gain value
if( p->baseInGainPId <= var->vid && var->vid < p->baseInGainPId + p->inAudioVarCnt )
{
// determine which in-gain variable this var is associated with
// determine which in-gain variable this var is associated with var->vid
for(unsigned i=0; i<p->inAudioVarCnt; ++i)
if( p->iagV[i].gVId == var->vid )
{
// ... update the associated gainV[] value
assert( var->chIdx < p->iagV[i].audioChN);
assert( var->chIdx == kAnyChIdx || var->chIdx < p->iagV[i].audioChN);
// ... and update the associated gainV[] value
// (we skip kAnyChIdx because individual channels will follow)
if( var->chIdx != kAnyChIdx )
var_get(var,p->iagV[i].gainV[var->chIdx]);
goto errLabel;
break;
}
}