Skip to content

fix(ltc): LTC output failures are never surfaced — lastError is published but unread #796

Description

@chienchuanw

Summary

LTCAudioOutput.lastError is @Published and its doc comment says it exists "for UI to surface" — but no consumer reads it. LTCOutputHost never touches it, and nothing else references it. LTC output failures are silently swallowed today.

Found while designing MTC output (#794) and deliberately left out of that epic so it would not perturb the LTC path.

Why it matters

LTCAudioOutput records lastError on exactly the failures that matter at showtime:

  • "No output channel is assigned to LTC."start(at:routing:programRing:) bails.
  • "The selected audio output device is unavailable." — the routed interface was unplugged or vanished.
  • "The audio device's format isn't supported."

In every case the engine stops producing LTC and the operator gets no indication whatsoever. The transport keeps running and the desk simply stops receiving timecode.

Suggested fix

#794 established the pattern to copy. MTC surfaces the same class of failure in two places, both driven by one pure state machine:

  • MTCStatusLabel — pure off / ready / sending / failed state + copy, unit-tested, where failed outranks sending.
  • MTCStatusPill — a small pill beside the playhead clock, red on failure.
  • A status row in the relevant Settings pane.

An LTC equivalent could reuse MTCStatusLabel's shape (or a shared type) and sit alongside the MTC pill, plus a status row in Settings → Audio next to the existing routing warnings.

Acceptance criteria (Gherkin)

Given LTC output is enabled and running
When the routed audio device is disconnected
Then the LTC failure is visible in the document window without opening Settings
  And Settings → Audio shows the reason

Given LTC output is enabled but no channel is assigned to LTC
When playback starts
Then the reason is surfaced rather than silently producing no timecode

Notes

Scope is surfacing only — no change to LTCAudioOutput's error detection, which already works. Mostly wiring plus a pure label type and its tests.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ltcLTC encoder, audio routingarea:uiSwiftUI viewsbugDefect to fixp2Nice to havetype:featUser-visible feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions