Fixed auto hotcue overlap and analysis locked hotcue

This commit is contained in:
patben8 committed 2026-09-24 14:05:35 +02:00
1 parent 46ce3db916
commit 6c123e2597
14 files changed
+132 -100

No files matched your search

+2 -1
View File
@@ -232,7 +232,8 @@ export function AutoCueDialog({ track, slotCount, slotLabel, existing, onClose,
<p className="mt-3 text-[11px] leading-relaxed text-faint">
Events are found on the beatgrid, counting bar 1 from its first marker — if drops land a
bar or two off, move the grid marker onto the first downbeat. Occupied slots are kept
unless you tick Replace. Your slot setup is remembered for the next track.
unless you tick Replace. If two slots land on the same beat, only the lower one gets
the cue. Your slot setup is remembered for the next track.
</p>
</div>
+2 -5
View File
@@ -13,7 +13,6 @@ interface Props {
}
const READONLY_LABELS: Record<string, string> = {
beatgrid_companion: 'Beatgrid marker — managed by the grid controls',
platform_managed: 'Managed by the DJ app — not editable here',
}
@@ -25,10 +24,8 @@ const READONLY_LABELS: Record<string, string> = {
* can implement momentary "cue preview" (play while held). Press creates when
* empty and jumps/triggers when assigned; release ends any preview.
*
* A slot may be held by a grid marker's companion cue (Traktor writes one beside
* most of its own markers). Those belong to the beatgrid, so they are shown with
* the marker colour and a ⊞ instead of a number, and pressing one only seeks —
* the backend refuses hotcue edits on them, and showing that up front is better
* A cue the adapter will not edit (`editable: false`) shows a lock and only
* seeks; the backend would refuse the edit, and showing that up front is better
* than surfacing the refusal as an error.
*/
export function HotcueBar({
+5 -7
View File
@@ -648,12 +648,6 @@ export function PrepStrip({ track, playRequest = 0, onError, onNotify, fromDevic
const onSlotPress = async (slot: number) => {
if (!track) return
const cue = hotcueAt(slot)
// A grid marker's companion cue holds this slot. It belongs to the beatgrid,
// so pressing it only seeks — never create, retype, select or preview.
if (cue?.grid_marker != null) {
seekManual(cue.start)
return
}
if (!cue) {
if (refuseCueEdit()) return
try {
@@ -710,8 +704,12 @@ export function PrepStrip({ track, playRequest = 0, onError, onNotify, fromDevic
const placed = by('placed').length
const missing = [...by('not_found'), ...by('out_of_range')].map((o) => eventLabel(o.event))
const kept = by('occupied').length + by('protected').length
const dupes = by('duplicate').map(
(o) => `${slotLabel(o.slot)} (same beat as ${slotLabel(o.duplicate_of ?? o.slot)})`,
)
const parts = [`Placed ${placed} hotcue${placed === 1 ? '' : 's'}`]
if (missing.length) parts.push(`not in this track: ${missing.join(', ')}`)
if (dupes.length) parts.push(`skipped ${dupes.join(', ')}`)
if (kept) parts.push(`${kept} occupied slot${kept === 1 ? '' : 's'} kept`)
onNotify?.(placed ? 'success' : 'error', parts.join(' · '))
}
@@ -740,7 +738,7 @@ export function PrepStrip({ track, playRequest = 0, onError, onNotify, fromDevic
const deleteHotcueSlot = async (slot: number) => {
const existing = hotcueAt(slot)
if (!track || !existing) return // nothing to remove in an empty slot
if (existing.grid_marker != null) return // beatgrid-owned: delete the marker instead
if (!existing.editable) return // the adapter would refuse it
if (refuseCueEdit()) return
try {
applyCueEdit(await api.deleteCue(track.id, slot))