fix: restore isPlaying after stopAllPlayback on instrument change
This commit is contained in:
@@ -6447,6 +6447,7 @@ const App = () => {
|
||||
}));
|
||||
const playingSub = subTabs.find(s => s.trackId === trackId && s.type === 'PIANO_ROLL' && s.isPlaying);
|
||||
if (playingSub) {
|
||||
const pid = playingSub.id;
|
||||
stopAllPlayback();
|
||||
setTimeout(() => {
|
||||
const context = getAudioContext();
|
||||
@@ -6456,6 +6457,10 @@ const App = () => {
|
||||
startBufferOffsetRef.current = offset * (playingSub.speed || 1.0);
|
||||
schedulePianoRollMidi(playingSub, offset);
|
||||
startSubTabPlayback(playingSub, offset);
|
||||
setSubTabs(prev => prev.map(s => s.id === pid ? { ...s, isPlaying: true } : s));
|
||||
if (subTabsRef.current) {
|
||||
subTabsRef.current = subTabsRef.current.map(s => s.id === pid ? { ...s, isPlaying: true } : s);
|
||||
}
|
||||
animationFrameIdRef.current = requestAnimationFrame(updatePlayhead);
|
||||
}, 50);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user