openmixer — generated API reference
    Preparing search index...

    Function pickAutorouteSink

    • Pick the sink the main mix should auto-route to, from the patchbay's enumerated sinks: the host's default sink when it is enumerated, else the first local-hardware sink, else the first sink at all. avoidIds excludes the demo's own virtual nodes (their loopback sink sides are enumerated as patchable sinks — auto-routing the main into one of them would just re-create the no-consumer loop). Portless nodes are never picked (nothing to pw-link to). Returns undefined when no eligible sink exists (CI / headless), so the caller can skip cleanly.

      Type Parameters

      Parameters

      • sinks: readonly T[]

        the enumerated patchbay sinks

      • defaultName: string | undefined

        the default sink's node name (resolveDefaultSinkName), if known

      • avoidIds: readonly string[] = []

        sink ids never to auto-pick (the demo's own nodes)

      Returns T | undefined

      the chosen sink, or undefined when none is eligible