connect solution into app: VSTi live native (vst3 attach/vst2 bridge) with WASM autosample fallback, VST GUI window (Bug 1), native-first track instrument

This commit is contained in:
2026-08-11 20:35:53 +07:00
parent 916ce1334b
commit 255e8586bc
13 changed files with 538 additions and 98 deletions
+27
View File
@@ -0,0 +1,27 @@
// Standalone permissions (Bug 5): WebView2 auto-ALLOW mọi permission request
// (MIDI input, microphone, File System Access) — không hiện popup hỏi quyền.
// WebView2 mặc định DENY khi không có handler ICoreWebView2::add_PermissionRequested.
#![cfg(windows)]
use webview2_com::Microsoft::Web::WebView2::Win32::*;
use webview2_com::PermissionRequestedEventHandler;
pub fn install(window: &tauri::WebviewWindow) {
let _ = window.with_webview(|webview| {
unsafe {
if let Ok(core) = webview.controller().CoreWebView2() {
let handler = PermissionRequestedEventHandler::create(Box::new(
|_sender: Option<ICoreWebView2>,
args: Option<ICoreWebView2PermissionRequestedEventArgs>| {
if let Some(args) = args {
args.SetState(COREWEBVIEW2_PERMISSION_STATE_ALLOW)?;
}
Ok(())
},
));
let mut token = 0i64;
let _ = core.add_PermissionRequested(&handler, &mut token);
}
}
});
}