Skip to content

Commit cad10c2

Browse files
committed
Update audio track bus if needed
1 parent f7c1116 commit cad10c2

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

scripts/yySequence.js

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1601,8 +1601,27 @@ function yySequenceAudioTrack(_pStorage) {
16011601
}
16021602
}
16031603

1604-
yyError("Failed to push effect to bus: track is full");
1604+
yyError("Failed to push effect to bus. Audio tracks cannot hold more than "
1605+
+ AudioBus.NUM_EFFECT_SLOTS + " audio effect tracks");
16051606
};
1607+
1608+
this.UpdateBusLayout = function()
1609+
{
1610+
if (this.m_busStruct === null)
1611+
return;
1612+
1613+
const fxStructs = this.m_tracks.filter(_track => _track.m_effectStruct instanceof AudioEffectStruct)
1614+
.map(_track => _track.m_effectStruct);
1615+
1616+
for (let i = 0; i < AudioBus.NUM_EFFECT_SLOTS; ++i)
1617+
{
1618+
// Potentially getting undefined elements here is intentional
1619+
if (fxStructs[i] !== this.m_busStruct.effects[AudioBus.NUM_EFFECT_SLOTS - 1 - i])
1620+
{
1621+
this.m_busStruct.proxy[AudioBus.NUM_EFFECT_SLOTS - 1 - i] = fxStructs[i];
1622+
}
1623+
}
1624+
}
16061625
}
16071626

16081627
// #############################################################################################
@@ -5715,6 +5734,8 @@ yySequenceManager.prototype.HandleAudioTrackUpdate = function (_pEl, _pSeq, _pIn
57155734
g_SeqStack.pop();
57165735
}
57175736
}
5737+
5738+
_pTrack.UpdateBusLayout();
57185739
};
57195740

57205741

0 commit comments

Comments
 (0)