import type { JSX } from "@char/aftercare/jsx-runtime"; import { audition, play, playhead, playing } from "../audio/transport.ts"; import { sounding, type VoicedChord, voiceTrack } from "../project/harmony.ts"; import { type ChordTrack, findTrack, moveTrack, newId, NOTE_VEL, type NoteTrack, placeChord, type Project, projectEnd, projectKey, type Track, } from "../project/model.ts"; import { beginGesture, commit, project } from "../project/store.ts"; import { origin, prettyRoman } from "../theory/analysis.ts"; import { chordSymbol } from "../theory/chord.ts"; import { type Key, MODES } from "../theory/key.ts"; import { formatNote, mod, pcOf, spellPc } from "../theory/pitch.ts"; import { addTrack, createChordWithNote, removeTrack, toggleChordNote } from "./actions.ts"; import { ChordEditor } from "./chord-editor.tsx"; import { originClass } from "./origin.ts"; import { drag, px, setChildren, watch } from "./dom.tsx"; import { activeTrackId, chordEdit, cursor, HEADER_W, laneHeight, pxPerBeat, ROW_H, rollHeight, selectedIds, selection, STRIP_H, } from "./state.ts"; let lastNoteLength = 1; /** where a shift-click range of chords starts from */ let chordAnchor: string | undefined; export function Timeline(): JSX.Element { const rows = (
) as HTMLDivElement; const cursorLine = () as HTMLDivElement; const playLine = () as HTMLDivElement; const content = (