The open-source CapCut alternative
feat: add detailed comments for clip splitting and audio separation methods in timeline store
DevloperAmanSingha816cc503f69
diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.tsindex a6da4e25..f789548f 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 clipssplitClip: (trackId: string,clipId: string,@@ -339,6 +339,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => ({return secondClipId;},+ // Split clip and keep only the left portionsplitAndKeepLeft: (trackId, clipId, splitTime) => {const { tracks } = get();const track = tracks.find((t) => t.id === trackId);@@ -378,6 +379,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => ({}));},+ // Split clip and keep only the right portionsplitAndKeepRight: (trackId, clipId, splitTime) => {const { tracks } = get();const track = tracks.find((t) => t.id === trackId);@@ -416,6 +418,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => ({}));},+ // Extract audio from video clip to an audio trackseparateAudio: (trackId, clipId) => {const { tracks } = get();const track = tracks.find((t) => t.id === trackId);@@ -425,6 +428,7 @@ export const useTimelineStore = create<TimelineStore>((set, get) => ({get().pushHistory();+ // Find or create an audio tracklet audioTrackId = tracks.find((t) => t.type === "audio")?.id;if (!audioTrackId) {