mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Added setting for deck focus switching
This commit is contained in:
1 parent
4799eaef17
commit
2a40106ea5
4 files changed
+32
-29
No files matched your search
@@ -1174,7 +1174,7 @@ Two independent apps that talk over HTTP:
|
|||||||
/ Try again (`backend_restart`). The shell has no timeout of its own. Before
|
/ Try again (`backend_restart`). The shell has no timeout of its own. Before
|
||||||
ready it answers quit requests itself — nothing can be unsaved — and stops
|
ready it answers quit requests itself — nothing can be unsaved — and stops
|
||||||
at ready so it never races `QuitGuard`), `SaveBar` (+ "Discard changes…" when
|
at ready so it never races `QuitGuard`), `SaveBar` (+ "Discard changes…" when
|
||||||
dirty, and the settings gear beside it, whose menu (or `?` anywhere) opens `ShortcutsDialog` — a KEYBOARD MAP (decided 2026-10-15): keys lit in the colour of what they do, a caption explaining the key pointed at or pressed (pressing explains, it never acts: a capture-phase listener keeps the deck's and table's keys from firing), holding or picking ⇧ / Cmd-Ctrl relights it with that layer, mouse gestures listed beneath. It shrinks to fit the dialog and drops the words on the keys when too small. Its content is `lib/shortcuts.ts`, written out BY HAND, so a new or changed shortcut in `lib/deckKeys.ts` / `TrackTable` must be added there too — and `AppSettings` ("Konduktor Settings…": app-level prefs, each with its default in `APP_SETTING_DEFAULTS` and read through `useAppSetting`; today `expandPlaylistFolders` and `exportRootFolder`, both default off — the latter read by the backend at `run_export` and passed down as `ExportPayload.root_folder` — and `timeReadoutDecimals` (0–3, default 1: the deck's ELAPSED / REMAIN, truncated, never rounded)) — and its own panel, `PerformanceSettings` ("Performance mode…", decided 2026-11-03), whose values sit in the same `APP_SETTING_DEFAULTS`: `perfStems` (default on: a stem track loaded INTO performance mode plays its stems, else its mix; read at load, never reloads a deck), `keylockDefault` (on), `eqKill` (off = -26 dB), `crossfaderSharpness` (0..1, 0 = smooth, default 0.5: a slider beside `CrossfaderCurveGraph`, which draws both channels' curves and where the crossfader is; dragging it moves the mixer at once and saves through the debounced prefs writer), and the Filter FX: `fxFilterRange` (the Filter alone) and `fxEffectRange` (under an effect), each full / musical / gentle, `fxFilterResonance`, `fxReverbSize`, `fxDelayBeats`, `fxCrusherDrive`, `fxFlangerBeats` (the mixer's per-channel PRM knob was removed). PrepStrip copies them into `mixerState`. The Sidebar holds folder open state as per-id overrides of that setting, reset on a new library or a change of the setting, and carried to the new ids when a rename/move changes a folder's path id)), `Toolbar` (search/filters; columns are chosen by right-clicking the table header),
|
dirty, and the settings gear beside it, whose menu (or `?` anywhere) opens `ShortcutsDialog` — a KEYBOARD MAP (decided 2026-10-15): keys lit in the colour of what they do, a caption explaining the key pointed at or pressed (pressing explains, it never acts: a capture-phase listener keeps the deck's and table's keys from firing), holding or picking ⇧ / Cmd-Ctrl relights it with that layer, mouse gestures listed beneath. It shrinks to fit the dialog and drops the words on the keys when too small. Its content is `lib/shortcuts.ts`, written out BY HAND, so a new or changed shortcut in `lib/deckKeys.ts` / `TrackTable` must be added there too — and `AppSettings` ("Konduktor Settings…": app-level prefs, each with its default in `APP_SETTING_DEFAULTS` and read through `useAppSetting`; today `expandPlaylistFolders` and `exportRootFolder`, both default off — the latter read by the backend at `run_export` and passed down as `ExportPayload.root_folder` — and `timeReadoutDecimals` (0–3, default 1: the deck's ELAPSED / REMAIN, truncated, never rounded)) — and its own panel, `PerformanceSettings` ("Performance mode…", decided 2026-11-03), whose values sit in the same `APP_SETTING_DEFAULTS`: `perfStems` (default on: a stem track loaded INTO performance mode plays its stems, else its mix; read at load, never reloads a deck), `keylockDefault` (on), `autoFocusDeck` (on: any press on a deck focuses it; off: only its A/B badge, a button), `eqKill` (off = -26 dB), `crossfaderSharpness` (0..1, 0 = smooth, default 0.5: a slider beside `CrossfaderCurveGraph`, which draws both channels' curves and where the crossfader is; dragging it moves the mixer at once and saves through the debounced prefs writer), and the Filter FX: `fxFilterRange` (the Filter alone) and `fxEffectRange` (under an effect), each full / musical / gentle, `fxFilterResonance`, `fxReverbSize`, `fxDelayBeats`, `fxCrusherDrive`, `fxFlangerBeats` (the mixer's per-channel PRM knob was removed). PrepStrip copies them into `mixerState`. The Sidebar holds folder open state as per-id overrides of that setting, reset on a new library or a change of the setting, and carried to the new ids when a rename/move changes a folder's path id)), `Toolbar` (search/filters; columns are chosen by right-clicking the table header),
|
||||||
`TrackTable` (**the one track list** — All Tracks, playlists, exports and
|
`TrackTable` (**the one track list** — All Tracks, playlists, exports and
|
||||||
devices. TanStack Table + **virtualized** grid; per-row play button,
|
devices. TanStack Table + **virtualized** grid; per-row play button,
|
||||||
configurable columns, header sorting, inline double-click editing, and
|
configurable columns, header sorting, inline double-click editing, and
|
||||||
@@ -1391,7 +1391,8 @@ Two independent apps that talk over HTTP:
|
|||||||
the app: 175 synced to 125 lands at 125.00 within 0.005 beat and follows
|
the app: 175 synced to 125 lands at 125.00 within 0.005 beat and follows
|
||||||
the master's pitch. Leaving performance mode releases SYNC. App holds `decks: {A, B}`
|
the master's pitch. Leaving performance mode releases SYNC. App holds `decks: {A, B}`
|
||||||
(`DeckSlot`: track, origin, playRequest, cuesRefresh), `focusedDeck` and
|
(`DeckSlot`: track, origin, playRequest, cuesRefresh), `focusedDeck` and
|
||||||
`performance`; a load, Enter, a row's play button and a drop on the strip
|
`performance`; the focus moves on any press on a deck (or only its A/B
|
||||||
|
badge, with the `autoFocusDeck` setting off); a load, Enter, a row's play button and a drop on the strip
|
||||||
go to the FOCUSED deck (A outside the mode), "Load to Deck A/B" to either,
|
go to the FOCUSED deck (A outside the mode), "Load to Deck A/B" to either,
|
||||||
and the table lights the focused deck's row. Entering with B empty focuses
|
and the table lights the focused deck's row. Entering with B empty focuses
|
||||||
B. B's `useDeck` stays MOUNTED while hidden — leaving pauses it, coming
|
B. B's `useDeck` stays MOUNTED while hidden — leaving pauses it, coming
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ export const APP_SETTING_DEFAULTS = {
|
|||||||
perfStems: true,
|
perfStems: true,
|
||||||
/** A deck's keylock starts on. */
|
/** A deck's keylock starts on. */
|
||||||
keylockDefault: true,
|
keylockDefault: true,
|
||||||
|
/** Any press on a deck focuses it (else only its A/B badge). */
|
||||||
|
autoFocusDeck: true,
|
||||||
/** EQ full left kills the band (else -26 dB, DJM-style). */
|
/** EQ full left kills the band (else -26 dB, DJM-style). */
|
||||||
eqKill: false,
|
eqKill: false,
|
||||||
/** The crossfader curve: 0 smooth (constant power) .. 1 sharp (a cut).
|
/** The crossfader curve: 0 smooth (constant power) .. 1 sharp (a cut).
|
||||||
@@ -183,14 +185,14 @@ export function AppSettings({ onClose }: { onClose: () => void }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function Check({ checked, onChange, title, text }: {
|
export function Check({ checked, onChange, title, text }: {
|
||||||
checked: boolean; onChange: (v: boolean) => void; title: string; text: string
|
checked: boolean; onChange: (v: boolean) => void; title: string; text?: string
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<label className="flex cursor-pointer items-start gap-2.5">
|
<label className="flex cursor-pointer items-start gap-2.5">
|
||||||
<input type="checkbox" className="mt-0.5" checked={checked} onChange={(e) => onChange(e.target.checked)} />
|
<input type="checkbox" className="mt-0.5" checked={checked} onChange={(e) => onChange(e.target.checked)} />
|
||||||
<span className="min-w-0">
|
<span className="min-w-0">
|
||||||
<span className="block text-sm text-text">{title}</span>
|
<span className="block text-sm text-text">{title}</span>
|
||||||
<span className="block text-xs text-faint">{text}</span>
|
{text && <span className="block text-xs text-faint">{text}</span>}
|
||||||
</span>
|
</span>
|
||||||
</label>
|
</label>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export function PerformanceSettings({ onClose }: { onClose: () => void }) {
|
|||||||
const writePrefs = usePrefsWriter()
|
const writePrefs = usePrefsWriter()
|
||||||
const perfStems = useAppSetting('perfStems')
|
const perfStems = useAppSetting('perfStems')
|
||||||
const keylockDefault = useAppSetting('keylockDefault')
|
const keylockDefault = useAppSetting('keylockDefault')
|
||||||
|
const autoFocusDeck = useAppSetting('autoFocusDeck')
|
||||||
const eqKill = useAppSetting('eqKill')
|
const eqKill = useAppSetting('eqKill')
|
||||||
const sharpnessSetting = useAppSetting('crossfaderSharpness')
|
const sharpnessSetting = useAppSetting('crossfaderSharpness')
|
||||||
const fxFilterRange = useAppSetting('fxFilterRange')
|
const fxFilterRange = useAppSetting('fxFilterRange')
|
||||||
@@ -81,22 +82,24 @@ export function PerformanceSettings({ onClose }: { onClose: () => void }) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="max-h-[70vh] space-y-4 overflow-y-auto px-5 py-4 text-sm">
|
<div className="max-h-[70vh] space-y-4 overflow-y-auto px-5 py-4 text-sm">
|
||||||
<p className="text-xs text-faint">
|
|
||||||
The second deck and the mixer (P, or the decks button in the deck's header).
|
|
||||||
</p>
|
|
||||||
<section className="space-y-2">
|
<section className="space-y-2">
|
||||||
<h3 className={section}>Decks</h3>
|
<h3 className={section}>Decks</h3>
|
||||||
<Check
|
<Check
|
||||||
checked={perfStems}
|
checked={perfStems}
|
||||||
onChange={(v) => void set({ perfStems: v })}
|
onChange={(v) => void set({ perfStems: v })}
|
||||||
title="Load stem tracks as stems"
|
title="Load stem tracks as stems"
|
||||||
text="A stem track loaded into a deck in performance mode plays its four stems (mute and solo work). Off, it plays its mix: lighter on an older computer, since keylock then stretches one stream instead of four. Applies to the next track loaded."
|
text="Off plays the mix: lighter on older computers."
|
||||||
/>
|
/>
|
||||||
<Check
|
<Check
|
||||||
checked={keylockDefault}
|
checked={keylockDefault}
|
||||||
onChange={(v) => void set({ keylockDefault: v })}
|
onChange={(v) => void set({ keylockDefault: v })}
|
||||||
title="Keylock on"
|
title="Keylock on by default"
|
||||||
text="Each deck starts with keylock on: a tempo change keeps the pitch. Each deck's KEY button still switches it."
|
/>
|
||||||
|
<Check
|
||||||
|
checked={autoFocusDeck}
|
||||||
|
onChange={(v) => void set({ autoFocusDeck: v })}
|
||||||
|
title="Click a deck to focus it"
|
||||||
|
text="Off: only its A/B badge does."
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
<section className="space-y-2">
|
<section className="space-y-2">
|
||||||
@@ -139,21 +142,11 @@ export function PerformanceSettings({ onClose }: { onClose: () => void }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span className="block text-xs text-faint">
|
|
||||||
Smooth blends: each channel fades across the whole travel, both at −3 dB in the middle.
|
|
||||||
Sharper keeps both at full level across a widening middle and fades only near the ends —
|
|
||||||
at full, a cut over the last few percent, for scratching.
|
|
||||||
</span>
|
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<section className="space-y-2">
|
<section className="space-y-2">
|
||||||
<h3 className={section}>Filter FX</h3>
|
<h3 className={section}>Filter FX</h3>
|
||||||
<span className="block text-xs text-faint">
|
<span className="block text-xs text-faint">Effects grow as the filter opens.</span>
|
||||||
Each channel's FILTER knob filters — low-pass to the left, high-pass to the right — and
|
|
||||||
the effect picked above it rides along, growing as the knob turns: the reverb blends into
|
|
||||||
one three times as long, the delay gets longer and the flanger faster (each up to ×8)
|
|
||||||
from the settings below. These apply to both channels.
|
|
||||||
</span>
|
|
||||||
<Choice
|
<Choice
|
||||||
title="Filter range (Filter alone)"
|
title="Filter range (Filter alone)"
|
||||||
value={fxFilterRange}
|
value={fxFilterRange}
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ export function PrepStrip({
|
|||||||
// Performance-mode settings (Settings ▸ Performance mode…).
|
// Performance-mode settings (Settings ▸ Performance mode…).
|
||||||
const perfStems = useAppSetting('perfStems')
|
const perfStems = useAppSetting('perfStems')
|
||||||
const keylockDefault = useAppSetting('keylockDefault')
|
const keylockDefault = useAppSetting('keylockDefault')
|
||||||
|
const autoFocus = useAppSetting('autoFocusDeck')
|
||||||
const eqKill = useAppSetting('eqKill')
|
const eqKill = useAppSetting('eqKill')
|
||||||
const sharpness = useAppSetting('crossfaderSharpness')
|
const sharpness = useAppSetting('crossfaderSharpness')
|
||||||
const filterRange = useAppSetting('fxFilterRange')
|
const filterRange = useAppSetting('fxFilterRange')
|
||||||
@@ -300,22 +301,27 @@ export function PrepStrip({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Any press on a deck focuses it — unless the `autoFocusDeck` setting is
|
||||||
|
// off, when only its letter badge does (decided 2026-11-03).
|
||||||
|
const clickFocus = autoFocus ? onFocus : undefined
|
||||||
const pane = (id: DeckId, children: ReactNode, className = 'min-w-0 flex-1') => (
|
const pane = (id: DeckId, children: ReactNode, className = 'min-w-0 flex-1') => (
|
||||||
<div className={className} onPointerDownCapture={() => onFocus(id)}>
|
<div className={className} onPointerDownCapture={clickFocus && (() => clickFocus(id))}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
const badge = (id: DeckId) => (
|
const badge = (id: DeckId) => (
|
||||||
<span
|
<button
|
||||||
|
type="button"
|
||||||
|
onPointerDown={() => onFocus(id)}
|
||||||
className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg font-mono text-[13px] font-semibold transition-colors ${
|
className={`flex h-7 w-7 shrink-0 items-center justify-center rounded-lg font-mono text-[13px] font-semibold transition-colors ${
|
||||||
id === focused
|
id === focused
|
||||||
? 'bg-accent text-ink-950 shadow-[0_0_14px_-2px_var(--color-accent)]'
|
? 'bg-accent text-ink-950 shadow-[0_0_14px_-2px_var(--color-accent)]'
|
||||||
: 'bg-ink-800 text-muted'
|
: 'bg-ink-800 text-muted hover:text-text'
|
||||||
}`}
|
}`}
|
||||||
title={id === focused ? `Deck ${id} — the keys act on it` : `Deck ${id} — click it to focus (Alt/Option + key acts on it)`}
|
title={id === focused ? `Deck ${id}: the keys act on it` : `Deck ${id}: click to focus`}
|
||||||
>
|
>
|
||||||
{id}
|
{id}
|
||||||
</span>
|
</button>
|
||||||
)
|
)
|
||||||
return (
|
return (
|
||||||
<div className="glass flex h-[32rem] shrink-0 flex-col gap-2 p-4">
|
<div className="glass flex h-[32rem] shrink-0 flex-col gap-2 p-4">
|
||||||
@@ -326,7 +332,7 @@ export function PrepStrip({
|
|||||||
{pane('B', <DeckHeader deck={b} compact badge={badge('B')} />)}
|
{pane('B', <DeckHeader deck={b} compact badge={badge('B')} />)}
|
||||||
</div>
|
</div>
|
||||||
{DECK_IDS.map((id) => (
|
{DECK_IDS.map((id) => (
|
||||||
<DeckLane key={id} id={id} deck={deckOf(id)} view={view} focused={id === focused} drop={drop} onFocus={onFocus} />
|
<DeckLane key={id} id={id} deck={deckOf(id)} view={view} focused={id === focused} drop={drop} onFocus={clickFocus} />
|
||||||
))}
|
))}
|
||||||
<div className="flex shrink-0 gap-3">
|
<div className="flex shrink-0 gap-3">
|
||||||
{pane(
|
{pane(
|
||||||
@@ -392,7 +398,8 @@ function DeckLane({
|
|||||||
view: DeckView
|
view: DeckView
|
||||||
focused: boolean
|
focused: boolean
|
||||||
drop: DeckDrop
|
drop: DeckDrop
|
||||||
onFocus: (id: DeckId) => void
|
/** Focus on any press (the `autoFocusDeck` setting); undefined = off. */
|
||||||
|
onFocus?: (id: DeckId) => void
|
||||||
}) {
|
}) {
|
||||||
const [ref, over] = useDropTarget<true>({
|
const [ref, over] = useDropTarget<true>({
|
||||||
hint: drop.hint,
|
hint: drop.hint,
|
||||||
@@ -402,7 +409,7 @@ function DeckLane({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={ref}
|
ref={ref}
|
||||||
onPointerDownCapture={() => onFocus(id)}
|
onPointerDownCapture={onFocus && (() => onFocus(id))}
|
||||||
className={`relative flex min-h-0 flex-1 rounded-2xl transition-shadow ${
|
className={`relative flex min-h-0 flex-1 rounded-2xl transition-shadow ${
|
||||||
over ? 'ring-2 ring-accent' : focused ? 'ring-1 ring-accent/45' : ''
|
over ? 'ring-2 ring-accent' : focused ? 'ring-1 ring-accent/45' : ''
|
||||||
}`}
|
}`}
|
||||||
|
|||||||
Reference in new issue
Block a user