Phase 31: add CLAP, VST2 and VST3 mono effect hosting

This commit is contained in:
Johannes Findeisen 2026-10-27 17:34:46 +01:00
commit 9e0e4562d7
114 changed files with 10369 additions and 75 deletions

View file

@ -36,8 +36,37 @@ with tempfile.TemporaryDirectory(prefix="xtc-inspect-") as directory:
# Inspection succeeds for readable files without trying dlopen or decoding.
module.write_text("Deliberately not an executable module")
check("--inspect", project, 0, "no plugin code executed")
# Current metadata-only inspection must not execute any modern plugin ABI.
maps = base[base.index("CONTROL_MAPS"):]
for number, name, identity in ((1, "CLAP", "org.xtc.fixture"), (2, "VST2", ""),
(3, "VST3", "0123456789abcdef0123456789abcdef")):
lines = []
for line in plugin.splitlines():
if line.startswith(("CONTROL ", "PARAM ")):
continue
if line.startswith("XTC_PROJECT "):
line = "XTC_PROJECT 11"
elif line.startswith("PLUGIN "):
fields = line.split()
fields[4] = "0"
line = " ".join(fields)
elif line.startswith("PLUGIN_AUTOMATION "):
line = "PLUGIN_AUTOMATION 0"
elif line == "END":
line = maps.rstrip()
lines.append(line)
if line.startswith("MODULE "):
lines.append(f"FORMAT {number} {identity.encode().hex() if identity else '-'}")
modern = "\n".join(lines) + "\n"
project.write_text(modern)
check("--inspect", project, 0, name + " node 0", "Project format 11")
project.write_text(modern.replace(f"FORMAT {number} ", "FORMAT 99 "))
check("--validate", project, 1, "Unsupported")
if number == 3:
project.write_text(modern.replace(identity.encode().hex(), b"bad-class-id".hex()))
check("--validate", project, 1)
for text, messages in [
(base.replace("XTC_PROJECT 10", "XTC_PROJECT 999"), ("line 1", "999", "1..10")),
(base.replace("XTC_PROJECT 10", "XTC_PROJECT 999"), ("line 1", "999", "1..11")),
("XTC_PROJECT 10\n", ("line 2", "APP")),
(base.replace("TEMPO 120000", "TEMPO 0"), ("line 3", "TEMPO")),
(base + "OPTIONAL_FUTURE 1\n", ("Unknown fields",)),