effect 响度阈值最低支持 -40
This commit is contained in:
@@ -4,6 +4,7 @@ import { useStrokeDrawAnimation } from "@/lib/useStrokeDrawAnimation";
|
||||
import { buildPeqSvgCurveData, sampleCombinedPeqMagnitudeDb } from "@/lib/peqAudio";
|
||||
import { eqInterp } from "../eqFormatters";
|
||||
import type { EqBand, PeqEqUi } from "../types";
|
||||
import { PeqUndoButton } from "./PeqUndoButton";
|
||||
|
||||
function LegendCurveIndicator({
|
||||
loading,
|
||||
@@ -32,6 +33,8 @@ export type FreqChartProps = {
|
||||
abMode: "A" | "B";
|
||||
onAbToggle: (m: "A" | "B") => void;
|
||||
onCopyAndSwitchTo: (to: "A" | "B") => void;
|
||||
canUndo: boolean;
|
||||
onUndo: () => void;
|
||||
onApplyB: () => void;
|
||||
onSaveB: () => void;
|
||||
onBandDrag: (idx: number, patch: Partial<{ freq: number; gain: number }>) => void;
|
||||
@@ -49,6 +52,8 @@ export function FreqChart({
|
||||
abMode,
|
||||
onAbToggle,
|
||||
onCopyAndSwitchTo,
|
||||
canUndo,
|
||||
onUndo,
|
||||
onApplyB,
|
||||
onSaveB,
|
||||
onBandDrag,
|
||||
@@ -307,6 +312,11 @@ export function FreqChart({
|
||||
>
|
||||
{copyButtonText}
|
||||
</button>
|
||||
<PeqUndoButton
|
||||
disabled={!canUndo}
|
||||
label={eqUi.undo ?? "Undo"}
|
||||
onClick={onUndo}
|
||||
/>
|
||||
</div>
|
||||
<div className="ml-auto flex shrink-0 items-center gap-2">
|
||||
<button
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { Undo2 } from "lucide-react";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
type PeqUndoButtonProps = {
|
||||
@@ -8,6 +7,11 @@ type PeqUndoButtonProps = {
|
||||
className?: string;
|
||||
};
|
||||
|
||||
const pillStyle = {
|
||||
background: "rgba(44,44,46,0.7)",
|
||||
border: "1px solid rgba(255,255,255,0.08)",
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* EQ page undo control — disabled when the undo stack is empty.
|
||||
*/
|
||||
@@ -25,22 +29,15 @@ export function PeqUndoButton({
|
||||
title={label}
|
||||
onClick={onClick}
|
||||
className={cn(
|
||||
"w-9 h-9 rounded-full flex items-center justify-center transition-colors active:scale-95",
|
||||
"px-3 py-1 rounded-[8px] text-[11px] transition-colors",
|
||||
disabled
|
||||
? "text-white/25 cursor-not-allowed"
|
||||
: "text-white/70 active:text-white",
|
||||
? "text-white/25 cursor-not-allowed opacity-50"
|
||||
: "text-white/50 active:text-white",
|
||||
className,
|
||||
)}
|
||||
style={{
|
||||
background: disabled
|
||||
? "rgba(44,44,46,0.45)"
|
||||
: "rgba(44,44,46,0.8)",
|
||||
border: disabled
|
||||
? "1px solid rgba(255,255,255,0.06)"
|
||||
: "1px solid rgba(255,255,255,0.1)",
|
||||
}}
|
||||
style={pillStyle}
|
||||
>
|
||||
<Undo2 size={18} />
|
||||
{label}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user