From a816cc503f692f43b966b6f166691a18fc3fe76f Mon Sep 17 00:00:00 2001 From: DevloperAmanSingh Date: Thu, 26 Jun 2025 23:46:43 +0530 Subject: [PATCH] feat: add detailed comments for clip splitting and audio separation methods in timeline store --- apps/web/src/stores/timeline-store.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts index a6da4e2..f789548 100644 --- a/apps/web/src/stores/timeline-store.ts +++ b/apps/web/src/stores/timeline-store.ts @@ -74,7 +74,7 @@ interface TimelineStore { ) => void; toggleTrackMute: (trackId: string) => void; - // Split operations + // Split operations for clips splitClip: ( trackId: string, clipId: string, @@ -339,6 +339,7 @@ export const useTimelineStore = create((set, get) => ({ return secondClipId; }, + // Split clip and keep only the left portion splitAndKeepLeft: (trackId, clipId, splitTime) => { const { tracks } = get(); const track = tracks.find((t) => t.id === trackId); @@ -378,6 +379,7 @@ export const useTimelineStore = create((set, get) => ({ })); }, + // Split clip and keep only the right portion splitAndKeepRight: (trackId, clipId, splitTime) => { const { tracks } = get(); const track = tracks.find((t) => t.id === trackId); @@ -416,6 +418,7 @@ export const useTimelineStore = create((set, get) => ({ })); }, + // Extract audio from video clip to an audio track separateAudio: (trackId, clipId) => { const { tracks } = get(); const track = tracks.find((t) => t.id === trackId); @@ -425,6 +428,7 @@ export const useTimelineStore = create((set, get) => ({ get().pushHistory(); + // Find or create an audio track let audioTrackId = tracks.find((t) => t.type === "audio")?.id; if (!audioTrackId) {