From 0e972ba96ede54d87389d1326f36d8a949eef771 Mon Sep 17 00:00:00 2001 From: Wiii <156531153+meiiie@users.noreply.github.com> Date: Mon, 27 Apr 2026 00:16:08 +0700 Subject: [PATCH] feat(editor): add audio region volume control Expose the existing added-audio volume field in the selected-audio settings panel and keep timeline row hit targets selectable. --- src/components/video-editor/SettingsPanel.tsx | 49 +++++++++++++++++-- src/components/video-editor/VideoEditor.tsx | 28 +++++++++++ src/components/video-editor/timeline/Row.tsx | 6 ++- 3 files changed, 77 insertions(+), 6 deletions(-) diff --git a/src/components/video-editor/SettingsPanel.tsx b/src/components/video-editor/SettingsPanel.tsx index 5d016b23..aa7d2bfd 100644 --- a/src/components/video-editor/SettingsPanel.tsx +++ b/src/components/video-editor/SettingsPanel.tsx @@ -12,6 +12,7 @@ import { } from "@/components/ui/select"; import { Switch } from "@/components/ui/switch"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; +import { useTheme } from "@/contexts/ThemeContext"; import { getAssetPath, getRenderableAssetUrl, getWallpaperThumbnailUrl } from "@/lib/assetPath"; import type { ExtensionSettingField } from "@/lib/extensions"; import { extensionHost, type FrameInstance } from "@/lib/extensions"; @@ -27,7 +28,6 @@ import minimalCursorUrl from "../../../Minimal Cursor.svg"; import { useI18n, useScopedT } from "../../contexts/I18nContext"; import type { AppLocale } from "../../i18n/config"; import { SUPPORTED_LOCALES } from "../../i18n/config"; -import { useTheme } from "@/contexts/ThemeContext"; import { AnnotationSettingsPanel } from "./AnnotationSettingsPanel"; import { loadEditorPreferences, saveEditorPreferences } from "./editorPreferences"; import { SliderControl } from "./SliderControl"; @@ -50,9 +50,6 @@ import type { ZoomMode, ZoomTransitionEasing, } from "./types"; -import { - isZeroPadding, -} from "./videoPlayback/layoutUtils"; import { DEFAULT_AUTO_CAPTION_SETTINGS, DEFAULT_CROP_REGION, @@ -76,6 +73,7 @@ import { SPEED_OPTIONS, } from "./types"; import { fromCursorSwaySliderValue, toCursorSwaySliderValue } from "./videoPlayback/cursorSway"; +import { isZeroPadding } from "./videoPlayback/layoutUtils"; import { cursorSetAssets, getCursorStyleSizeMultiplier, @@ -348,6 +346,10 @@ interface SettingsPanelProps { onClipSpeedChange?: (speed: number) => void; onClipMutedChange?: (muted: boolean) => void; onClipDelete?: (id: string) => void; + selectedAudioId?: string | null; + selectedAudioVolume?: number | null; + onAudioVolumeChange?: (volume: number) => void; + onAudioDelete?: (id: string) => void; shadowIntensity?: number; onShadowChange?: (intensity: number) => void; backgroundBlur?: number; @@ -721,6 +723,10 @@ export function SettingsPanel({ onClipSpeedChange, onClipMutedChange, onClipDelete, + selectedAudioId, + selectedAudioVolume, + onAudioVolumeChange, + onAudioDelete, shadowIntensity = 0.67, onShadowChange, backgroundBlur = 0, @@ -3031,7 +3037,7 @@ export function SettingsPanel({