openmixer — generated API reference
    Preparing search index...

    Class ChannelConfigStore

    Persists named per-channel configs and drives save/apply over a provider; also serves the read-only factory instrument templates through the same list/get/apply doors.

    Hierarchy

    Index
    dir: string
    ext: ".chanconf.json" = '.chanconf.json'

    File suffix for this library's entries (.scene.json, …).

    idGen: () => string
    label: "channel config" = 'channel config'

    What this library's entries are CALLED, in refusals the operator reads: no such ${label}, corrupt ${label} file, ${label} name must not be empty.

    now: () => Date
    • Apply stored config id onto channel atomically (the provider broadcasts it) — the SAME door for an operator-saved config and a read-only factory template.

      sections narrows which of EQ/Gate/Comp land (operator, 2026-09-10: independent switches on the apply). undefined — every OTHER caller, and every existing on-disk config applied before this — means every section the config carries, the door's original whole-state meaning; a caller that switched a section OFF passes the ones still on.

      Parameters

      • id: string
      • channel: ChannelAddress
      • Optionalsections: readonly ("eq" | "gate" | "comp")[]

      Returns Promise<void>

    • What applying config id onto channel RIGHT NOW would MOVE off what that channel holds — the read the surface's warning is built from (RULED 2026-09-01). Computed against the SAME body apply hands the provider, synchronously so a resource GET can read it. undefined for an id that names nothing (the item's honest absence). Mutates nothing.

      Parameters

      Returns ChannelConfigMoves | undefined

    • Refuses a factory id outright — read-only means read-only, not a silent no-op or a confusing "file not found" for a template that was never a file.

      Parameters

      • id: string

      Returns Promise<void>

    • Read a full stored entry by id (for embedders / the domain verbs).

      Parameters

      • id: string

      Returns Promise<ChannelConfig>

    • Narrow a parsed file to a stored entry. A GUARD, never a cast — see listStoredSync.

      Parameters

      • value: unknown

      Returns value is ChannelConfig

    • The refusal for an id that names nothing. Overridden where a caller must narrow with instanceof instead of matching on error text.

      Parameters

      • id: string

      Returns Error

    • Observe every persisted mutation — a write (save, autosave, overwrite) or a delete — fired AFTER the file settles, with the touched id. Wired once by the server to re-publish the library's list + item rows, so an internal writer (the debounced live autosave, the pre-load restore point) announces exactly like the POST door: task #72's rule — the write that changed the books is the write that tells every surface — applied to the /sessions standing discovery in the convergence e2e.

      Parameters

      • observe: (id: string) => void

      Returns void

    • The file an id lives in — through the id guard, so a hostile id never escapes dir.

      Parameters

      • id: string

      Returns string

    • A factory id resolves from the in-memory table; anything else reads from disk as usual.

      Parameters

      • id: string

      Returns Promise<ChannelConfig>

    • The sync twin, resolving a factory id the same way — a synchronous resource GET (applyMoves) must see the templates the async door serves.

      Parameters

      • id: string

      Returns ChannelConfig | undefined

    • A trimmed non-empty name, or the refusal a blank one earns.

      Parameters

      • name: string

      Returns string

    • Capture channel's chain + processing under name; returns the new id.

      family FILES the config beside the factory templates of that family in a picker (ChannelConfig.family). Optional by ruling — an operator who names none gets an ungrouped entry, which is a choice, not a missing field — and already narrowed by the row's codec, so the store stores what it is given and refuses nothing here.

      Parameters

      • channel: ChannelAddress
      • name: string
      • Optionalfamily:
            | "keys"
            | "playback"
            | "drums"
            | "percussion"
            | "bass"
            | "guitar"
            | "vocals"
            | "brass"
            | "wind"
            | "strings"

      Returns Promise<{ id: string }>

    • Guards every write path (today only save, but the guard is the store's, not the caller's): an id that collides with a factory template is refused before it ever reaches disk, rather than silently shadowing (or being shadowed by) the read-only entry.

      Parameters

      Returns Promise<void>