mirror of
https://github.com/storytold/soundcraft.git
synced 2026-11-29 09:13:06 -06:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
778614bc86 | ||
|
|
7af5021d02 |
@@ -81,7 +81,6 @@ Layers, checked by `cargo xtask layers`; nothing below L6 depends on egui, efram
|
||||
- Audio formats, codecs and waveform peaks come from `craft-audio` in `storytold/craft-libs`; `soundcraft_model::FileFormat` maps them onto the session model.
|
||||
- Commands live in `crates/engine/src/cmd/*` (id, label, menu path, shortcut, params doc, `enabled`, `run`), each module with its own `specs()` registered in `crates/engine/src/cmd.rs`; UI-only commands in `crates/ui-egui/src/menus.rs` (`UI_COMMANDS`). Menus, shortcuts, CLI, control channel and MCP dispatch the same ids. Panels act through `engine.execute(id, params)`. Programmatic calls open no dialogs; `ui.menu.invoke` does.
|
||||
- Parity: `crates/engine/catalog/menus.txt` lists the reference menu leaves; `cargo xtask parity` writes `docs/parity-checklist.md`; a test enforces a floor that only rises.
|
||||
- Headless column ([RFC-0052](https://github.com/storytold/craft-contrib/blob/main/rfcs/0052-headless-reach.md)): the parity report marks a leaf `headless: yes` only when the engine registry implements it (what `soundcraft-cli` and the MCP server load); the UI layer's `parity_with` extras never count. Other leaves take their `no`/`partial` value and `reach:` (`window`, `os`, `engine-gap`) from `HEADLESS` in `crates/engine/src/catalog.rs`, or read `unknown`. When a command lands, drop or narrow its mark; `headless_marks_are_current` fails on one that only hides a `yes`.
|
||||
- Progress docs: `ROADMAP.md`, `docs/gaps.md`, `docs/roadmap.md`, `docs/target-app-parity.md` and the per-area `docs/*-parity.md`. Releases: `docs/releasing.md` (push to `release`; `cargo xtask version [set X.Y.Z]`). Control protocol: `docs/control-protocol.md`.
|
||||
|
||||
### Checks
|
||||
|
||||
@@ -88,7 +88,7 @@ where things are.
|
||||
</tr>
|
||||
<tr>
|
||||
<td><b>Automation and markers.</b> Breakpoint automation for volume, pan, mute, sends and every plugin parameter, written live in Write, Touch and Latch, plus memory locations and a big counter.</td>
|
||||
<td><b>Everywhere.</b> Signed builds for macOS (universal), Windows (x64 and ARM64), Linux (AppImage, deb, rpm, Flatpak, Arch), FreeBSD, and a WebAssembly build that runs in the browser.</td>
|
||||
<td><b>Everywhere.</b> Signed builds for macOS (universal), Windows (x64, x86, Arm), Linux (AppImage, deb, rpm, Flatpak), FreeBSD, and a WebAssembly build that runs in the browser.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="50%"><img alt="The Video window showing a colour-bar test movie with a timecode burn-in, above a Video track with thumbnails in the Edit window" src="docs/images/video.png"></td>
|
||||
@@ -302,9 +302,7 @@ very welcome, in the issues or on Discord.
|
||||
|---|---|---|
|
||||
| x64 (64-bit Intel/AMD) | `soundcraft-<ver>-windows-x64.msi` | `soundcraft-<ver>-windows-x64-portable.zip` |
|
||||
| arm64 (Snapdragon and other ARM PCs) | `soundcraft-<ver>-windows-arm64.msi` | `soundcraft-<ver>-windows-arm64-portable.zip` |
|
||||
|
||||
For 32-bit Windows, [SoundCraft v0.18.0](https://github.com/storytold/soundcraft/releases/tag/v0.18.0)
|
||||
was the last release with both an x86 MSI and portable ZIP.
|
||||
| x86 (32-bit) | `soundcraft-<ver>-windows-x86.msi` | `soundcraft-<ver>-windows-x86-portable.zip` |
|
||||
|
||||
Installers and executables are code-signed.
|
||||
|
||||
@@ -342,19 +340,15 @@ DirectX 12 shaders are compiled with FXC, which is part of Windows, so no `dxcom
|
||||
| Flatpak | `soundcraft-<ver>-linux-x86_64.flatpak` | `soundcraft-<ver>-linux-aarch64.flatpak` | Sandboxed; `flatpak install --user <file>` |
|
||||
| Debian/Ubuntu | `soundcraft-<ver>-linux-x86_64.deb` | `soundcraft-<ver>-linux-aarch64.deb` | |
|
||||
| Fedora/RHEL/openSUSE | `soundcraft-<ver>-linux-x86_64.rpm` | `soundcraft-<ver>-linux-aarch64.rpm` | |
|
||||
| Arch Linux | `soundcraft-<ver>-linux-x86_64.pkg.tar.zst` | `soundcraft-<ver>-linux-aarch64.pkg.tar.zst` | |
|
||||
| Tarball | `soundcraft-<ver>-linux-x86_64.tar.gz` | `soundcraft-<ver>-linux-aarch64.tar.gz` | Unpack anywhere |
|
||||
|
||||
RISC-V (riscv64) packages are `soundcraft-<ver>-linux-riscv64.deb`,
|
||||
`soundcraft-<ver>-linux-riscv64.rpm`, and `soundcraft-<ver>-linux-riscv64.tar.gz`
|
||||
(glibc 2.39+, e.g. Ubuntu 24.04).
|
||||
RISC-V (riscv64): `soundcraft-<ver>-linux-riscv64.tar.gz`, a tarball only (glibc 2.39+, e.g. Ubuntu 24.04).
|
||||
|
||||
### FreeBSD
|
||||
|
||||
| Build | File |
|
||||
|---|---|
|
||||
| x86_64 | `soundcraft-<ver>-freebsd-x86_64.tar.gz` |
|
||||
| aarch64 (ARM64) | `soundcraft-<ver>-freebsd-aarch64.tar.gz` |
|
||||
|
||||
### Web (WebAssembly)
|
||||
|
||||
|
||||
@@ -22,8 +22,6 @@ fn is_control_method(method: &str) -> bool {
|
||||
| "ui.move"
|
||||
| "ui.click"
|
||||
| "ui.drag"
|
||||
| "ui.scroll"
|
||||
| "ui.zoom"
|
||||
| "ui.key"
|
||||
| "ui.text"
|
||||
| "ui.screenshot"
|
||||
@@ -70,11 +68,5 @@ mod tests {
|
||||
for method in ["session.inspect", "engine.commands", "engine.parity", "ui.screenshot", "app.quit"] {
|
||||
assert_eq!(app_request(method, json!({})).0, method);
|
||||
}
|
||||
for (method, params) in [
|
||||
("ui.scroll", json!({"x": 120, "y": 80, "dx": 5, "dy": -15, "unit": "line"})),
|
||||
("ui.zoom", json!({"x": 120, "y": 80, "factor": 1.5, "steps": 4})),
|
||||
] {
|
||||
assert_eq!(app_request(method, params.clone()), (method.to_string(), params));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ fn write_help() -> &'static str {
|
||||
|
||||
/// soundcraft-cli: SoundCraft without a window
|
||||
#[derive(Parser)]
|
||||
#[command(name = "soundcraft-cli", version = long_version(), propagate_version = true, arg_required_else_help = true)]
|
||||
#[command(name = "soundcraft-cli", version = long_version(), arg_required_else_help = true)]
|
||||
pub(crate) struct Cli {
|
||||
#[command(subcommand)]
|
||||
pub(crate) command: Command,
|
||||
|
||||
@@ -40,12 +40,9 @@ pub(crate) fn parity(args: &ParityArgs, out: &mut dyn Write) -> Result<(), CliEr
|
||||
for m in p["per_menu"].as_array().cloned().unwrap_or_default() {
|
||||
md.push_str(&format!("| {} | {} | {} |\n", m["menu"].as_str().unwrap_or(""), m["implemented"], m["total"]));
|
||||
}
|
||||
md.push_str(&format!("\n{}\n", soundcraft_engine::catalog::headless_summary_line(&p)));
|
||||
md.push_str("A leaf the engine implements is `headless: yes`: `soundcraft-cli` and the MCP server load that registry. The rest carry the hand mark from `HEADLESS` in `crates/engine/src/catalog.rs`, or `unknown`.\n");
|
||||
md.push_str("\n## Not yet implemented\n\n");
|
||||
for m in p["headless_missing"].as_array().cloned().unwrap_or_default() {
|
||||
let reach = m["reach"].as_str().map(|r| format!(", reach: {r} ({})", m["why"].as_str().unwrap_or(""))).unwrap_or_default();
|
||||
md.push_str(&format!("- {}: headless: {}{reach}\n", m["path"].as_str().unwrap_or(""), m["headless"].as_str().unwrap_or("")));
|
||||
for m in p["missing"].as_array().cloned().unwrap_or_default() {
|
||||
md.push_str(&format!("- {}\n", m.as_str().unwrap_or("")));
|
||||
}
|
||||
if let Some(path) = &args.write {
|
||||
std::fs::write(path, &md).map_err(|source| CliError::File { path: path.clone(), source })?;
|
||||
|
||||
@@ -73,11 +73,10 @@ fn at_rate(pos: u64, from: u32, to: u32) -> u64 {
|
||||
fn write_replacing(target: &std::path::Path, bytes: &[u8]) -> std::io::Result<()> {
|
||||
let name = target.file_name().map_or_else(|| "output".into(), |n| n.to_string_lossy().into_owned());
|
||||
let tmp = target.with_file_name(format!(".{name}.{}.part", std::process::id()));
|
||||
let mut file = std::fs::OpenOptions::new().write(true).create_new(true).open(&tmp)?;
|
||||
let written = (|| {
|
||||
let mut file = std::fs::OpenOptions::new().write(true).create_new(true).open(&tmp)?;
|
||||
file.write_all(bytes)?;
|
||||
file.sync_all()?;
|
||||
drop(file);
|
||||
std::fs::rename(&tmp, target)
|
||||
})();
|
||||
if written.is_err() {
|
||||
|
||||
@@ -73,7 +73,6 @@ pub(crate) fn run_cmds(args: &RunArgs, out: &mut dyn Write, err: &mut dyn Write)
|
||||
pub(crate) fn script(args: &ScriptArgs, out: &mut dyn Write, err: &mut dyn Write) -> Result<(), CliError> {
|
||||
let path = &args.file;
|
||||
let text = std::fs::read_to_string(path).map_err(|source| CliError::File { path: path.clone(), source })?;
|
||||
let text = text.strip_prefix('\u{feff}').unwrap_or(&text);
|
||||
let mut e = load_engine(&args.engine, err)?;
|
||||
let keep = args.keep_going;
|
||||
let mut failed = false;
|
||||
|
||||
@@ -89,19 +89,6 @@ fn version_flags_print_the_long_version_to_stdout() {
|
||||
}
|
||||
}
|
||||
|
||||
/// RFC-0018 rule 1.1: `--version` and `-V` work on every subcommand, print one line on stdout and
|
||||
/// return without running it (`mcp` and `app` would otherwise wait on something).
|
||||
#[test]
|
||||
fn every_subcommand_prints_the_version() {
|
||||
let release = format!("{} ({} {})\n", env!("CARGO_PKG_VERSION"), std::env::consts::OS, std::env::consts::ARCH);
|
||||
for sub in ["info", "convert", "run", "script", "commands", "describe", "app", "mcp", "parity", "plugins"] {
|
||||
for spelling in ["--version", "-V"] {
|
||||
let got = invoke(&[sub, spelling]);
|
||||
assert_eq!((got.code, got.stdout, got.stderr), (0, format!("soundcraft-cli-{sub} {release}"), String::new()), "{sub} {spelling}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn version_is_not_a_subcommand() {
|
||||
assert_usage_error(&invoke(&["version"]), "unrecognized subcommand 'version'");
|
||||
|
||||
@@ -26,15 +26,6 @@ fn invoke(dir: &Path, args: &[&str]) -> Output {
|
||||
Command::new(crate::common::soundcraft_cli_binary()).current_dir(dir).env("SOUNDCRAFT_NO_PREFS", "1").args(args).output().unwrap()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn script_accepts_a_leading_utf8_bom() {
|
||||
let dir = Scratch::new();
|
||||
std::fs::write(dir.0.join("bom.txt"), "\u{feff}track.new {\"name\":\"BOM\",\"count\":1,\"format\":\"stereo\"}\n").unwrap();
|
||||
let output = invoke(&dir.0, &["script", "bom.txt"]);
|
||||
assert!(output.status.success(), "{}", String::from_utf8_lossy(&output.stderr));
|
||||
assert!(String::from_utf8_lossy(&output.stdout).contains("track.new:"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn keep_going_runs_later_commands_and_finishes_but_reports_failure() {
|
||||
let dir = Scratch::new();
|
||||
|
||||
@@ -166,13 +166,7 @@ pub fn rotate(dir: &Path) -> std::io::Result<(PathBuf, File)> {
|
||||
/// One formatted log line: `<timestamp> <LEVEL> [<thread>] <target>: <message>\n`.
|
||||
pub fn format_line(ts: &str, level: log::Level, thread: &str, target: &str, message: &str) -> String {
|
||||
let message = message.strip_suffix('\n').unwrap_or(message);
|
||||
// Control characters are written escaped: a message quoting a session file (a plugin id, a
|
||||
// path) must not start a line of its own in the log or steer the terminal.
|
||||
let mut escaped = String::with_capacity(message.len());
|
||||
for c in message.chars() {
|
||||
if c.is_control() { escaped.extend(c.escape_default()) } else { escaped.push(c) }
|
||||
}
|
||||
format!("{ts} {level:<5} [{thread}] {target}: {escaped}\n")
|
||||
format!("{ts} {level:<5} [{thread}] {target}: {message}\n")
|
||||
}
|
||||
|
||||
/// Where formatted lines go besides standard error: kept in memory until a file is attached,
|
||||
|
||||
@@ -158,15 +158,8 @@ fn a_line_carries_time_level_thread_target_and_message() {
|
||||
format_line("2026-10-08T07:59:17.728Z", log::Level::Warn, "main", "soundcraft_mix", "eq_7band: the plugin did not accept its stored state"),
|
||||
"2026-10-08T07:59:17.728Z WARN [main] soundcraft_mix: eq_7band: the plugin did not accept its stored state\n"
|
||||
);
|
||||
// A message with breaks of its own stays one record; the record still ends in exactly one newline.
|
||||
assert!(
|
||||
format_line("t", log::Level::Error, "w", "x", "a\nb\n").ends_with("x: a\\nb\n"),
|
||||
"a break inside the message is escaped, the final one dropped"
|
||||
);
|
||||
assert!(
|
||||
format_line("t", log::Level::Error, "w", "x", "plugin \u{1b}[2J\r\n2026 INFO forged")
|
||||
.ends_with("x: plugin \\u{1b}[2J\\r\\n2026 INFO forged\n")
|
||||
);
|
||||
// A multi-line message keeps its lines; the record still ends in exactly one newline.
|
||||
assert!(format_line("t", log::Level::Error, "w", "x", "a\nb\n").ends_with("x: a\nb\n"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -478,8 +478,6 @@ pub fn create_unique_folder(parent: &Path, prefix: &str) -> std::io::Result<Path
|
||||
for _ in 0..16 {
|
||||
let random = |_| std::collections::hash_map::RandomState::new().build_hasher().finish();
|
||||
let dir = parent.join(format!("{prefix}-{:016x}{:016x}", random(0), random(1)));
|
||||
// Only Unix sets a mode on the builder, so elsewhere it is never mutated.
|
||||
#[cfg_attr(not(unix), allow(unused_mut))]
|
||||
let mut builder = std::fs::DirBuilder::new();
|
||||
#[cfg(unix)]
|
||||
std::os::unix::fs::DirBuilderExt::mode(&mut builder, 0o700);
|
||||
|
||||
@@ -96,92 +96,6 @@ pub fn is_placeholder(path: &str) -> bool {
|
||||
PLACEHOLDERS.contains(&path)
|
||||
}
|
||||
|
||||
/// RFC-0052 hand marks for catalog leaves the engine registry doesn't implement:
|
||||
/// `(path, headless, reach, why)`. A path ending in ` > ` marks every leaf under it; the longest
|
||||
/// matching path wins.
|
||||
///
|
||||
/// `headless` is `no` or `partial`; `reach` is `window` (needs a desktop window, dialog or pointer),
|
||||
/// `os` (needs an OS or online service the engine doesn't wrap) or `engine-gap` (could be an engine
|
||||
/// command, isn't one yet). `yes` is never written here: a leaf is `yes` only when the engine registry
|
||||
/// that `soundcraft-cli` and the MCP server load implements it. UI-layer ids (`parity_with`'s
|
||||
/// `extra`) don't count. An unmarked missing leaf is `unknown`. [`headless_errors`] rejects marks
|
||||
/// that match nothing or only hide a `yes`.
|
||||
pub const HEADLESS: &[(&str, &str, &str, &str)] = &[
|
||||
("File > Open > Project...", "no", "os", "online project service"),
|
||||
("File > Open > Sketch...", "no", "engine-gap", "sketch files could be opened by a command"),
|
||||
("File > Dashboard...", "no", "window", "the start dialog"),
|
||||
("File > Start Collaboration...", "no", "os", "online collaboration service"),
|
||||
("File > Import > ", "no", "engine-gap", "the import could be a command"),
|
||||
("File > Export > ", "no", "engine-gap", "the export could be a command"),
|
||||
("File > Sign In", "no", "os", "online account service"),
|
||||
("Edit > Automation > ", "no", "engine-gap", "automation copies could be commands"),
|
||||
("View > ", "no", "window", "shows or hides part of a desktop window"),
|
||||
("Track > Change Track Width > Show / Hide...", "no", "window", "a desktop dialog"),
|
||||
("Track > ARA Plugins > ", "no", "engine-gap", "no plug-in extension host in the engine yet"),
|
||||
("Clip > ARA Plugins > ", "no", "engine-gap", "no plug-in extension host in the engine yet"),
|
||||
("AudioSuite > ", "no", "engine-gap", "offline processing over the crates/dsp plug-ins could be commands"),
|
||||
("Options > Activate HEAT", "no", "engine-gap", "the processor could be an engine option"),
|
||||
("Setup > Machine Track Arming Profiles...", "no", "os", "external machine control hardware"),
|
||||
("Window > ", "no", "window", "opens or arranges a desktop window"),
|
||||
("Window > Collaboration > ", "no", "os", "online collaboration service"),
|
||||
("Window > Splice", "no", "os", "online sample service"),
|
||||
("Window > SoundFlow", "no", "os", "third-party automation service"),
|
||||
];
|
||||
|
||||
/// Whether a `HEADLESS` mark path covers a catalog leaf.
|
||||
fn mark_covers(mark: &str, leaf: &str) -> bool {
|
||||
mark == leaf || (mark.ends_with(" > ") && leaf.starts_with(mark))
|
||||
}
|
||||
|
||||
/// A leaf's RFC-0052 `headless:` value, `reach:` and reason: `yes` when the engine implements it,
|
||||
/// else the longest `marks` path that covers it, else `unknown`.
|
||||
pub fn headless_of<'a>(leaf: &str, in_engine: bool, marks: &[(&'a str, &'a str, &'a str, &'a str)]) -> (&'a str, Option<&'a str>, &'a str) {
|
||||
if in_engine {
|
||||
return ("yes", None, "");
|
||||
}
|
||||
marks.iter().filter(|m| mark_covers(m.0, leaf)).max_by_key(|m| m.0.len()).map_or(("unknown", None, ""), |m| (m.1, Some(m.2), m.3))
|
||||
}
|
||||
|
||||
/// Problems with `marks` against `leaves` (`(path, in_engine)`): bad values, a mark that covers no
|
||||
/// leaf, and a mark whose leaves the engine all implements (it would only hide a `yes`).
|
||||
pub fn headless_errors(marks: &[(&str, &str, &str, &str)], leaves: &[(&str, bool)]) -> Vec<String> {
|
||||
let mut errs = Vec::new();
|
||||
for (i, (path, value, reach, _)) in marks.iter().enumerate() {
|
||||
if !matches!(*value, "no" | "partial") {
|
||||
errs.push(format!("headless mark `{path}`: `{value}` is not `no` or `partial` (`yes` comes from the registry)"));
|
||||
}
|
||||
if !matches!(*reach, "window" | "os" | "engine-gap") {
|
||||
errs.push(format!("headless mark `{path}`: reach `{reach}` is not window, os or engine-gap"));
|
||||
}
|
||||
if marks[..i].iter().any(|m| m.0 == *path) {
|
||||
errs.push(format!("headless mark `{path}` is written twice"));
|
||||
}
|
||||
let covered: Vec<bool> = leaves.iter().filter(|l| mark_covers(path, l.0)).map(|l| l.1).collect();
|
||||
if covered.is_empty() {
|
||||
errs.push(format!("headless mark `{path}` matches no catalog leaf"));
|
||||
} else if covered.iter().all(|live| *live) {
|
||||
errs.push(format!("headless mark `{path}` is stale: the engine implements every leaf it covers"));
|
||||
}
|
||||
}
|
||||
errs
|
||||
}
|
||||
|
||||
/// The RFC-0052 summary line for a [`parity_with`] report.
|
||||
pub fn headless_summary_line(p: &Value) -> String {
|
||||
let h = &p["headless"];
|
||||
let n = |v: &Value| v.as_u64().unwrap_or(0);
|
||||
format!(
|
||||
"**Headless ([RFC-0052](https://github.com/storytold/craft-contrib/blob/main/rfcs/0052-headless-reach.md)): {} yes, {} no (window {}, os {}, engine-gap {}), {} partial, {} unknown.**",
|
||||
n(&h["yes"]),
|
||||
n(&h["no"]["window"]) + n(&h["no"]["os"]) + n(&h["no"]["engine-gap"]),
|
||||
n(&h["no"]["window"]),
|
||||
n(&h["no"]["os"]),
|
||||
n(&h["no"]["engine-gap"]),
|
||||
n(&h["partial"]),
|
||||
n(&h["unknown"]),
|
||||
)
|
||||
}
|
||||
|
||||
pub fn catalog() -> Vec<&'static str> {
|
||||
MENUS.lines().map(str::trim).filter(|l| !l.is_empty()).collect()
|
||||
}
|
||||
@@ -208,27 +122,17 @@ pub fn parity_with(extra: &[(&str, &str)]) -> Value {
|
||||
let mut done = 0usize;
|
||||
let mut missing = Vec::new();
|
||||
let mut per_menu: std::collections::BTreeMap<String, (usize, usize)> = Default::default();
|
||||
let mut headless: Vec<(&str, Option<&str>)> = Vec::new();
|
||||
let mut headless_missing = Vec::new();
|
||||
for e in &cat {
|
||||
let top = e.split(" > ").next().unwrap_or("").to_string();
|
||||
let slot = per_menu.entry(top).or_default();
|
||||
slot.1 += 1;
|
||||
let in_engine = implemented_by(e, &[]).is_some();
|
||||
let (value, reach, why) = headless_of(e, in_engine, HEADLESS);
|
||||
headless.push((value, reach));
|
||||
if value != "yes" {
|
||||
headless_missing.push(json!({"path": e, "headless": value, "reach": reach, "why": why}));
|
||||
}
|
||||
if in_engine || (!extra.is_empty() && implemented_by(e, extra).is_some()) {
|
||||
if implemented_by(e, extra).is_some() {
|
||||
done += 1;
|
||||
slot.0 += 1;
|
||||
} else {
|
||||
missing.push(*e);
|
||||
}
|
||||
}
|
||||
let count = |v: &str| headless.iter().filter(|h| h.0 == v).count();
|
||||
let no = |r: &str| headless.iter().filter(|h| h.0 == "no" && h.1 == Some(r)).count();
|
||||
let pct = if cat.is_empty() { 0.0 } else { done as f64 * 100.0 / cat.len() as f64 };
|
||||
json!({
|
||||
"total": cat.len(),
|
||||
@@ -236,13 +140,6 @@ pub fn parity_with(extra: &[(&str, &str)]) -> Value {
|
||||
"percent": (pct * 10.0).round() / 10.0,
|
||||
"per_menu": per_menu.iter().map(|(k, (d, t))| json!({"menu": k, "implemented": d, "total": t})).collect::<Vec<_>>(),
|
||||
"missing": missing,
|
||||
"headless": {
|
||||
"yes": count("yes"),
|
||||
"no": {"window": no("window"), "os": no("os"), "engine-gap": no("engine-gap")},
|
||||
"partial": count("partial"),
|
||||
"unknown": count("unknown"),
|
||||
},
|
||||
"headless_missing": headless_missing,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -262,51 +159,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn headless_marks_are_current() {
|
||||
let leaves: Vec<(&str, bool)> = catalog().into_iter().map(|e| (e, implemented_by(e, &[]).is_some())).collect();
|
||||
let errs = headless_errors(HEADLESS, &leaves);
|
||||
assert!(errs.is_empty(), "{errs:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn headless_yes_is_the_engine_only() {
|
||||
let p = parity_json();
|
||||
let h = &p["headless"];
|
||||
assert_eq!(h["yes"], p["implemented"], "engine-only parity: every implemented leaf is yes");
|
||||
// AudioSuite has no engine command: every leaf is marked, none reads as reachable.
|
||||
let audiosuite: Vec<&Value> = p["headless_missing"]
|
||||
.as_array()
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.filter(|m| m["path"].as_str().is_some_and(|x| x.starts_with("AudioSuite > ")))
|
||||
.collect();
|
||||
assert!(!audiosuite.is_empty());
|
||||
assert!(audiosuite.iter().all(|m| m["headless"] == "no" && m["reach"] == "engine-gap"));
|
||||
// A UI-layer alias makes a leaf implemented for the desktop report, not headless.
|
||||
let ui = [("Window > Mix", "window.mix")];
|
||||
let with_ui = parity_with(&ui);
|
||||
assert!(with_ui["implemented"].as_u64() > p["implemented"].as_u64());
|
||||
assert_eq!(with_ui["headless"], p["headless"]);
|
||||
assert!(headless_summary_line(&p).contains(&format!("{} yes", h["yes"])));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn headless_marks_pick_the_longest_path_and_refuse_bad_ones() {
|
||||
let marks = [("W > ", "no", "window", "a"), ("W > C > ", "no", "os", "b"), ("X", "partial", "engine-gap", "c")];
|
||||
assert_eq!(headless_of("W > C > M", false, &marks), ("no", Some("os"), "b"));
|
||||
assert_eq!(headless_of("W > Mix", false, &marks), ("no", Some("window"), "a"));
|
||||
assert_eq!(headless_of("W > Mix", true, &marks).0, "yes");
|
||||
assert_eq!(headless_of("Y", false, &marks).0, "unknown");
|
||||
assert_eq!(headless_of("WX", false, &marks).0, "unknown", "a prefix mark needs the separator");
|
||||
let leaves = [("W > Mix", false), ("X", true)];
|
||||
let bad = [("W > ", "yes", "window", ""), ("W > ", "no", "desk", ""), ("X", "no", "os", ""), ("Z", "no", "os", "")];
|
||||
let errs = headless_errors(&bad, &leaves);
|
||||
for want in ["is not `no` or `partial`", "reach `desk`", "written twice", "`X` is stale", "`Z` matches no catalog leaf"] {
|
||||
assert!(errs.iter().any(|e| e.contains(want)), "{want}: {errs:?}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parity_floor() {
|
||||
let p = parity_json();
|
||||
|
||||
@@ -9,7 +9,7 @@ use super::more_util::toggle_flag;
|
||||
use crate::edit as ops;
|
||||
use crate::{Clipboard, Engine, Result, cmd};
|
||||
use serde_json::{Value, json};
|
||||
use soundcraft_model::{Clip, ClipId, EditMode, Fade, FadeShape, Session, TrackId};
|
||||
use soundcraft_model::{ClipId, EditMode, Fade, FadeShape, Session, TrackId};
|
||||
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
vec![
|
||||
@@ -741,9 +741,10 @@ fn trim_to_file(e: &mut Engine, p: &Value) -> Result<Value> {
|
||||
if let Some((frames, lo, hi)) = trim_limits(s, id)
|
||||
&& let Some(c) = s.find_clip_mut(id)
|
||||
{
|
||||
let (file_start, file_end) = file_span(c, frames);
|
||||
c.trim_start_to(file_start.max(lo));
|
||||
c.trim_end_to(file_end.min(hi));
|
||||
let off = c.source_offset();
|
||||
let new_start = c.start - off;
|
||||
c.trim_start_to(new_start.max(lo));
|
||||
c.trim_end_to((new_start + frames).min(hi));
|
||||
n += 1;
|
||||
}
|
||||
}
|
||||
@@ -759,24 +760,15 @@ fn trim_to_fill(e: &mut Engine, p: &Value) -> Result<Value> {
|
||||
if let Some((frames, lo, hi)) = trim_limits(s, id)
|
||||
&& let Some(c) = s.find_clip_mut(id)
|
||||
{
|
||||
let (file_start, file_end) = file_span(c, frames);
|
||||
let file_start = c.start - c.source_offset();
|
||||
c.trim_start_to(r.start.max(file_start).max(lo));
|
||||
c.trim_end_to(r.end.min(file_end).min(hi));
|
||||
c.trim_end_to(r.end.min(file_start + frames).min(hi));
|
||||
n += 1;
|
||||
}
|
||||
}
|
||||
Ok(json!({"trimmed": n}))
|
||||
}
|
||||
|
||||
/// Where a clip's whole source file lies on the timeline. The mixer plays `offset + rel / stretch`,
|
||||
/// so the file starts `offset * stretch` before the clip and spans `frames * stretch` samples.
|
||||
fn file_span(c: &Clip, frames: Samples) -> (Samples, Samples) {
|
||||
let stretch = if c.stretch.is_finite() && c.stretch > 0.0 { c.stretch } else { 1.0 };
|
||||
let scale = |n: Samples| if (stretch - 1.0).abs() >= 1e-9 { (n as f64 * stretch).round() as Samples } else { n };
|
||||
let start = c.start.saturating_sub(scale(c.source_offset()));
|
||||
(start, start.saturating_add(scale(frames)))
|
||||
}
|
||||
|
||||
/// How far a trim may extend an audio clip: its source length in frames, and the earliest
|
||||
/// start and latest end before it would run over the clip before or after it on the playlist
|
||||
/// (an extension never overwrites, like the trim tool). An overlap the clip already has with
|
||||
@@ -1262,33 +1254,6 @@ mod tests {
|
||||
assert_eq!(bounds(&e, t), vec![(0, 10_000, 0), (10_000, 40_000, 10_000), (40_000, 45_000, 0)]);
|
||||
}
|
||||
|
||||
/// A lone stretched clip (start 20,000, length 10,000, source offset 5,000) over the 60,000-frame source.
|
||||
fn stretched_trim_session(stretch: f64) -> (Engine, TrackId, Vec<ClipId>) {
|
||||
let (mut e, t, ids) = trim_session(&[(20_000, 10_000, 5_000)]);
|
||||
if let Some(c) = e.session_mut().find_clip_mut(ids[0]) {
|
||||
c.stretch = stretch;
|
||||
}
|
||||
(e, t, ids)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trim_to_file_boundaries_covers_the_whole_stretched_file() {
|
||||
let (mut e, t, ids) = stretched_trim_session(2.0);
|
||||
e.execute("edit.trim_to_file_boundaries", &json!({"clips": [ids[0].0]})).unwrap();
|
||||
let (start, end, offset) = bounds(&e, t)[0];
|
||||
assert_eq!(offset, 0, "the clip starts at the file start");
|
||||
assert!(((end - start) as f64 / 2.0 - 60_000.0).abs() <= 1.0, "it plays every file frame: {start}..{end}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trim_to_fill_selection_stops_at_the_stretched_file() {
|
||||
let (mut e, t, ids) = stretched_trim_session(2.0);
|
||||
e.execute("edit.trim_to_fill_selection", &json!({"clips": [ids[0].0], "start": 0, "end": 500_000})).unwrap();
|
||||
let (start, end, offset) = bounds(&e, t)[0];
|
||||
assert_eq!(offset, 0);
|
||||
assert!(((end - start) as f64 / 2.0 - 60_000.0).abs() <= 1.0, "a wider selection stops at the file: {start}..{end}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn trim_to_fill_selection_stops_at_the_neighbours() {
|
||||
let (mut e, t, ids) = trim_session(&[(0, 10_000, 0), (20_000, 10_000, 20_000), (40_000, 5_000, 0)]);
|
||||
|
||||
@@ -11,7 +11,7 @@ use soundcraft_model::{AutoParam, AutomationMode, INSERT_SLOTS, Insert, SEND_SLO
|
||||
pub fn specs() -> Vec<CommandSpec> {
|
||||
vec![
|
||||
cmd!("mix.volume", "Set Volume", [], None, "{tracks?, db: -144..12 | delta_db}", has_selection, volume),
|
||||
cmd!("mix.pan", "Set Pan", [], None, "{tracks?, pan: -1..1, index?: 0|1 (stereo: required, 0 = left, 1 = right)}", has_selection, pan),
|
||||
cmd!("mix.pan", "Set Pan", [], None, "{tracks?, pan: -1..1, index?: 0|1}", has_selection, pan),
|
||||
cmd!("mix.mute", "Mute", [], Some("Shift+M"), "{tracks?, value?: bool}", has_selection, |e, p| toggle(
|
||||
e,
|
||||
p,
|
||||
@@ -280,25 +280,8 @@ fn pan(e: &mut Engine, p: &Value) -> Result<Value> {
|
||||
let tracks = tracks_required(e, "mix.pan", p)?;
|
||||
let v = (p.get("pan").and_then(Value::as_f64).filter(|v| v.is_finite()).ok_or_else(|| bad("mix.pan", "`pan` (number) required"))? as f32)
|
||||
.clamp(-1.0, 1.0);
|
||||
// A stereo track has one panner per channel, so it must say which: moving only the left one
|
||||
// by default folded the left channel into the right. An index the track lacks is an error too.
|
||||
// `null` means no index, as with `slot`. `i64_or` rounds, so the number has to be whole already.
|
||||
let idx = match p.get("index") {
|
||||
None | Some(Value::Null) => None,
|
||||
Some(i) => {
|
||||
let whole = i.as_f64().is_some_and(|f| f.fract() == 0.0);
|
||||
Some(usize::try_from(i64_or(p, "index", -1)).ok().filter(|n| whole && *n <= 1).ok_or_else(|| bad("mix.pan", "`index` must be 0 or 1"))?)
|
||||
}
|
||||
};
|
||||
let idx = i64_or(p, "index", 0).clamp(0, 1) as usize;
|
||||
let s = e.session_mut();
|
||||
for tr in tracks.iter().filter_map(|t| s.track(*t)) {
|
||||
match (idx, tr.mixer.pan.len()) {
|
||||
(None, 2) => return Err(bad("mix.pan", format!("`{}` is stereo: give `index` 0 (left channel) or 1 (right channel)", tr.name))),
|
||||
(Some(1), 1) => return Err(bad("mix.pan", format!("`{}` is mono: its only panner is `index` 0", tr.name))),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
let idx = idx.unwrap_or(0);
|
||||
for t in &tracks {
|
||||
if let Some(tr) = s.track_mut(*t)
|
||||
&& let Some(slot) = tr.mixer.pan.get_mut(idx)
|
||||
|
||||
@@ -413,38 +413,6 @@ fn clip_gain_to_volume_with_a_large_envelope_stays_fast() {
|
||||
assert!(lane.points.len() as i64 >= n);
|
||||
}
|
||||
|
||||
/// A stereo track has a panner per channel. `mix.pan` without `index` used to move only the left
|
||||
/// one, which folded the left channel into the right.
|
||||
#[test]
|
||||
fn panning_a_stereo_track_names_the_channel() {
|
||||
let mut e = Engine::default();
|
||||
e.execute("track.new", &json!({"name": "Pad", "format": "stereo"})).unwrap();
|
||||
e.execute("track.new", &json!({"name": "Vox", "format": "mono"})).unwrap();
|
||||
let pans = |e: &Engine, name: &str| e.session().tracks.iter().find(|t| t.name == name).map(|t| t.mixer.pan.clone());
|
||||
assert!(e.execute("mix.pan", &json!({"tracks": ["Pad"], "pan": -0.3})).is_err());
|
||||
assert_eq!(pans(&e, "Pad"), Some(vec![-1.0, 1.0]), "a refused pan leaves the track alone");
|
||||
e.execute("mix.pan", &json!({"tracks": ["Pad"], "pan": -0.3, "index": 1})).unwrap();
|
||||
assert_eq!(pans(&e, "Pad"), Some(vec![-1.0, -0.3]));
|
||||
// A whole number written as a float counts; a fraction is an error (1.4 used to round to 1).
|
||||
assert!(e.execute("mix.pan", &json!({"tracks": ["Pad"], "pan": 0.9, "index": 1.4})).is_err());
|
||||
assert_eq!(pans(&e, "Pad"), Some(vec![-1.0, -0.3]));
|
||||
e.execute("mix.pan", &json!({"tracks": ["Pad"], "pan": 0.9, "index": 1.0})).unwrap();
|
||||
assert_eq!(pans(&e, "Pad"), Some(vec![-1.0, 0.9]));
|
||||
// `null` means no index, as with `slot`, so a stereo track still needs one.
|
||||
assert!(e.execute("mix.pan", &json!({"tracks": ["Pad"], "pan": 0.0, "index": null})).is_err());
|
||||
// A mono track has one panner: no index needed, and any other index is an error, not a no-op.
|
||||
e.execute("mix.pan", &json!({"tracks": ["Vox"], "pan": 0.25, "index": null})).unwrap();
|
||||
assert_eq!(pans(&e, "Vox"), Some(vec![0.25]));
|
||||
e.execute("mix.pan", &json!({"tracks": ["Vox"], "pan": 0.5})).unwrap();
|
||||
assert_eq!(pans(&e, "Vox"), Some(vec![0.5]));
|
||||
for index in [json!(1), json!(2), json!(-1), json!("1"), json!(0.4)] {
|
||||
assert!(e.execute("mix.pan", &json!({"tracks": ["Vox"], "pan": 0.0, "index": index})).is_err(), "index {index}");
|
||||
}
|
||||
// One stereo track without an index stops the whole command.
|
||||
assert!(e.execute("mix.pan", &json!({"tracks": ["Vox", "Pad"], "pan": 0.2})).is_err());
|
||||
assert_eq!(pans(&e, "Vox"), Some(vec![0.5]));
|
||||
}
|
||||
|
||||
/// Live input toggles stay outside document history in both enabled and disabled states.
|
||||
#[test]
|
||||
fn live_input_states_are_transient_and_survive_document_history() {
|
||||
|
||||
@@ -98,16 +98,8 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
)),
|
||||
cmd!("track.commit", "Commit...", ["Track"], Some("Alt+Shift+C"), "{tracks?}", has_selection, commit),
|
||||
cmd!("track.bounce", "Bounce...", ["Track"], Some("Cmd+Alt+Shift+B"), "{tracks?}", has_selection, commit),
|
||||
cmd!("track.bypass_inserts", "All", ["Track", "Bypass Inserts"], Some("Shift+A"), "{tracks?, bypass?: bool}", has_selection, bypass_inserts),
|
||||
cmd!(
|
||||
"track.mute_sends",
|
||||
"All",
|
||||
["Track", "Mute Sends"],
|
||||
Some("Shift+Q"),
|
||||
"{tracks?, mute?: bool} (toggles when omitted)",
|
||||
has_selection,
|
||||
|e, p| super::track_more::mute_sends_where(e, p, 0, 10)
|
||||
),
|
||||
cmd!("track.bypass_inserts", "All", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, bypass_inserts),
|
||||
cmd!("track.mute_sends", "All", ["Track", "Mute Sends"], None, "{tracks?, mute?: bool}", has_selection, mute_sends),
|
||||
cmd!(noundo "track.set_record_to_input_only", "Set Record Tracks to Input Only", ["Track"], Some("Alt+K"), "{}", always, |e, _| {
|
||||
let s = e.runtime_session_mut();
|
||||
let mut n = 0;
|
||||
@@ -960,6 +952,20 @@ fn bypass_inserts(e: &mut Engine, p: &Value) -> Result<Value> {
|
||||
Ok(json!({"bypass": target}))
|
||||
}
|
||||
|
||||
fn mute_sends(e: &mut Engine, p: &Value) -> Result<Value> {
|
||||
let tracks = tracks_required(e, "track.mute_sends", p)?;
|
||||
let s = e.session_mut();
|
||||
let target = p.get("mute").and_then(Value::as_bool).unwrap_or(true);
|
||||
for t in &tracks {
|
||||
if let Some(tr) = s.track_mut(*t) {
|
||||
for snd in tr.mixer.sends.iter_mut().flatten() {
|
||||
snd.mute = target;
|
||||
}
|
||||
}
|
||||
}
|
||||
Ok(json!({"mute": target}))
|
||||
}
|
||||
|
||||
fn create_click(e: &mut Engine, _: &Value) -> Result<Value> {
|
||||
let s = e.session_mut();
|
||||
let id = s.add_track(TrackKind::Aux, ChannelFormat::Mono, Some("Click"));
|
||||
|
||||
@@ -68,56 +68,38 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
has_selection,
|
||||
load_preset
|
||||
),
|
||||
cmd!(
|
||||
"track.bypass_inserts_ae",
|
||||
"Inserts A-E",
|
||||
["Track", "Bypass Inserts"],
|
||||
Some("Shift+2"),
|
||||
"{tracks?, bypass?: bool}",
|
||||
has_selection,
|
||||
|e, p| bypass_where(e, p, |i, _| i < 5)
|
||||
),
|
||||
cmd!(
|
||||
"track.bypass_inserts_fj",
|
||||
"Inserts F-J",
|
||||
["Track", "Bypass Inserts"],
|
||||
Some("Shift+3"),
|
||||
"{tracks?, bypass?: bool}",
|
||||
has_selection,
|
||||
|e, p| bypass_where(e, p, |i, _| (5..10).contains(&i))
|
||||
),
|
||||
cmd!(
|
||||
"track.bypass_eq",
|
||||
"EQ",
|
||||
["Track", "Bypass Inserts"],
|
||||
Some("Shift+E"),
|
||||
"{tracks?, bypass?: bool} — EQ plug-ins only",
|
||||
has_selection,
|
||||
|e, p| bypass_where(e, p, |_, c| c == Some(Category::Eq))
|
||||
),
|
||||
cmd!("track.bypass_dynamics", "Dynamics", ["Track", "Bypass Inserts"], Some("Shift+C"), "{tracks?, bypass?: bool}", has_selection, |e, p| {
|
||||
bypass_where(e, p, |_, c| c == Some(Category::Dynamics))
|
||||
cmd!("track.bypass_inserts_ae", "Inserts A-E", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, |e, p| {
|
||||
bypass_where(e, p, |i, _| i < 5)
|
||||
}),
|
||||
cmd!("track.bypass_reverb", "Reverb", ["Track", "Bypass Inserts"], Some("Shift+V"), "{tracks?, bypass?: bool}", has_selection, |e, p| {
|
||||
bypass_where(e, p, |_, c| c == Some(Category::Reverb))
|
||||
cmd!("track.bypass_inserts_fj", "Inserts F-J", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, |e, p| {
|
||||
bypass_where(e, p, |i, _| (5..10).contains(&i))
|
||||
}),
|
||||
cmd!("track.bypass_delay", "Delay", ["Track", "Bypass Inserts"], Some("Shift+D"), "{tracks?, bypass?: bool}", has_selection, |e, p| {
|
||||
bypass_where(e, p, |_, c| c == Some(Category::Delay))
|
||||
cmd!("track.bypass_eq", "EQ", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool} — EQ plug-ins only", has_selection, |e, p| {
|
||||
bypass_where(e, p, |_, c| c == Some(Category::Eq))
|
||||
}),
|
||||
cmd!("track.bypass_dynamics", "Dynamics", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, |e, p| bypass_where(
|
||||
e,
|
||||
p,
|
||||
|_, c| c == Some(Category::Dynamics)
|
||||
)),
|
||||
cmd!("track.bypass_reverb", "Reverb", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, |e, p| bypass_where(
|
||||
e,
|
||||
p,
|
||||
|_, c| c == Some(Category::Reverb)
|
||||
)),
|
||||
cmd!("track.bypass_delay", "Delay", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, |e, p| bypass_where(
|
||||
e,
|
||||
p,
|
||||
|_, c| c == Some(Category::Delay)
|
||||
)),
|
||||
cmd!("track.bypass_modulation", "Modulation", ["Track", "Bypass Inserts"], None, "{tracks?, bypass?: bool}", has_selection, |e, p| {
|
||||
bypass_where(e, p, |_, c| c == Some(Category::Modulation))
|
||||
}),
|
||||
cmd!(
|
||||
"track.bypass_modulation",
|
||||
"Modulation",
|
||||
["Track", "Bypass Inserts"],
|
||||
Some("Shift+W"),
|
||||
"{tracks?, bypass?: bool}",
|
||||
has_selection,
|
||||
|e, p| bypass_where(e, p, |_, c| c == Some(Category::Modulation))
|
||||
),
|
||||
cmd!(
|
||||
"track.mute_sends_ae",
|
||||
"Sends A-E",
|
||||
["Track", "Mute Sends"],
|
||||
Some("Shift+4"),
|
||||
None,
|
||||
"{tracks?, mute?: bool} (toggles when omitted)",
|
||||
has_selection,
|
||||
|e, p| mute_sends_where(e, p, 0, 5)
|
||||
@@ -126,7 +108,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
"track.mute_sends_fj",
|
||||
"Sends F-J",
|
||||
["Track", "Mute Sends"],
|
||||
Some("Shift+5"),
|
||||
None,
|
||||
"{tracks?, mute?: bool} (toggles when omitted)",
|
||||
has_selection,
|
||||
|e, p| mute_sends_where(e, p, 5, 10)
|
||||
@@ -353,7 +335,7 @@ fn bypass_where(e: &mut Engine, p: &Value, pick: fn(usize, Option<Category>) ->
|
||||
Ok(json!({"bypass": target, "inserts": n}))
|
||||
}
|
||||
|
||||
pub(super) fn mute_sends_where(e: &mut Engine, p: &Value, from: usize, to: usize) -> Result<Value> {
|
||||
fn mute_sends_where(e: &mut Engine, p: &Value, from: usize, to: usize) -> Result<Value> {
|
||||
let tracks = tracks_required(e, "track.mute_sends", p)?;
|
||||
let s = e.session_mut();
|
||||
let all_muted = tracks.iter().filter_map(|t| s.track(*t)).all(|tr| tr.mixer.sends.iter().skip(from).take(to - from).flatten().all(|x| x.mute));
|
||||
@@ -599,8 +581,6 @@ mod tests {
|
||||
assert!(!e.session().track_by_name("Snare").unwrap().mixer.sends[0].as_ref().unwrap().mute);
|
||||
e.execute("track.mute_sends_ae", &json!({})).unwrap();
|
||||
assert!(e.session().track_by_name("Snare").unwrap().mixer.sends[0].as_ref().unwrap().mute);
|
||||
e.execute("track.mute_sends", &json!({})).unwrap();
|
||||
assert!(!e.session().track_by_name("Snare").unwrap().mixer.sends[0].as_ref().unwrap().mute);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -29,8 +29,7 @@ pub fn specs() -> Vec<CommandSpec> {
|
||||
always,
|
||||
offset
|
||||
),
|
||||
cmd!(query "video.list", "Movies", [], None, "{} — lists session movies with media details, clip counts, `file_found`, and any recorded `offline` reason. \
|
||||
The top-level `online` flag reports the Video Track Online setting.", always, |e, _| {
|
||||
cmd!(query "video.list", "Movies", [], None, "{} — movies used by Video tracks (path, size, rate, codec, online file, why it is offline)", always, |e, _| {
|
||||
let s = e.session();
|
||||
let rows: Vec<Value> = s
|
||||
.videos
|
||||
|
||||
@@ -1241,10 +1241,7 @@ pub(crate) fn read_aaf_plan(_: &str, _: &str, _: Option<&str>) -> Result<Value>
|
||||
Err(EngineError::Io("AAF import needs the desktop app: its media files are read from a local folder".into()))
|
||||
}
|
||||
|
||||
// Every test here plants a link, so the module and its helper are Unix-only. `cfg(test)` stays an
|
||||
// attribute of its own: clippy allows `unwrap` in tests only under a plain `#[cfg(test)]`.
|
||||
#[cfg(test)]
|
||||
#[cfg(unix)]
|
||||
mod exclusive_tests {
|
||||
use super::*;
|
||||
|
||||
|
||||
@@ -562,9 +562,7 @@ mod open_tests {
|
||||
let at = |f: &str| dir.join(f).to_string_lossy().into_owned();
|
||||
assert_eq!(got[0], (stored_path("Movies/here.mov", &session).unwrap().to_string_lossy().into_owned(), None));
|
||||
assert_eq!(got[1], (at("near.mov"), None));
|
||||
// Joined part by part, as `relink_videos` does: `join("Video Files/filed.mov")` keeps the `/`,
|
||||
// which differs from the relinked path on Windows.
|
||||
assert_eq!(got[2], (dir.join("Video Files").join("filed.mov").to_string_lossy().into_owned(), None));
|
||||
assert_eq!(got[2], (at("Video Files/filed.mov"), None));
|
||||
assert_eq!(got[3], ("Old/gone.mov".into(), Some("file not found".into())));
|
||||
assert_eq!(got[4].0, stored[4]);
|
||||
assert!(got[4].1.as_deref().is_some_and(|why| why.starts_with("not opened:")), "{:?}", got[4]);
|
||||
|
||||
@@ -18,7 +18,7 @@ fn kick_trim(e: &Engine) -> f32 {
|
||||
#[test]
|
||||
fn mix_pan_rejects_a_missing_or_non_numeric_pan_and_keeps_the_pan() {
|
||||
let mut e = engine_with_kick();
|
||||
e.execute("mix.pan", &json!({"tracks": ["Kick"], "pan": -1.0, "index": 0})).unwrap();
|
||||
e.execute("mix.pan", &json!({"tracks": ["Kick"], "pan": -1.0})).unwrap();
|
||||
assert_eq!(kick_pan(&e)[0], -1.0);
|
||||
|
||||
for params in [json!({"tracks": ["Kick"]}), json!({"tracks": ["Kick"], "pan": "left"}), json!({"tracks": ["Kick"], "pan": null})] {
|
||||
|
||||
@@ -114,8 +114,6 @@ pub(super) fn translate(source: &str) -> Option<&'static str> {
|
||||
"End" => "Fim",
|
||||
"Extract" => "Extrair",
|
||||
"File" => "Arquivo",
|
||||
"File path" => "Caminho do arquivo",
|
||||
"Folder path" => "Caminho da pasta",
|
||||
"Format" => "Formato",
|
||||
"Grab bag" => "Diversos",
|
||||
"Grid" => "Grade",
|
||||
|
||||
@@ -155,12 +155,6 @@ impl SoundApp {
|
||||
let _language = crate::localization::enter(self.ui.language);
|
||||
self.ui.undo_levels = self.ui.undo_levels.clamp(1, 64);
|
||||
self.engine.set_history_limit(self.ui.undo_levels);
|
||||
// A saved state (a hand-edited `ui.json`) can hold more than the menu keeps: keep the newest
|
||||
// (the list is newest first) and have the host save the corrected list.
|
||||
if self.ui.recent_sessions.len() > crate::dialogs::recent::MAX_RECENT {
|
||||
self.ui.recent_sessions.truncate(crate::dialogs::recent::MAX_RECENT);
|
||||
self.recent_changed = true;
|
||||
}
|
||||
// Fonts set now take effect next frame, so draw only from the frame after.
|
||||
if !self.fonts_ready {
|
||||
if self.fonts_installed {
|
||||
|
||||
@@ -234,8 +234,6 @@ impl SoundApp {
|
||||
Ok(dir)
|
||||
}
|
||||
|
||||
/// Ends recording, clears the punch state and places the recorded takes
|
||||
/// (from the recorder or the take plan when the recorder is already gone).
|
||||
fn finish_recording(&mut self) {
|
||||
self.engine.transport.recording = false;
|
||||
let midi_pass = self.end_midi_pass();
|
||||
@@ -248,21 +246,13 @@ impl SoundApp {
|
||||
// The audio input stops taking in first: waiting for the MIDI below would otherwise add
|
||||
// what the input hears meanwhile to the audio takes. No input device is open when the
|
||||
// pass was MIDI only.
|
||||
let (takes, problem) = self.recorder.as_mut().map_or_else(|| (Vec::new(), None), |r| r.finish());
|
||||
// The audio thread writes down what was played up to the stop; the clips wait for that.
|
||||
let plan = self.take_plan.take();
|
||||
self.punch = None;
|
||||
self.autosaved_rev = 0;
|
||||
// The recorder can already be gone (tests run headless): the plan still names the takes,
|
||||
// so place what it holds; with neither, there is nothing to place.
|
||||
let (takes, problem) = match (&mut self.recorder, &plan) {
|
||||
(Some(r), _) => r.finish(),
|
||||
(None, Some(plan)) => (plan.takes.iter().map(|t| (t.track, t.path.clone())).collect(), None),
|
||||
(None, None) => (Vec::new(), None),
|
||||
};
|
||||
let midi_confirmed = self.await_midi_capture(midi_pass);
|
||||
// Where the pass ended: the audio engine's own position is the freshest.
|
||||
let engine_at = self.player.as_ref().map(|p| p.position());
|
||||
let stopped_at = super::midi::pass_stop(engine_at, self.engine.transport.position);
|
||||
let plan = self.take_plan.take();
|
||||
let tracks = takes.len().max(1);
|
||||
let plan = plan.unwrap_or_else(|| soundcraft_engine::io::Recording {
|
||||
start: self.record_start,
|
||||
@@ -271,6 +261,8 @@ impl SoundApp {
|
||||
rate: 0,
|
||||
takes: Vec::new(),
|
||||
});
|
||||
self.punch = None;
|
||||
self.autosaved_rev = 0;
|
||||
let ids = soundcraft_engine::io::place_recording(&mut self.engine, &plan, takes);
|
||||
// The audio engine may have confirmed the pass while the audio takes were finished: the
|
||||
// stop position and what the user is told go by one answer.
|
||||
@@ -471,14 +463,7 @@ impl SoundApp {
|
||||
}
|
||||
TransportRequest::Record => {
|
||||
if self.engine.transport.recording {
|
||||
// Punching out ends the take; while playing, the transport keeps
|
||||
// running, like QuickPunch. `finish_recording` places the take
|
||||
// without touching playback.
|
||||
if self.is_playing() {
|
||||
self.finish_recording();
|
||||
} else {
|
||||
self.stop_play();
|
||||
}
|
||||
self.stop_play();
|
||||
} else {
|
||||
self.start_recording();
|
||||
}
|
||||
@@ -577,60 +562,4 @@ mod tests {
|
||||
assert_eq!(app.fallback_take_dir().unwrap(), a, "the same folder for the rest of the run");
|
||||
let _ = std::fs::remove_dir_all(&a);
|
||||
}
|
||||
|
||||
/// Punching out (Record pressed again mid-take) ends the take and leaves the transport
|
||||
/// running, like QuickPunch: the punch clears, the take is placed inside the punch range,
|
||||
/// and playback continues from where it was.
|
||||
#[test]
|
||||
fn punching_out_while_playing_keeps_the_transport_running() {
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, crate::Services::default());
|
||||
app.run("track.new", json!({"count": 1, "format": "mono"})).unwrap();
|
||||
let track = app.engine.session().tracks[0].id;
|
||||
// A take already recorded over the punch range, so the punch-out has something to place.
|
||||
let take = std::env::temp_dir().join(format!("soundcraft-punch-out-take-{}.wav", std::process::id()));
|
||||
let opts = craft_audio::EncodeOptions::new(craft_audio::EncodeFormat::Wav);
|
||||
std::fs::write(
|
||||
&take,
|
||||
craft_audio::encode(&craft_audio::AudioBuffer { sample_rate: 48_000, channels: vec![vec![0.0; 96_000]] }, &opts).unwrap(),
|
||||
)
|
||||
.unwrap();
|
||||
app.record_start = 0;
|
||||
app.punch = Some(Range { start: 48_000, end: 96_000 });
|
||||
app.take_plan = Some(soundcraft_engine::io::Recording {
|
||||
start: 0,
|
||||
pass: None,
|
||||
punch: app.punch,
|
||||
rate: 48_000,
|
||||
takes: vec![soundcraft_engine::io::Take { track, path: take.clone(), channels: 1 }],
|
||||
});
|
||||
// Punch out two seconds in: the playhead must keep its place, not restart from the top.
|
||||
app.start_play(96_000, None, None);
|
||||
app.engine.transport.recording = true;
|
||||
app.engine.transport_requests.push(TransportRequest::Record);
|
||||
app.handle_transport(1.0 / 60.0);
|
||||
assert!(!app.engine.transport.recording, "the take ends");
|
||||
assert!(app.punch.is_none(), "the punch clears");
|
||||
assert!(app.is_playing(), "playback continues after the punch-out");
|
||||
assert!(app.engine.transport.position >= 96_000, "the playhead keeps its place instead of restarting");
|
||||
let clips = app.engine.session().track(track).unwrap().clips().to_vec();
|
||||
assert_eq!(clips.len(), 1, "the take is placed");
|
||||
assert_eq!(clips[0].start, 48_000, "the take is trimmed to the punch");
|
||||
assert_eq!(clips[0].end(), 96_000, "the take covers the punch");
|
||||
let _ = std::fs::remove_file(&take);
|
||||
}
|
||||
|
||||
/// A Record press while recording but not playing (a player that died mid-take, say)
|
||||
/// still stops everything, from where it was.
|
||||
#[test]
|
||||
fn a_record_press_while_recording_but_stopped_still_stops() {
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, crate::Services::default());
|
||||
app.start_play(96_000, None, None);
|
||||
app.engine.transport.playing = false;
|
||||
app.engine.transport.recording = true;
|
||||
app.engine.transport_requests.push(TransportRequest::Record);
|
||||
app.handle_transport(1.0 / 60.0);
|
||||
assert!(!app.engine.transport.recording);
|
||||
assert!(!app.is_playing());
|
||||
assert_eq!(app.engine.transport.position, 96_000, "the playhead stays where it stopped");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,8 +342,7 @@ fn bounce_file_row(app: &mut SoundApp, ui: &mut egui::Ui, path: &mut String, for
|
||||
|
||||
/// The path prompt's form; the command to run once it is confirmed.
|
||||
fn path_prompt_form(app: &mut SoundApp, ui: &mut egui::Ui, cmd: &str, path: &mut String, key: &str, enter: bool) -> Option<(String, Value)> {
|
||||
let label = if key == "dir" { crate::localization::text("Folder path") } else { crate::localization::text("File path") };
|
||||
crate::widgets::named_text_field(ui.add(egui::TextEdit::singleline(path).desired_width(420.0)), label);
|
||||
crate::widgets::named_text_field(ui.add(egui::TextEdit::singleline(path).desired_width(420.0)), crate::localization::text("Path"));
|
||||
let mut picked = None;
|
||||
// Import Audio picks several files at once; every other open dialog takes one.
|
||||
let multi = cmd == "file.import_audio" && app.services.pick_open_many.is_some();
|
||||
@@ -445,9 +444,7 @@ fn strip_silence_form(
|
||||
mode = Some("separate");
|
||||
}
|
||||
// Enter on a focused Extract or Separate clicks that button, so Enter presses Strip only when neither was clicked.
|
||||
// The button is its own string ("Strip Silence"), not the Channel Strip plug-in's
|
||||
// short name "Strip", so translations can give them different words (#1610).
|
||||
if buttons(ui, "Strip Silence", enter) && mode.is_none() {
|
||||
if buttons(ui, "Strip", enter) && mode.is_none() {
|
||||
mode = Some("strip");
|
||||
}
|
||||
// Enter on a focused Rename… also presses Strip, so Rename… goes first.
|
||||
|
||||
@@ -159,19 +159,4 @@ mod tests {
|
||||
let ui: crate::UiState = serde_json::from_str("{}").unwrap();
|
||||
assert!(ui.recent_sessions.is_empty());
|
||||
}
|
||||
|
||||
/// A saved state with more entries than the menu keeps (a hand-edited `ui.json`) is cut to
|
||||
/// the newest [`MAX_RECENT`] on the first frame, and a list within the limit is left alone.
|
||||
/// Cutting it tells the host to save, so the file is corrected without waiting for a clean exit.
|
||||
#[test]
|
||||
fn an_oversized_saved_list_is_capped_on_the_first_frame() {
|
||||
let paths = |count: usize| (0..count).map(|i| format!("{i}.scraft")).collect::<Vec<_>>();
|
||||
for (saved, kept) in [(1000, MAX_RECENT), (MAX_RECENT + 1, MAX_RECENT), (MAX_RECENT, MAX_RECENT), (3, 3), (0, 0)] {
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, crate::Services::default());
|
||||
app.ui = serde_json::from_value(json!({"recent_sessions": paths(saved)})).unwrap();
|
||||
let mut harness = egui_kittest::Harness::builder().build_ui_state(|ui, app: &mut SoundApp| app.logic(&ui.ctx().clone()), app);
|
||||
assert_eq!(harness.state().ui.recent_sessions, paths(kept), "{saved} saved entries");
|
||||
assert_eq!(harness.state_mut().take_recent_changed(), saved > kept, "{saved} saved entries: save only when entries were cut");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,16 +512,6 @@ mod tests {
|
||||
}
|
||||
}
|
||||
|
||||
/// The Strip Silence dialog's action button and the Channel Strip plug-in's short name are
|
||||
/// different strings ("remove" vs a channel strip): the button keeps the dialog's own key,
|
||||
/// so a translation gives each its word (#1610).
|
||||
#[test]
|
||||
fn strip_button_translates_as_its_own_key() {
|
||||
let pt = Language::PortugueseBrazil;
|
||||
assert_eq!(pt.text("Strip Silence"), "Remover silêncio", "the dialog's action button");
|
||||
assert_eq!(pt.text("Strip"), "Canal", "the Channel Strip plug-in's short name keeps its own key");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_localized_source_string_has_a_catalog_entry() {
|
||||
fn visit(dir: &std::path::Path, missing: &mut Vec<String>) {
|
||||
|
||||
@@ -866,8 +866,6 @@ pub fn run_ui_command(app: &mut SoundApp, id: &str, p: &Value) -> Option<Result<
|
||||
app.ui = ns;
|
||||
app.ui.undo_levels = app.ui.undo_levels.clamp(1, 64);
|
||||
app.engine.set_history_limit(app.ui.undo_levels);
|
||||
// The list is newest first, so this keeps the newest, as `recent::note` does.
|
||||
app.ui.recent_sessions.truncate(crate::dialogs::recent::MAX_RECENT);
|
||||
if closed_preferences {
|
||||
app.preferences.discard_draft();
|
||||
}
|
||||
@@ -953,60 +951,6 @@ mod tests {
|
||||
assert_eq!((app.ui.undo_levels, app.engine.history_limit), (64, 64));
|
||||
}
|
||||
|
||||
fn recent_paths(count: usize) -> Vec<String> {
|
||||
(0..count).map(|i| format!("{i}.scraft")).collect()
|
||||
}
|
||||
|
||||
/// `ui.set` keeps the newest `MAX_RECENT` recent sessions, in order, and answers with that list.
|
||||
#[test]
|
||||
fn ui_set_keeps_at_most_ten_recent_sessions() {
|
||||
use crate::dialogs::recent::MAX_RECENT;
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, Services::default());
|
||||
for count in [MAX_RECENT + 1, 1000] {
|
||||
let result = app.run("ui.set", json!({"recent_sessions": recent_paths(count)})).unwrap();
|
||||
assert_eq!(app.ui.recent_sessions, recent_paths(MAX_RECENT), "{count} entries: the first ten, in order");
|
||||
assert_eq!(result["ui"]["recent_sessions"], json!(recent_paths(MAX_RECENT)), "{count} entries: the answer shows the kept list");
|
||||
}
|
||||
}
|
||||
|
||||
/// A list within the limit, an empty one included, is stored as given.
|
||||
#[test]
|
||||
fn ui_set_leaves_a_recent_list_within_the_limit_alone() {
|
||||
use crate::dialogs::recent::MAX_RECENT;
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, Services::default());
|
||||
for count in [MAX_RECENT, MAX_RECENT - 1, 1, 0] {
|
||||
let result = app.run("ui.set", json!({"recent_sessions": recent_paths(count)})).unwrap();
|
||||
assert_eq!(app.ui.recent_sessions, recent_paths(count), "{count} entries");
|
||||
assert_eq!(result["ui"]["recent_sessions"], json!(recent_paths(count)), "{count} entries");
|
||||
}
|
||||
}
|
||||
|
||||
/// Capping the list does not drop the other fields of the same call.
|
||||
#[test]
|
||||
fn ui_set_applies_other_fields_beside_a_capped_recent_list() {
|
||||
use crate::dialogs::recent::MAX_RECENT;
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, Services::default());
|
||||
let result = app.run("ui.set", json!({"recent_sessions": recent_paths(25), "undo_levels": 7})).unwrap();
|
||||
assert_eq!((app.ui.recent_sessions.len(), app.ui.undo_levels, app.engine.history_limit), (MAX_RECENT, 7, 7));
|
||||
assert_eq!(result["ui"]["undo_levels"], 7);
|
||||
// A call that does not name the list leaves it as it was.
|
||||
app.run("ui.set", json!({"undo_levels": 9})).unwrap();
|
||||
assert_eq!(app.ui.recent_sessions, recent_paths(MAX_RECENT));
|
||||
}
|
||||
|
||||
/// A list that is not an array of strings is refused, however long, and nothing changes.
|
||||
#[test]
|
||||
fn ui_set_refuses_a_recent_list_of_the_wrong_type() {
|
||||
let mut app = SoundApp::new(soundcraft_engine::Engine::default(), None, Services::default());
|
||||
app.run("ui.set", json!({"recent_sessions": recent_paths(3), "undo_levels": 7})).unwrap();
|
||||
let numbers: Vec<u32> = (0..25).collect();
|
||||
for bad in [json!("a.scraft"), json!(5), json!(null), json!({"0": "a.scraft"}), json!(["a.scraft", 5]), json!(numbers)] {
|
||||
let error = app.run("ui.set", json!({"recent_sessions": bad, "undo_levels": 20})).unwrap_err();
|
||||
assert!(error.starts_with("bad ui state"), "{bad}: {error}");
|
||||
assert_eq!((app.ui.recent_sessions.clone(), app.ui.undo_levels), (recent_paths(3), 7), "{bad} changed the state");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn mix_view_aliases_are_allocated_once() {
|
||||
let first = ui_aliases();
|
||||
|
||||
@@ -23,21 +23,6 @@ fn harness() -> Harness<'static, SoundApp> {
|
||||
h
|
||||
}
|
||||
|
||||
/// How many frames a bounce may take before a test calls it stuck. A frame renders for a slice of
|
||||
/// wall-clock time, so a slow CPU needs many more frames than the harness's `max_steps`.
|
||||
const MAX_FRAMES: usize = 100_000;
|
||||
|
||||
/// Steps frames until the bounce ends, then lets the app settle.
|
||||
fn finish_bounce(h: &mut Harness<'_, SoundApp>) {
|
||||
let mut frames = 0;
|
||||
while h.state().bounce.is_some() {
|
||||
h.step();
|
||||
frames += 1;
|
||||
assert!(frames < MAX_FRAMES, "the bounce did not finish within {MAX_FRAMES} frames");
|
||||
}
|
||||
h.run();
|
||||
}
|
||||
|
||||
fn scratch(name: &str) -> PathBuf {
|
||||
let dir = std::env::temp_dir().join(format!("soundcraft-ui-{name}-{}", std::process::id()));
|
||||
let _ = std::fs::remove_dir_all(&dir);
|
||||
@@ -92,7 +77,7 @@ fn a_bounce_renders_across_frames_with_progress_until_its_file_is_written() {
|
||||
h.step();
|
||||
}
|
||||
assert!(progress.is_sorted() && progress[0] < progress[3] && progress[3] < 1.0, "{progress:?}");
|
||||
finish_bounce(&mut h);
|
||||
h.run();
|
||||
assert!(h.state().bounce.is_none());
|
||||
assert!(h.state().ui.status.starts_with("Bounced Mix.wav (peak"), "{}", h.state().ui.status);
|
||||
let (_, file) = craft_audio::decode(&std::fs::read(dir.join("Mix.wav")).unwrap(), None).unwrap();
|
||||
@@ -112,7 +97,7 @@ fn a_bounce_keeps_going_while_the_window_is_hidden() {
|
||||
let _ = ctx.run_logic(&egui::RawInput::default(), |ctx| h.state_mut().logic(ctx));
|
||||
assert!(h.state().bounce.is_none() || ctx.has_requested_repaint());
|
||||
calls += 1;
|
||||
assert!(calls < MAX_FRAMES);
|
||||
assert!(calls < 10_000);
|
||||
}
|
||||
assert!(calls > 3, "{calls}");
|
||||
assert!(h.state().ui.status.starts_with("Bounced Hidden.wav"), "{}", h.state().ui.status);
|
||||
|
||||
@@ -225,52 +225,3 @@ fn a_midi_editor_behind_another_tab_leaves_the_arrows_to_the_edit_window() {
|
||||
let (x, middle) = x_and_middle(&app, clip.start);
|
||||
assert!((x - middle).abs() < 1.0, "Left: the clip start at {x}, the middle at {middle}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn pro_tools_shift_keys_bypass_inserts_and_mute_sends() {
|
||||
for os in [OperatingSystem::Mac, OperatingSystem::Windows, OperatingSystem::Nix] {
|
||||
let mut app = SoundApp::new(soundcraft_engine::demo::demo_engine(), None, Services::default());
|
||||
app.engine.execute("edit.select", &json!({"tracks": ["Snare"]})).unwrap();
|
||||
let ctx = egui::Context::default();
|
||||
ctx.set_os(os);
|
||||
for (key, id) in [
|
||||
(Key::A, "track.bypass_inserts"),
|
||||
(Key::Num2, "track.bypass_inserts_ae"),
|
||||
(Key::Num3, "track.bypass_inserts_fj"),
|
||||
(Key::E, "track.bypass_eq"),
|
||||
(Key::C, "track.bypass_dynamics"),
|
||||
(Key::V, "track.bypass_reverb"),
|
||||
(Key::D, "track.bypass_delay"),
|
||||
(Key::W, "track.bypass_modulation"),
|
||||
(Key::Q, "track.mute_sends"),
|
||||
(Key::Num4, "track.mute_sends_ae"),
|
||||
(Key::Num5, "track.mute_sends_fj"),
|
||||
] {
|
||||
let before = app.engine.journal.len();
|
||||
press(&ctx, &mut app, key, Modifiers::SHIFT);
|
||||
assert_eq!(app.engine.journal.len(), before + 1, "{os:?} Shift+{key:?}: {}", app.ui.status);
|
||||
assert_eq!(app.engine.journal.back().unwrap().0, id, "{os:?} Shift+{key:?}");
|
||||
}
|
||||
let muted = |app: &SoundApp| app.engine.session().track_by_name("Snare").unwrap().mixer.sends[0].as_ref().is_some_and(|s| s.mute);
|
||||
let was = muted(&app);
|
||||
press(&ctx, &mut app, Key::Q, Modifiers::SHIFT);
|
||||
assert_ne!(muted(&app), was, "{os:?}");
|
||||
press(&ctx, &mut app, Key::Q, Modifiers::SHIFT);
|
||||
assert_eq!(muted(&app), was, "{os:?}: a second Shift+Q unmutes");
|
||||
|
||||
// The keys reach the right inserts, not just the right command ids: Kick has an EQ then a compressor.
|
||||
app.engine.execute("edit.select", &json!({"tracks": ["Kick"]})).unwrap();
|
||||
let bypassed = |app: &SoundApp| -> Vec<bool> {
|
||||
app.engine.session().track_by_name("Kick").unwrap().mixer.inserts.iter().take(2).map(|i| i.as_ref().unwrap().bypass).collect()
|
||||
};
|
||||
let before = bypassed(&app);
|
||||
press(&ctx, &mut app, Key::E, Modifiers::SHIFT);
|
||||
let after_eq = bypassed(&app);
|
||||
assert_ne!(after_eq[0], before[0], "{os:?}: Shift+E flips the EQ");
|
||||
assert_eq!(after_eq[1], before[1], "{os:?}: Shift+E leaves the compressor");
|
||||
press(&ctx, &mut app, Key::C, Modifiers::SHIFT);
|
||||
let after_dyn = bypassed(&app);
|
||||
assert_ne!(after_dyn[1], before[1], "{os:?}: Shift+C flips the compressor");
|
||||
assert_eq!(after_dyn[0], after_eq[0], "{os:?}: Shift+C leaves the EQ");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ fn enter_right_after_switching_between_strip_silence_and_rename_presses_the_new_
|
||||
#[test]
|
||||
fn strip_silence_strip_removes_the_silence() {
|
||||
let (mut h, track, before) = strip_silence_dialog();
|
||||
h.get_by_role_and_label(Role::Button, "Strip Silence").click();
|
||||
h.get_by_role_and_label(Role::Button, "Strip").click();
|
||||
h.run_steps(2);
|
||||
assert_eq!(h.state().dialogs.open_name(), None);
|
||||
let strip = clips(&h, track);
|
||||
@@ -167,7 +167,7 @@ fn strip_silence_opens_with_the_values_escape_closed_it_with() {
|
||||
fn strip_silence_opens_with_the_values_strip_used() {
|
||||
let (mut h, _, _) = strip_silence_dialog();
|
||||
set_values(&mut h, CHANGED);
|
||||
h.get_by_role_and_label(Role::Button, "Strip Silence").click();
|
||||
h.get_by_role_and_label(Role::Button, "Strip").click();
|
||||
h.run_steps(2);
|
||||
assert_eq!(reopen(&mut h), CHANGED);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ fn rename_names_the_clips_strip_silence_leaves() {
|
||||
click(&mut h, "OK");
|
||||
assert_eq!(h.state().dialogs.open_name(), Some("strip_silence"), "OK goes back to Strip Silence");
|
||||
assert_eq!(h.state().dialogs.strip_names, sfx());
|
||||
click(&mut h, "Strip Silence");
|
||||
click(&mut h, "Strip");
|
||||
assert_eq!(h.state().dialogs.open_name(), None);
|
||||
let names: Vec<String> = h.state().engine.session().track(track).unwrap().clips().iter().map(|c| c.name.clone()).collect();
|
||||
assert!(names.len() > 1);
|
||||
|
||||
+115
-118
@@ -19,123 +19,120 @@ UI-layer commands (windows, AudioSuite) are counted by the app's own report (`en
|
||||
| View | 92 | 112 |
|
||||
| Window | 1 | 52 |
|
||||
|
||||
**Headless ([RFC-0052](https://github.com/storytold/craft-contrib/blob/main/rfcs/0052-headless-reach.md)): 397 yes, 115 no (window 68, os 9, engine-gap 38), 0 partial, 0 unknown.**
|
||||
A leaf the engine implements is `headless: yes`: `soundcraft-cli` and the MCP server load that registry. The rest carry the hand mark from `HEADLESS` in `crates/engine/src/catalog.rs`, or `unknown`.
|
||||
|
||||
## Not yet implemented
|
||||
|
||||
- File > Open > Project...: headless: no, reach: os (online project service)
|
||||
- File > Open > Sketch...: headless: no, reach: engine-gap (sketch files could be opened by a command)
|
||||
- File > Dashboard...: headless: no, reach: window (the start dialog)
|
||||
- File > Start Collaboration...: headless: no, reach: os (online collaboration service)
|
||||
- File > Import > VENUE Channel Names as Track Names: headless: no, reach: engine-gap (the import could be a command)
|
||||
- File > Export > Selected Tracks as New AAF/OMF...: headless: no, reach: engine-gap (the export could be a command)
|
||||
- File > Export > Selected Tracks as New Media Composer Compatible Session...: headless: no, reach: engine-gap (the export could be a command)
|
||||
- File > Sign In: headless: no, reach: os (online account service)
|
||||
- Edit > Automation > Duplicate Dolby Atmos Plugin Automation to Pan Automation: headless: no, reach: engine-gap (automation copies could be commands)
|
||||
- Edit > Automation > Duplicate Pan Automation to Dolby Atmos Plugin Automation: headless: no, reach: engine-gap (automation copies could be commands)
|
||||
- Edit > Automation > Coalesce Pan Guide Automation: headless: no, reach: engine-gap (automation copies could be commands)
|
||||
- View > Mix Window Views > Mic Preamps: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Instruments: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > HEAT: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Inserts A-E: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Inserts F-J: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Sends A-E: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Sends F-J: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > EQ Curve: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > I/O: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Object: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Meters and Faders: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Delay Compensation: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Track Color: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Comments: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > All: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Mix Window Views > Minimal: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Narrow Mix: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Other Displays > Universe: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Other Displays > Track List: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- View > Other Displays > Clip List: headless: no, reach: window (shows or hides part of a desktop window)
|
||||
- Track > Change Track Width > Show / Hide...: headless: no, reach: window (a desktop dialog)
|
||||
- Track > ARA Plugins > Melodyne: headless: no, reach: engine-gap (no plug-in extension host in the engine yet)
|
||||
- Clip > ARA Plugins > Melodyne: headless: no, reach: engine-gap (no plug-in extension host in the engine yet)
|
||||
- AudioSuite > EQ > Channel Strip: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > EQ > EQ3 1-Band: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > EQ > EQ3 7-Band: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Dynamics > BF-76: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Dynamics > Channel Strip: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Dynamics > Dyn3 Compressor/Limiter: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Dynamics > Dyn3 De-Esser: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Dynamics > Dyn3 Expander/Gate: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Dynamics > Maxim: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Pitch Shift > Pitch II: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Pitch Shift > Pitch Shift Legacy: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Pitch Shift > Time Shift: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Pitch Shift > Vari-Fi: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Reverb > D-Verb: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Delay > Mod Delay III: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Modulation > Sci-Fi: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Harmonic > Eleven Lite: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Harmonic > Lo-Fi: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Harmonic > Recti-Fi: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Harmonic > SansAmp PSA-1: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > DC Offset Removal: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Duplicate: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Gain: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Invert: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Normalize: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Reverse: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Signal Generator: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- AudioSuite > Other > Time Compression Expansion: headless: no, reach: engine-gap (offline processing over the crates/dsp plug-ins could be commands)
|
||||
- Options > Activate HEAT: headless: no, reach: engine-gap (the processor could be an engine option)
|
||||
- Setup > Machine Track Arming Profiles...: headless: no, reach: os (external machine control hardware)
|
||||
- Window > Configurations > Window Configuration List: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Configurations > New Configuration...: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Configurations > Update Active Configuration: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Configurations > Auto-Update Active Configuration: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Arrange > Tile: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Arrange > Tile Horizontal: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Arrange > Tile Vertical: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Arrange > Cascade: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Hide All Floating Windows: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Close Window: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Mix: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Edit: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Sketch to Front: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > MIDI Editor: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Score Editor: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > MIDI Event List: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > MIDI Editors > Bring to Front: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > MIDI Editors > Send to Back: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > MIDI Keyboard: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Clip List: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Clip Effects: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > ARA Plugins: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Splice: headless: no, reach: os (online sample service)
|
||||
- Window > Learn: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > SoundFlow: headless: no, reach: os (third-party automation service)
|
||||
- Window > Task Manager: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > New Workspace > Default: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > New Workspace > Soundbase: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > New Workspace > Track Presets: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Workspaces > Bring to Front: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Workspaces > Send to Back: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Workspaces > Close All Workspaces: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Transport: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Big Counter: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Automation: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Memory Locations: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Machine Track Arming: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Video Universe: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Video: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Color Palette: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > UI Customization: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Metadata Inspector: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Transcript: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Pro Tools Search: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Renderer: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Trim and Downmix: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > Collaboration > Pro Tools Projects: headless: no, reach: os (online collaboration service)
|
||||
- Window > Collaboration > Find Talent: headless: no, reach: os (online collaboration service)
|
||||
- Window > Collaboration > Messages: headless: no, reach: os (online collaboration service)
|
||||
- Window > Disk Usage: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- Window > System Usage: headless: no, reach: window (opens or arranges a desktop window)
|
||||
- File > Open > Project...
|
||||
- File > Open > Sketch...
|
||||
- File > Dashboard...
|
||||
- File > Start Collaboration...
|
||||
- File > Import > VENUE Channel Names as Track Names
|
||||
- File > Export > Selected Tracks as New AAF/OMF...
|
||||
- File > Export > Selected Tracks as New Media Composer Compatible Session...
|
||||
- File > Sign In
|
||||
- Edit > Automation > Duplicate Dolby Atmos Plugin Automation to Pan Automation
|
||||
- Edit > Automation > Duplicate Pan Automation to Dolby Atmos Plugin Automation
|
||||
- Edit > Automation > Coalesce Pan Guide Automation
|
||||
- View > Mix Window Views > Mic Preamps
|
||||
- View > Mix Window Views > Instruments
|
||||
- View > Mix Window Views > HEAT
|
||||
- View > Mix Window Views > Inserts A-E
|
||||
- View > Mix Window Views > Inserts F-J
|
||||
- View > Mix Window Views > Sends A-E
|
||||
- View > Mix Window Views > Sends F-J
|
||||
- View > Mix Window Views > EQ Curve
|
||||
- View > Mix Window Views > I/O
|
||||
- View > Mix Window Views > Object
|
||||
- View > Mix Window Views > Meters and Faders
|
||||
- View > Mix Window Views > Delay Compensation
|
||||
- View > Mix Window Views > Track Color
|
||||
- View > Mix Window Views > Comments
|
||||
- View > Mix Window Views > All
|
||||
- View > Mix Window Views > Minimal
|
||||
- View > Narrow Mix
|
||||
- View > Other Displays > Universe
|
||||
- View > Other Displays > Track List
|
||||
- View > Other Displays > Clip List
|
||||
- Track > Change Track Width > Show / Hide...
|
||||
- Track > ARA Plugins > Melodyne
|
||||
- Clip > ARA Plugins > Melodyne
|
||||
- AudioSuite > EQ > Channel Strip
|
||||
- AudioSuite > EQ > EQ3 1-Band
|
||||
- AudioSuite > EQ > EQ3 7-Band
|
||||
- AudioSuite > Dynamics > BF-76
|
||||
- AudioSuite > Dynamics > Channel Strip
|
||||
- AudioSuite > Dynamics > Dyn3 Compressor/Limiter
|
||||
- AudioSuite > Dynamics > Dyn3 De-Esser
|
||||
- AudioSuite > Dynamics > Dyn3 Expander/Gate
|
||||
- AudioSuite > Dynamics > Maxim
|
||||
- AudioSuite > Pitch Shift > Pitch II
|
||||
- AudioSuite > Pitch Shift > Pitch Shift Legacy
|
||||
- AudioSuite > Pitch Shift > Time Shift
|
||||
- AudioSuite > Pitch Shift > Vari-Fi
|
||||
- AudioSuite > Reverb > D-Verb
|
||||
- AudioSuite > Delay > Mod Delay III
|
||||
- AudioSuite > Modulation > Sci-Fi
|
||||
- AudioSuite > Harmonic > Eleven Lite
|
||||
- AudioSuite > Harmonic > Lo-Fi
|
||||
- AudioSuite > Harmonic > Recti-Fi
|
||||
- AudioSuite > Harmonic > SansAmp PSA-1
|
||||
- AudioSuite > Other > DC Offset Removal
|
||||
- AudioSuite > Other > Duplicate
|
||||
- AudioSuite > Other > Gain
|
||||
- AudioSuite > Other > Invert
|
||||
- AudioSuite > Other > Normalize
|
||||
- AudioSuite > Other > Reverse
|
||||
- AudioSuite > Other > Signal Generator
|
||||
- AudioSuite > Other > Time Compression Expansion
|
||||
- Options > Activate HEAT
|
||||
- Setup > Machine Track Arming Profiles...
|
||||
- Window > Configurations > Window Configuration List
|
||||
- Window > Configurations > New Configuration...
|
||||
- Window > Configurations > Update Active Configuration
|
||||
- Window > Configurations > Auto-Update Active Configuration
|
||||
- Window > Arrange > Tile
|
||||
- Window > Arrange > Tile Horizontal
|
||||
- Window > Arrange > Tile Vertical
|
||||
- Window > Arrange > Cascade
|
||||
- Window > Hide All Floating Windows
|
||||
- Window > Close Window
|
||||
- Window > Mix
|
||||
- Window > Edit
|
||||
- Window > Sketch to Front
|
||||
- Window > MIDI Editor
|
||||
- Window > Score Editor
|
||||
- Window > MIDI Event List
|
||||
- Window > MIDI Editors > Bring to Front
|
||||
- Window > MIDI Editors > Send to Back
|
||||
- Window > MIDI Keyboard
|
||||
- Window > Clip List
|
||||
- Window > Clip Effects
|
||||
- Window > ARA Plugins
|
||||
- Window > Splice
|
||||
- Window > Learn
|
||||
- Window > SoundFlow
|
||||
- Window > Task Manager
|
||||
- Window > New Workspace > Default
|
||||
- Window > New Workspace > Soundbase
|
||||
- Window > New Workspace > Track Presets
|
||||
- Window > Workspaces > Bring to Front
|
||||
- Window > Workspaces > Send to Back
|
||||
- Window > Workspaces > Close All Workspaces
|
||||
- Window > Transport
|
||||
- Window > Big Counter
|
||||
- Window > Automation
|
||||
- Window > Memory Locations
|
||||
- Window > Machine Track Arming
|
||||
- Window > Video Universe
|
||||
- Window > Video
|
||||
- Window > Color Palette
|
||||
- Window > UI Customization
|
||||
- Window > Metadata Inspector
|
||||
- Window > Transcript
|
||||
- Window > Pro Tools Search
|
||||
- Window > Renderer
|
||||
- Window > Trim and Downmix
|
||||
- Window > Collaboration > Pro Tools Projects
|
||||
- Window > Collaboration > Find Talent
|
||||
- Window > Collaboration > Messages
|
||||
- Window > Disk Usage
|
||||
- Window > System Usage
|
||||
|
||||
Reference in New Issue
Block a user