@@ -1607,11 +1607,15 @@ function yySequenceAudioTrack(_pStorage) {
1607
1607
1608
1608
this . UpdateBusLayout = function ( )
1609
1609
{
1610
- if ( this . m_busStruct === null )
1611
- return ;
1612
-
1613
1610
const fxStructs = this . m_tracks . filter ( _track => _track . m_effectStruct instanceof AudioEffectStruct )
1614
1611
. map ( _track => _track . m_effectStruct ) ;
1612
+
1613
+ if ( fxStructs . length == 0 && this . m_busStruct === null )
1614
+ {
1615
+ return ;
1616
+ }
1617
+
1618
+ this . InstantiateBus ( ) ;
1615
1619
1616
1620
for ( let i = 0 ; i < AudioBus . NUM_EFFECT_SLOTS ; ++ i )
1617
1621
{
@@ -1621,6 +1625,12 @@ function yySequenceAudioTrack(_pStorage) {
1621
1625
this . m_busStruct . proxy [ AudioBus . NUM_EFFECT_SLOTS - 1 - i ] = fxStructs [ i ] ;
1622
1626
}
1623
1627
}
1628
+
1629
+ if ( fxStructs . length > AudioBus . NUM_EFFECT_SLOTS )
1630
+ {
1631
+ yyError ( "Failed to assign effect to bus. Audio tracks cannot hold more than "
1632
+ + AudioBus . NUM_EFFECT_SLOTS + " audio effect tracks" ) ;
1633
+ }
1624
1634
}
1625
1635
}
1626
1636
@@ -5721,6 +5731,14 @@ yySequenceManager.prototype.HandleAudioTrackUpdate = function (_pEl, _pSeq, _pIn
5721
5731
//audio_emitter_falloff(pInfo.emitterindex, )
5722
5732
5723
5733
audio_emitter_position ( pAudioInfo . emitterindex , emitterPosX , emitterPosY , 0.0 ) ;
5734
+
5735
+ _pTrack . UpdateBusLayout ( ) ;
5736
+
5737
+ if ( _pTrack . m_busStruct != null
5738
+ && audio_emitter_get_bus ( pAudioInfo . emitterindex ) !== _pTrack . m_busStruct )
5739
+ {
5740
+ audio_emitter_bus ( pAudioInfo . emitterindex , _pTrack . m_busStruct ) ;
5741
+ }
5724
5742
}
5725
5743
5726
5744
_srcVars . emitterIndex = pAudioInfo . emitterindex ;
@@ -5734,8 +5752,6 @@ yySequenceManager.prototype.HandleAudioTrackUpdate = function (_pEl, _pSeq, _pIn
5734
5752
g_SeqStack . pop ( ) ;
5735
5753
}
5736
5754
}
5737
-
5738
- _pTrack . UpdateBusLayout ( ) ;
5739
5755
} ;
5740
5756
5741
5757
0 commit comments