From 60d1eee10799f6695b366df0d9098f75af6c278a Mon Sep 17 00:00:00 2001 From: locphamtran Date: Tue, 25 Aug 2026 07:36:20 +0700 Subject: [PATCH] =?UTF-8?q?debug(midi):=20diag=20PUSH=5FROUTE/PUSH=5FENTER?= =?UTF-8?q?=20=E2=80=94=20pin=20pushEvent->dispatchMidiEvent=20break=20poi?= =?UTF-8?q?nt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/static/js/services/nativeBridgeService.js | 2 ++ app/static/js/services/unifiedMidiRouter.js | 3 +++ app/templates/index.html | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/static/js/services/nativeBridgeService.js b/app/static/js/services/nativeBridgeService.js index 7b62ca9..b7189b6 100644 --- a/app/static/js/services/nativeBridgeService.js +++ b/app/static/js/services/nativeBridgeService.js @@ -124,6 +124,8 @@ * data2/data3 (A12): CC value / program / PB LSB|MSB. */ dispatchMidiEvent: function (cmd, channel, pitch, velocity, sampleOffset, data2, data3, live) { + _pushEnter = (_pushEnter || 0) + 1; + if (_pushEnter % 100 === 0 && window.__sfDiag) window.__sfDiag('PUSH_ENTER cmd=' + cmd + ' ch=' + channel + ' tauri=' + !!this._tauri()); if (!this._tauri()) return false; var safeVelocity = Math.floor(Math.min(1.0, Math.max(0.0, velocity)) * 127); var byteCmd; diff --git a/app/static/js/services/unifiedMidiRouter.js b/app/static/js/services/unifiedMidiRouter.js index 46342c1..102beb5 100644 --- a/app/static/js/services/unifiedMidiRouter.js +++ b/app/static/js/services/unifiedMidiRouter.js @@ -56,10 +56,13 @@ var sampleOffset = opts.sampleOffset || 0; if (typeof ch === 'string') ch = this.allocateChannel(ch, opts.percussion); if (ch === undefined || ch === null) ch = 0; + _pushEvt = (_pushEvt || 0) + 1; + if (_pushEvt % 100 === 0 && window.__sfDiag) window.__sfDiag('PUSH_ROUTE cmd=' + cmd + ' ch=' + ch + ' brAct=' + this.isBridgeActive() + ' nbs=' + !!window.NativeBridgeService + ' tauri=' + !!(window.__TAURI__)); if (this.isBridgeActive()) { window.NativeBridgeService.dispatchMidiEvent(cmd, ch, pitch, vel, sampleOffset, opts.data2, opts.data3, opts.live); return; } + if (_pushEvt % 100 === 0 && window.__sfDiag) window.__sfDiag('PUSH_FALLBACK cmd=' + cmd + ' ch=' + ch); if (this.onFallback) this.onFallback(cmd, ch, pitch, vel); }, diff --git a/app/templates/index.html b/app/templates/index.html index 8516a06..6d23fbc 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -39,9 +39,9 @@ - + - +