BWF Analyser: browser page and macOS app

Reads and edits BWF metadata for production sound. One source tree builds a
single self-contained page and a native Tauri app with a Rust audio engine and
WAV writer. Around 370 checks across seven test suites.

First commit of the existing state, so that from here every change can be
seen and undone.
This commit is contained in:
2026-08-17 22:50:39 +08:00
commit 2d0b7fe8b5
50 changed files with 42383 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
/**
* Standalone shim.
*
* The only thing this adds over the original plugin: a clearer message when
* the browser refuses the File System Access API. Opening this page straight
* off disk (file://) gives it an opaque origin in Chrome, and the folder
* picker used for *writing* metadata rejects opaque origins with a
* SecurityError. Reading, playback, CSV and PDF are unaffected — only the
* "Edit Metadata in a Folder…" path needs the page served over http(s),
* which locally means something like `python3 -m http.server` in this file's
* folder and then visiting http://localhost:8000/.
*
* The app's own catch block runs before this one resolves its message, so
* the warning is written on the next tick to make sure it lands last.
*/
( function () {
"use strict";
if ( typeof window.showDirectoryPicker !== "function" ) {
return;
}
var original = window.showDirectoryPicker.bind( window );
window.showDirectoryPicker = function ( options ) {
return original( options ).catch( function ( err ) {
if ( err && ( err.name === "SecurityError" || err.name === "NotAllowedError" ) &&
window.location.protocol === "file:" ) {
window.setTimeout( function () {
var warning = document.querySelector( "[data-bwfa-fs-warning]" );
if ( warning ) {
warning.style.display = "block";
}
var status = document.querySelector( "[data-bwfa-status]" );
if ( status ) {
status.textContent = "";
}
}, 0 );
}
throw err;
} );
};
}() );