FIX: khi ở MAIN SESSION đang play mà mở Piano roll tab thì âm thanh bị tắt

This commit is contained in:
2026-08-04 22:12:50 +07:00
parent 856a8183b6
commit cfc114b9d7
4 changed files with 17 additions and 5 deletions
+5 -2
View File
@@ -15979,8 +15979,11 @@ const App = () => {
const midiItem = (track.midiItems || []).find(m => m.id === midiItemId);
if (!midiItem) return;
// Clean stop any ongoing playback to avoid stuck playheads and audio routes
stopAllPlayback();
// Clean stop playback ONLY khi KHÔNG đang play main — nếu main đang play,
// mở PIANO ROLL tab KHÔNG được dừng âm (user: dblclick mở tab lúc main
// play → âm main phải tiếp tục). Nhánh play sub-tab tự stopAllPlayback
// trước khi play nên không xung đột route.
if (!isPlaying) stopAllPlayback();
const ctx = getAudioContext();
const silentBuffer = ctx.createBuffer(1, 128, ctx.sampleRate);