5ad2c681e7
Drop Carla integration across frontend and backend: - plugins.py: remove /carla-midi, /carla-status, /carla-stop, /open-in-carla, /carla-play-notes endpoints and Carla process management - runtime.py: remove find_carla / _carla_* helpers, detect and capabilities - app.jsx: remove Carla bridge UI, SonicCarlaMidi routing, shouldRouteCarla guards, VST row Carla button and preset fallback - system.py: remove /carla-path - Keep audio path unchanged (tracks -> masterBus -> output -> analyser), directOut only for offline render Build frontend, tests pass (124 passed).
58 lines
2.4 KiB
HTML
58 lines
2.4 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="vi">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>SonicForge DAW</title>
|
||
<style>
|
||
body { font-family: system-ui, sans-serif; background: #12141a; color: #e8eaf0;
|
||
display: flex; align-items: center; justify-content: center; height: 100vh; margin: 0; }
|
||
#msg { text-align: center; max-width: 480px; line-height: 1.6; }
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div id="msg">Đang khởi động SonicForge Engine…</div>
|
||
<script>
|
||
// Frontend host (Tauri asset page). KHÔNG location.href redirect: chuyển
|
||
// sang http://127.0.0.1:8000 sẽ rời Tauri context -> mất window.__TAURI__
|
||
// -> NativeBridgeService vô hiệu (bridge-audio/load_instrument không dùng
|
||
// được; MIDI rơi về fallback WASM/native). Thay vào đó: quét port engine
|
||
// (8000-8010), nạp toàn bộ UI engine qua document.write trên CÙNG document
|
||
// (origin tauri:// giữ nguyên -> __TAURI__ sống), base href + API_BASE_URL
|
||
// trỏ engine HTTP (CORS * đã bật).
|
||
(async function () {
|
||
var base = null;
|
||
for (var p = 8000; p <= 8010 && !base; p++) {
|
||
try {
|
||
var r = await fetch('http://127.0.0.1:' + p + '/health', { cache: 'no-store' });
|
||
if (r.ok) base = 'http://127.0.0.1:' + p + '/';
|
||
} catch (e) { /* port chưa mở */ }
|
||
}
|
||
if (!base) {
|
||
document.getElementById('msg').textContent =
|
||
'Không tìm thấy SonicForge Engine (port 8000–8010). Hãy đóng và chạy lại ứng dụng. ' +
|
||
'Nếu lặp lại, xem log: %APPDATA%\\SonicForgeDAW\\logs\\engine.log';
|
||
return;
|
||
}
|
||
var html;
|
||
try {
|
||
var res = await fetch(base, { cache: 'no-store' });
|
||
html = await res.text();
|
||
} catch (e) {
|
||
document.getElementById('msg').textContent = 'Engine không phản hồi: ' + e;
|
||
return;
|
||
}
|
||
// base href để /static, /api resolve về engine; API_BASE_URL override
|
||
// location.origin (origin thật là tauri://). KHÔNG trailing slash trong
|
||
// API_BASE_URL: api.js nối `${API_BASE_URL}/api/...` -> double slash
|
||
// `//api/...` -> FastAPI 404 "Not Found" (login báo not found).
|
||
html = html.replace('<head>',
|
||
'<head>\n<base href="' + base + '">\n' +
|
||
'<script>window.API_BASE_URL = "' + base.replace(/\/$/, '') + '";<\/script>');
|
||
document.open();
|
||
document.write(html);
|
||
document.close();
|
||
})();
|
||
</script>
|
||
</body>
|
||
</html>
|