Implemented basic track analysis

This commit is contained in:
Ben committed 2026-07-08 13:48:21 +02:00
1 parent 986a2cee54
commit c7169c8bbe
6 files changed
+83 -1

No files matched your search

+17
View File
@@ -13,6 +13,9 @@ interface Props {
onReset: () => void
onToggleLock: () => void
onDeleteGrid: () => void
/** Detect BPM + first beat and build the grid (sets hotcue 1 + anchor). */
onAnalyze: () => void
analyzing: boolean
}
const BTN =
@@ -39,6 +42,8 @@ export function GridControls({
onReset,
onToggleLock,
onDeleteGrid,
onAnalyze,
analyzing,
}: Props) {
const [editing, setEditing] = useState(false)
const [val, setVal] = useState('')
@@ -194,6 +199,18 @@ export function GridControls({
🗑 Grid
</button>
</div>
{/* analyze: detect BPM + first beat, set hotcue 1 + grid anchor */}
<div className="flex gap-1">
<button
className={BTN}
onClick={onAnalyze}
disabled={analyzing}
title="Detect BPM and first beat, then set the grid + hotcue 1 (fix octave with ÷2 / ×2)"
>
{analyzing ? '…' : 'Analyze'}
</button>
</div>
</div>
)
}