T3: Autosample UX - fail reason + toast + pre-warm feedback

vstiAutosample: fail map thanh object {ts, reason} (cooldown check
object-aware), recordFail o API-missing/response loi/catch, export
failReasonFor. soundfontPlayer: toast ly do khi ensure null (throttle
10s) roi fallback oscillator. app.jsx: pre-warm VSTi hien thi toast khi
autosample fail.
This commit is contained in:
2026-08-11 15:36:10 +07:00
parent 6da0c5b68d
commit fa2f96dbe3
4 changed files with 42 additions and 8 deletions
+8 -1
View File
@@ -609,7 +609,14 @@
if (!sfId) {
// Không autosample được (404/501) → fallback oscillator để note
// KHÔNG câm; cooldown trong ensure chặn re-request.
try { self._playNoteFallback(note, velocity, durationMs, startTime, program, null, channel, synthEngine); } catch (e) {}
try {
var _reason = window.SonicVstiAutosample.failReasonFor ? window.SonicVstiAutosample.failReasonFor(synthEngine) : null;
if (_reason && window.showToast && (!self._vstiToastAt || Date.now() - self._vstiToastAt > 10000)) {
self._vstiToastAt = Date.now();
window.showToast('Autosample VSTi that bai: ' + _reason + ' - dung am default', 'warning');
}
self._playNoteFallback(note, velocity, durationMs, startTime, program, null, channel, synthEngine);
} catch (e) {}
return;
}
synthEngine.autosampled_sf_id = sfId;