diff --git a/static/app.js b/static/app.js index 16f77f4..2cbecba 100644 --- a/static/app.js +++ b/static/app.js @@ -41,6 +41,18 @@ import { } from './js/settings-io.js'; import { audio } from './js/audio-el.js'; import { S } from './js/player-state.js'; +// Side-effect import: the three JUCE shims are IIFEs that install themselves and +// publish through window.*. _resetJuceAudioShimChain is the one binding app.js needs. +import { _resetJuceAudioShimChain } from './js/juce-audio.js'; +import { + _clearResumeSession, + _hideResumePill, + _maybeShowResumePill, + _readResumeSession, + _snapshotResumeSession, + resumeLastSession, +} from './js/resume-session.js'; + import { _applyMastery, _applyMasteryAvailability, @@ -3635,970 +3647,8 @@ window.addEventListener('unhandledrejection', (e) => { (r && (r.name + ': ' + r.message)) || String(r)); }); -(function _installJuceEngineRoutingWatcher() { - const juceApi = window.feedBackDesktop?.audio; - if (!juceApi || typeof juceApi.isAudioRunning !== 'function') { - // Desktop bridge present but audio API incomplete — the whole - // exclusive reroute chain is dead and this line is the only witness. - // (Docker sphere has no bridge at all: stay silent, nothing to - // diagnose there and no debug flag to gate on.) - if (window.feedBackDesktop) { - console.log('[asio-diag] routing watcher NOT installed (audio api incomplete)'); - } - return; - } - - let _rerouteInFlight = false; - // URL that JUCE's loadBackingTrack *explicitly rejected* (ok === false — - // e.g. a codec it can't read). The poll below would otherwise retry the - // same doomed track every 350 ms; remember it and skip until the song - // changes. Only a hard JUCE reject is memoised here — transient failures - // (a network blip on /api/audio-local-path, an isAudioRunning() race - // during a device restart) are deliberately NOT memoised so they retry. - let _rerouteRejectedUrl = null; - // Exclusive-style output backends silence every other client on the - // endpoint — including our own