@dawcore/components 0.0.39-next.14 → 0.0.39-next.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -512,7 +512,7 @@ Methods:
512
512
 
513
513
  ### `<daw-track>`
514
514
 
515
- Declarative track data. Attributes: `src`, `name`, `volume`, `pan`, `muted`, `soloed`, `kind` (`'audio' | 'midi'`, default `'audio'`: what the track holds; set it before the track is added), `render-mode` (`'waveform' | 'spectrogram'`, default `'waveform'`: how an audio track is drawn; a MIDI track is always a piano roll). JS property: `spectrogramConfig` (per-track spectrogram override). Also exposes the per-track effects API (see [Effects](#effects)). The attributes are the declaration and are never written by the editor; the properties `name`, `volume`, `pan`, `muted` and `soloed` read the arrangement live (after an Undo they show the restored values), and setting one, or changing its attribute, is one undo step. `index` is the track's position in the arrangement. An element whose track left the arrangement (an Undo of its arrival, a removal made on the arrangement) or that waits while a handed-in arrangement is set is detached: `:state(detached)` in CSS, its properties read the declaration, and a change warns and does nothing. Moving a `<daw-track>` in the DOM reorders the track; an Undo moves no element. Fires `daw-track-update` `{ trackId, changed }` after a property changes. Loading does not clear the undo history.
515
+ Declarative track data. Attributes: `src`, `name`, `volume`, `pan`, `pan-law` (`'mono'` or `'stereo'`: the pan law the track enters with; without it the track's first decoded audio decides, and the track keeps that law whatever clips follow; the live `panLaw` property reads it), `muted`, `soloed`, `kind` (`'audio' | 'midi'`, default `'audio'`: what the track holds; set it before the track is added), `render-mode` (`'waveform' | 'spectrogram'`, default `'waveform'`: how an audio track is drawn; a MIDI track is always a piano roll). JS property: `spectrogramConfig` (per-track spectrogram override). Also exposes the per-track effects API (see [Effects](#effects)). The attributes are the declaration and are never written by the editor; the properties `name`, `volume`, `pan`, `panLaw`, `muted` and `soloed` read the arrangement live (after an Undo they show the restored values), and setting one, or changing its attribute, is one undo step (`panLaw = 'auto'` on a track that has entered changes nothing: a decided law does not go back). `index` is the track's position in the arrangement. An element whose track left the arrangement (an Undo of its arrival, a removal made on the arrangement) or that waits while a handed-in arrangement is set is detached: `:state(detached)` in CSS, its properties read the declaration, and a change warns and does nothing. Moving a `<daw-track>` in the DOM reorders the track; an Undo moves no element. Fires `daw-track-update` `{ trackId, changed }` after a property changes. Loading does not clear the undo history.
516
516
 
517
517
  ### `<daw-clip>`
518
518
 
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost } from 'lit';
3
- import { AnnotationData, AnnotationShortcutMap, MidiNoteData, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, AudioClip, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
3
+ import { AnnotationData, AnnotationShortcutMap, MidiNoteData, PanLaw, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, AudioClip, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
4
4
  import WaveformData from 'waveform-data';
5
5
  import { Arrangement, TrackMixerValues, PlayoutAdapter, PlaylistEngine } from '@waveform-playlist/engine';
6
6
  import { MidiLoadOptions, MidiLoadResult } from '@dawcore/midi';
@@ -298,6 +298,18 @@ declare class DawTrackElement extends LitElement {
298
298
  set volume(value: number);
299
299
  get pan(): number;
300
300
  set pan(value: number);
301
+ /**
302
+ * The track's pan law (#684): `'mono'` (equal power, −3 dB per side at
303
+ * centre) or `'stereo'` (unity at centre, panning folds one channel into
304
+ * the other). `pan-law` declares the law the track enters with; without
305
+ * it the track's first decoded audio decides, and the track then keeps
306
+ * that law whatever clips follow. Live: reads the arrangement's value
307
+ * (`'auto'` while the track has no audio), and the editor writes no
308
+ * attribute. Setting `'mono'` or `'stereo'` on an entered track is a
309
+ * request (an undo step); `'auto'` there changes nothing.
310
+ */
311
+ get panLaw(): PanLaw;
312
+ set panLaw(value: PanLaw);
301
313
  /** The stored mute (a take's mute is not shown here). */
302
314
  get muted(): boolean;
303
315
  set muted(value: boolean);
@@ -608,6 +620,8 @@ interface TrackDescriptor {
608
620
  src: string;
609
621
  volume: number;
610
622
  pan: number;
623
+ /** The pan law: `'auto'` until the track's first decoded audio decides it (#684). */
624
+ panLaw: PanLaw;
611
625
  muted: boolean;
612
626
  soloed: boolean;
613
627
  /** What the track holds: audio clips or MIDI clips, never both (#756). */
@@ -619,11 +633,11 @@ interface TrackDescriptor {
619
633
  clips: ClipDescriptor[];
620
634
  }
621
635
  /** The mixer fields of a `TrackDescriptor`. */
622
- type TrackMixFields = 'volume' | 'pan' | 'muted' | 'soloed';
636
+ type TrackMixFields = 'volume' | 'pan' | 'muted' | 'soloed' | 'panLaw';
623
637
  /**
624
638
  * What `<daw-editor>` stores per track (internal, not exported from the
625
639
  * package): a `TrackDescriptor` without its mix. The mix is the arrangement's
626
- * (#843); `editor.tracks` fills the four fields in from it.
640
+ * (#843); `editor.tracks` fills the mix fields in from it.
627
641
  */
628
642
  type StoredTrackDescriptor = Omit<TrackDescriptor, TrackMixFields>;
629
643
  /**
@@ -716,6 +730,13 @@ interface TrackConfig {
716
730
  name?: string;
717
731
  volume?: number;
718
732
  pan?: number;
733
+ /**
734
+ * The pan law (#684): `'mono'` or `'stereo'`. In `addTrack` it is the law
735
+ * the track enters with (default: decided by its first decoded audio); in
736
+ * `updateTrack` it sets the law of an entered track. `'auto'` there, or a
737
+ * value that is not a law, changes nothing.
738
+ */
739
+ panLaw?: PanLaw;
719
740
  muted?: boolean;
720
741
  soloed?: boolean;
721
742
  /**
@@ -1282,8 +1303,16 @@ declare const TIME_DISPLAY_FORMATS: readonly TimeDisplayFormat[];
1282
1303
  declare function isTimeDisplayFormat(value: unknown): value is TimeDisplayFormat;
1283
1304
  /** Format seconds for display. Non-finite or negative input renders as 0. */
1284
1305
  declare function formatDisplayTime(seconds: number, format: TimeDisplayFormat): string;
1285
- /** Parse a formatted time string back to seconds. Lenient: returns 0 for empty/unparseable input; does not validate segment ranges. */
1286
- declare function parseDisplayTime(value: string, format: TimeDisplayFormat): number;
1306
+ /**
1307
+ * Parse text typed for a time back to seconds, or `null` when it is not a
1308
+ * time: empty text, a negative number, letters, a number followed by
1309
+ * anything else, a number too large to be finite, or a value that is not a
1310
+ * string. Spaces around the text are ignored. `seconds` reads a plain
1311
+ * number; the clock formats also read `1.5` (seconds) and `1:30` (minutes and
1312
+ * seconds) besides `01:02:03.500`. Segment ranges are checked: `00:75:00` is
1313
+ * not a time.
1314
+ */
1315
+ declare function parseDisplayTime(value: string, format: TimeDisplayFormat): number | null;
1287
1316
 
1288
1317
  interface DawSelectionDetail {
1289
1318
  start: number;
@@ -1601,6 +1630,8 @@ interface TrackLinkValues {
1601
1630
  pan: number;
1602
1631
  muted: boolean;
1603
1632
  soloed: boolean;
1633
+ /** `'auto'` until the track's first decoded audio decides it (#684). */
1634
+ panLaw: PanLaw;
1604
1635
  name: string;
1605
1636
  }
1606
1637
  /** The `<daw-clip>` properties read from the arrangement while live. */
@@ -1637,6 +1668,8 @@ interface ExportTrack {
1637
1668
  id: string;
1638
1669
  volume: number;
1639
1670
  pan: number;
1671
+ /** The track's pan law (the arrangement's mixer value). `'auto'` or none: from its clips. */
1672
+ panLaw?: PanLaw;
1640
1673
  muted: boolean;
1641
1674
  soloed: boolean;
1642
1675
  clips: ExportClip[];
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as lit from 'lit';
2
2
  import { LitElement, PropertyValues, ReactiveController, ReactiveControllerHost } from 'lit';
3
- import { AnnotationData, AnnotationShortcutMap, MidiNoteData, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, AudioClip, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
3
+ import { AnnotationData, AnnotationShortcutMap, MidiNoteData, PanLaw, TrackKind, RenderMode, SpectrogramConfig, Peaks, Bits, FadeType, PeakData, MeterEntry, AudioClip, SnapTo, ColorMapValue, ClipTrack, KeyBinding, KeyboardShortcut } from '@waveform-playlist/core';
4
4
  import WaveformData from 'waveform-data';
5
5
  import { Arrangement, TrackMixerValues, PlayoutAdapter, PlaylistEngine } from '@waveform-playlist/engine';
6
6
  import { MidiLoadOptions, MidiLoadResult } from '@dawcore/midi';
@@ -298,6 +298,18 @@ declare class DawTrackElement extends LitElement {
298
298
  set volume(value: number);
299
299
  get pan(): number;
300
300
  set pan(value: number);
301
+ /**
302
+ * The track's pan law (#684): `'mono'` (equal power, −3 dB per side at
303
+ * centre) or `'stereo'` (unity at centre, panning folds one channel into
304
+ * the other). `pan-law` declares the law the track enters with; without
305
+ * it the track's first decoded audio decides, and the track then keeps
306
+ * that law whatever clips follow. Live: reads the arrangement's value
307
+ * (`'auto'` while the track has no audio), and the editor writes no
308
+ * attribute. Setting `'mono'` or `'stereo'` on an entered track is a
309
+ * request (an undo step); `'auto'` there changes nothing.
310
+ */
311
+ get panLaw(): PanLaw;
312
+ set panLaw(value: PanLaw);
301
313
  /** The stored mute (a take's mute is not shown here). */
302
314
  get muted(): boolean;
303
315
  set muted(value: boolean);
@@ -608,6 +620,8 @@ interface TrackDescriptor {
608
620
  src: string;
609
621
  volume: number;
610
622
  pan: number;
623
+ /** The pan law: `'auto'` until the track's first decoded audio decides it (#684). */
624
+ panLaw: PanLaw;
611
625
  muted: boolean;
612
626
  soloed: boolean;
613
627
  /** What the track holds: audio clips or MIDI clips, never both (#756). */
@@ -619,11 +633,11 @@ interface TrackDescriptor {
619
633
  clips: ClipDescriptor[];
620
634
  }
621
635
  /** The mixer fields of a `TrackDescriptor`. */
622
- type TrackMixFields = 'volume' | 'pan' | 'muted' | 'soloed';
636
+ type TrackMixFields = 'volume' | 'pan' | 'muted' | 'soloed' | 'panLaw';
623
637
  /**
624
638
  * What `<daw-editor>` stores per track (internal, not exported from the
625
639
  * package): a `TrackDescriptor` without its mix. The mix is the arrangement's
626
- * (#843); `editor.tracks` fills the four fields in from it.
640
+ * (#843); `editor.tracks` fills the mix fields in from it.
627
641
  */
628
642
  type StoredTrackDescriptor = Omit<TrackDescriptor, TrackMixFields>;
629
643
  /**
@@ -716,6 +730,13 @@ interface TrackConfig {
716
730
  name?: string;
717
731
  volume?: number;
718
732
  pan?: number;
733
+ /**
734
+ * The pan law (#684): `'mono'` or `'stereo'`. In `addTrack` it is the law
735
+ * the track enters with (default: decided by its first decoded audio); in
736
+ * `updateTrack` it sets the law of an entered track. `'auto'` there, or a
737
+ * value that is not a law, changes nothing.
738
+ */
739
+ panLaw?: PanLaw;
719
740
  muted?: boolean;
720
741
  soloed?: boolean;
721
742
  /**
@@ -1282,8 +1303,16 @@ declare const TIME_DISPLAY_FORMATS: readonly TimeDisplayFormat[];
1282
1303
  declare function isTimeDisplayFormat(value: unknown): value is TimeDisplayFormat;
1283
1304
  /** Format seconds for display. Non-finite or negative input renders as 0. */
1284
1305
  declare function formatDisplayTime(seconds: number, format: TimeDisplayFormat): string;
1285
- /** Parse a formatted time string back to seconds. Lenient: returns 0 for empty/unparseable input; does not validate segment ranges. */
1286
- declare function parseDisplayTime(value: string, format: TimeDisplayFormat): number;
1306
+ /**
1307
+ * Parse text typed for a time back to seconds, or `null` when it is not a
1308
+ * time: empty text, a negative number, letters, a number followed by
1309
+ * anything else, a number too large to be finite, or a value that is not a
1310
+ * string. Spaces around the text are ignored. `seconds` reads a plain
1311
+ * number; the clock formats also read `1.5` (seconds) and `1:30` (minutes and
1312
+ * seconds) besides `01:02:03.500`. Segment ranges are checked: `00:75:00` is
1313
+ * not a time.
1314
+ */
1315
+ declare function parseDisplayTime(value: string, format: TimeDisplayFormat): number | null;
1287
1316
 
1288
1317
  interface DawSelectionDetail {
1289
1318
  start: number;
@@ -1601,6 +1630,8 @@ interface TrackLinkValues {
1601
1630
  pan: number;
1602
1631
  muted: boolean;
1603
1632
  soloed: boolean;
1633
+ /** `'auto'` until the track's first decoded audio decides it (#684). */
1634
+ panLaw: PanLaw;
1604
1635
  name: string;
1605
1636
  }
1606
1637
  /** The `<daw-clip>` properties read from the arrangement while live. */
@@ -1637,6 +1668,8 @@ interface ExportTrack {
1637
1668
  id: string;
1638
1669
  volume: number;
1639
1670
  pan: number;
1671
+ /** The track's pan law (the arrangement's mixer value). `'auto'` or none: from its clips. */
1672
+ panLaw?: PanLaw;
1640
1673
  muted: boolean;
1641
1674
  soloed: boolean;
1642
1675
  clips: ExportClip[];