Skip to content

Transport display elements for dawcore: <daw-time-display>, <daw-time-format>, daw-timeupdate (#459)

Choose a tag to compare

@naomiaro naomiaro released this 28 Jun 01:21
6971ab6

Native transport display and control elements for dawcore, part of the web-components transport epic (#459). PR #498.

Published packages

Package Version
@dawcore/components 0.0.25

These elements merged after 0.0.24 (the dawcore-wam-plugins release) shipped, so they first reached npm in 0.0.25 — the same publish as the mixerVersion fix (#501).

What changed

<daw-time-display>

Formatted playback-time readout. Listens for document-level daw-timeupdate / daw-time-format-change events, filtered to its transport target. role="status", aria-live="off".

<daw-time-format>

A <select> that sets the time format on the target editor (target.setTimeFormat()). The target owns the format state; every control syncs via the bubbled daw-time-format-change event — the native-form pattern to reuse for future transport inputs.

daw-timeupdate + single editor-owned animation loop

<daw-editor> now runs one playback RAF loop that positions the playhead and dispatches daw-timeupdate. editor.timeFormat property plus isPlaying / duration getters and a daw-time-format-change event were added.

Breaking: <daw-playhead> is now a dumb element

<daw-playhead> no longer animates itself — it exposes setPosition(px) and is driven by the editor's loop. If you drove the playhead independently, move that to the editor's daw-timeupdate. (dawcore is pre-1.0; this rides a patch bump.)

Transport capability detection

Duck-typed targetSupports() helpers let transport controls enable/disable based on whether their resolved target actually implements the methods they call — a not-yet-upgraded custom-element target gets the benefit of the doubt (stays enabled, warns at click time).