修复 bug
This commit is contained in:
@@ -4,6 +4,8 @@ export function CyanSlider({
|
||||
max,
|
||||
step = 1,
|
||||
onChange,
|
||||
onInteractionStart,
|
||||
onInteractionEnd,
|
||||
disabled = false,
|
||||
}: {
|
||||
value: number;
|
||||
@@ -11,6 +13,8 @@ export function CyanSlider({
|
||||
max: number;
|
||||
step?: number;
|
||||
onChange: (v: number) => void;
|
||||
onInteractionStart?: () => void;
|
||||
onInteractionEnd?: () => void;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
const fillPct = Math.max(
|
||||
@@ -39,6 +43,11 @@ export function CyanSlider({
|
||||
value={value}
|
||||
className="cyan-slider relative z-10"
|
||||
disabled={disabled}
|
||||
onPointerDown={() => onInteractionStart?.()}
|
||||
onFocus={() => onInteractionStart?.()}
|
||||
onPointerUp={() => onInteractionEnd?.()}
|
||||
onPointerCancel={() => onInteractionEnd?.()}
|
||||
onBlur={() => onInteractionEnd?.()}
|
||||
onChange={(e) => onChange(Number(e.target.value))}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -22,6 +22,9 @@ export const BAND_GAIN_MAX = 15;
|
||||
export const BAND_Q_MIN = 0.1;
|
||||
export const BAND_Q_MAX = 10;
|
||||
|
||||
/** Maximum headphone PEQ presets stored on device. */
|
||||
export const PEQ_PRESET_MAX = 50;
|
||||
|
||||
export type BandParamKind = "freq" | "gain" | "q";
|
||||
|
||||
/* ── Band param value box style ── */
|
||||
|
||||
@@ -158,6 +158,21 @@ export function freqLabel(freq: unknown) {
|
||||
return String(Math.round(hz));
|
||||
}
|
||||
|
||||
/** Dev: log decoded syncPeq JSON after EQ page fetches device PEQ state. */
|
||||
export function logEqSyncPeqDev(source: string, data: PeqState): void {
|
||||
if (!import.meta.env.DEV) return;
|
||||
console.log(`[EQ syncPeq] ${source}`, data);
|
||||
}
|
||||
|
||||
export async function fetchEqSyncPeq(
|
||||
api: { getPeqState: () => Promise<PeqState> },
|
||||
source: string,
|
||||
): Promise<PeqState> {
|
||||
const data = await api.getPeqState();
|
||||
logEqSyncPeqDev(source, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
/* ── Build PEQ catalog sync key ── */
|
||||
export function buildPeqCatalogSyncKey(
|
||||
remote: Pick<PeqState, "peq" | "peqSelect"> | null | undefined,
|
||||
|
||||
Reference in New Issue
Block a user