fix(midi): prefix _pushEnter/_pushSent/_pushOk/_pushFail with this. — ReferenceError blocked dispatchMidiEvent (v=202608250116)
This commit is contained in:
@@ -124,8 +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());
|
||||
this._pushEnter = (this._pushEnter || 0) + 1;
|
||||
if (this._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;
|
||||
@@ -135,8 +135,8 @@
|
||||
case 'PITCH_BEND': byteCmd = 0xE; break;
|
||||
default: byteCmd = cmd === 'NOTE_ON' ? 0x9 : 0x8; break;
|
||||
}
|
||||
_pushSent = (_pushSent || 0) + 1;
|
||||
if (_pushSent % 100 === 0 && window.__sfDiag) window.__sfDiag('PUSH_SENT ' + _pushSent);
|
||||
this._pushSent = (this._pushSent || 0) + 1;
|
||||
if (this.pushSent % 100 === 0 && window.__sfDiag) window.__sfDiag('PUSH_SENT ' + _pushSent);
|
||||
// DIAG: Promise.race 800ms — invoke gửi đi nhưng không settle -> timeout
|
||||
// (phan biet main-thread block vs Rust hang).
|
||||
Promise.race([
|
||||
@@ -152,10 +152,10 @@
|
||||
}),
|
||||
new Promise(function (_, rej) { setTimeout(function () { rej(new Error('timeout-800ms')); }, 800); })
|
||||
]).then(function () {
|
||||
_pushOk = (_pushOk || 0) + 1;
|
||||
this._pushOk = (this._pushOk || 0) + 1;
|
||||
if ((_pushOk + (_pushFail || 0)) % 100 === 0 && window.__sfDiag) window.__sfDiag('PUSH_MIDI ok=' + _pushOk + ' fail=' + (_pushFail || 0));
|
||||
}).catch(function (e) {
|
||||
_pushFail = (_pushFail || 0) + 1;
|
||||
this._pushFail = (this._pushFail || 0) + 1;
|
||||
if (_lastPushFail !== String(e)) { _lastPushFail = String(e); if (window.__sfDiag) window.__sfDiag('PUSH_MIDI_FAIL ' + e); }
|
||||
console.warn('[BridgeService] push_midi_event:', e);
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<script src="/static/js/services/storage.js?v=202608038200"></script>
|
||||
<script src="/static/js/services/soundfontStorage.js?v=202607271016"></script>
|
||||
<script src="/static/js/services/soundfontPlayer.js?v=202608101800"></script>
|
||||
<script src="/static/js/services/nativeBridgeService.js?v=202608250054"></script>
|
||||
<script src="/static/js/services/nativeBridgeService.js?v=202608250116"></script>
|
||||
<script src="/static/js/services/bridgeAudioNode.js?v=202608250107"></script>
|
||||
<script src="/static/js/services/unifiedMidiRouter.js?v=202608250054"></script>
|
||||
<script src="/static/js/services/audioRoutingEngine.js?v=202608250107"></script>
|
||||
|
||||
Reference in New Issue
Block a user