V45.15: fix ARM piano roll khong am - gop subTab isArmed (PIANO_ROLL) vao 2 path gui note (midi_push bridge branch + vkbNoteOn) - preview note toi track dang edit du track main khong ARM v=202608311122

This commit is contained in:
2026-08-31 11:23:34 +07:00
parent 752db690b3
commit 39f00c3c0b
3 changed files with 31 additions and 7 deletions
+20 -2
View File
@@ -18614,8 +18614,17 @@ const App = () => {
// D1: bridge active -> 1 cổng router (per-track channel alloc) →
// Rust SHM → C++ bridge; giữ SonicSF fallback ở nhánh else.
var bTracks = activeTracksRef.current || [];
// ARM piano roll (sub-tab isArmed, cuc bo) cung tinh nhu ARM
// track - preview note tu piano roll tab phai toi track dang
// edit du track main KHONG ARM (ARM piano roll khong truyen).
var bPrArmed = {};
try {
(subTabsRef.current || []).forEach(function (s) {
if (s.type === 'PIANO_ROLL' && s.isArmed && s.trackId) bPrArmed[s.trackId] = true;
});
} catch (e) {}
bTracks.forEach(function (bt) {
if (!bt.isArmed) return;
if (!bt.isArmed && !bPrArmed[bt.id]) return;
if (window.triggerMidiVuActivity) {
window.triggerMidiVuActivity(bt.id, scaledVel);
}
@@ -23814,7 +23823,16 @@ const App = () => {
const vkbNoteOn = (pitch, vel) => {
try { if (window.__ensureMasteringRouting) window.__ensureMasteringRouting(); } catch (er) {}
const allTracks = activeTracksRef.current || [];
const armed = allTracks.filter(function (t) { return t.isArmed; });
// ARM piano roll (sub-tab isArmed, cuc bo) cung tinh nhu ARM track:
// preview note tu piano roll tab phai toi track dang edit du track main
// KHONG ARM (ARM piano roll khong truyen vao MAIN/SECTION).
const prArmedIds = {};
try {
(subTabsRef.current || []).forEach(function (s) {
if (s.type === 'PIANO_ROLL' && s.isArmed && s.trackId) prArmedIds[s.trackId] = true;
});
} catch (e) {}
const armed = allTracks.filter(function (t) { return t.isArmed || prArmedIds[t.id]; });
const targets = armed.length ? armed : allTracks;
if (!armed.length && !window.__vkbNoArmToast) {
window.__vkbNoArmToast = true;