新增 undo 功能
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
} from "@/lib/peqAudio";
|
||||
import type { PeqEqUi } from "../constants";
|
||||
import { eqInterp } from "../utils";
|
||||
import { PeqUndoButton } from "./PeqUndoButton";
|
||||
|
||||
/* ── Legend indicator ── */
|
||||
function LegendCurveIndicator({
|
||||
@@ -37,6 +38,8 @@ export function FreqChart({
|
||||
abMode,
|
||||
onAbToggle,
|
||||
onCopyAndSwitchTo,
|
||||
canUndo,
|
||||
onUndo,
|
||||
onApplyB,
|
||||
onSaveB,
|
||||
onBandDrag,
|
||||
@@ -52,6 +55,8 @@ export function FreqChart({
|
||||
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;
|
||||
@@ -295,6 +300,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
|
||||
|
||||
Reference in New Issue
Block a user