Hand-rolled MP4/M4A box layer: parse the structure, read iTunes metadata, and
regenerate moov (with patched chunk offsets) to synthesize a re-tagged file
whose mdat audio payload is served verbatim. Strict: anything outside the
supported shape (single audio track, one mdat, non-fragmented) is rejected.
Shared outcome type for bounded metadata probing: a format parser is given
only a prefix of the file (plus the true file_len) and either completes,
or reports the exact byte offset it must reach to continue.
A reference to one embedded picture to synthesize. The image bytes themselves
are NOT held here — only data_len, the exact byte length — because the caller
streams the image into the spliced region at read time. art_id is an opaque
handle the caller maps back to its blob store.
A reference to one opaque binary tag payload to synthesize. Like ArtInput,
the bytes are NOT held here — only len and payload_id, an opaque handle the
caller (musefs-core) maps to the tags rowid it streams from. key is the
format-private identifier the synthesis path decodes (ID3 frame id,
APPLICATION/CUESHEET, ----:<mean>:<name>).
A non-zero payload length for an art image or binary tag. The non-zero
invariant encodes the layout’s EmptySegment rule at the type level:
a degenerate empty payload is dropped at the construction boundary, so a
metadata segment can never carry a zero length.
A binary tag frame extracted at scan time: the format-private identifier
(key — an ID3 4-char frame id, a FLAC APPLICATION/CUESHEET, or an MP4
----:<mean>:<name>) and the raw post-header body (payload). Unlike
BinaryTagInput, this owns the bytes (scan ingests them into the DB).
An ordered description of a synthesized virtual file: the metadata region
(inline framing + art images) followed by the backing audio. Totals are
computed once at construction; segments is private so they cannot desync.
True if key is a legal VorbisComment field name: one or more characters in
ASCII 0x20..=0x7D, excluding 0x3D (=). This is the Vorbis spec grammar and
matches what mutagen/TagLib enforce when writing. Non-ASCII, control chars,
=, and the empty string are all rejected.