import { MainWaveform } from '../MainWaveform' import { OverviewWaveform } from '../OverviewWaveform' import type { Deck } from './useDeck' /** The main view's zoom and raw/bars toggle — shared by every deck's lane * (so beats line up between them), owned by the deck area. */ export interface DeckView { secPerView: number setSecPerView: (sec: number) => void rawWave: boolean setRawWave: (raw: boolean) => void } /** The scrolling main waveform, in its well — or what stands in for it: no * track, a load error, the analysis running. */ export function DeckMainWave({ deck, view, empty = 'Load a track to prep it' }: { deck: Deck; view: DeckView; empty?: string }) { const { track, waveStatus, showWaves, cols, raw, current, duration, cueData, cuePoint, grid, activeMarkerIndex, gridMode, activeLoop, loopActive, loopRegion, loopInPoint, seekManual, onScratchStart, onScratchMove, onScratchEnd, lanes, toggleStem, } = deck if (!track) { return (
{empty}
) } if (waveStatus === 'error') { return (
Could not load audio — file may be missing or an unsupported format.
) } return (
{showWaves && cols ? ( ) : (
Analysing waveform…
)}
) } /** The whole-track overview, framing the main view's range. Nothing without a * playable track (the main well says why). */ export function DeckOverview({ deck, view }: { deck: Deck; view: DeckView }) { const { track, waveStatus, showWaves, cols, current, duration, cueData, cuePoint, activeLoop, seekManual } = deck if (!track || waveStatus === 'error') return null return (
{showWaves && cols && ( )}
) }