summaryrefslogtreecommitdiff
path: root/apps/web/src/stores
diff options
context:
space:
mode:
authoraashishparuvada <aashishvardhanp@gmail.com>2025-06-23 20:05:49 +0530
committeraashishparuvada <aashishvardhanp@gmail.com>2025-06-23 20:05:49 +0530
commit12d26c574b4517f358d97d130b0838f4868a8b85 (patch)
treeb04555438ad453ccae0ff9cd7d48d8191c326c80 /apps/web/src/stores
parent294ba01abeb2d8c3d3a04cb7ecc54abf97a6d4d3 (diff)
downloadopencut-12d26c574b4517f358d97d130b0838f4868a8b85.tar.gz
enabled-clip-selection
Diffstat (limited to 'apps/web/src/stores')
-rw-r--r--apps/web/src/stores/timeline-store.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/web/src/stores/timeline-store.ts b/apps/web/src/stores/timeline-store.ts
index c569ae11..ea6fc35e 100644
--- a/apps/web/src/stores/timeline-store.ts
+++ b/apps/web/src/stores/timeline-store.ts
@@ -21,6 +21,11 @@ export interface TimelineTrack {
interface TimelineStore {
tracks: TimelineTrack[];
+ // Selection
+ selectedClip: { trackId: string; clipId: string } | null;
+ selectClip: (trackId: string, clipId: string) => void;
+ clearSelectedClip: () => void;
+
// Actions
addTrack: (type: "video" | "audio" | "effects") => string;
removeTrack: (trackId: string) => void;
@@ -50,6 +55,14 @@ interface TimelineStore {
export const useTimelineStore = create<TimelineStore>((set, get) => ({
tracks: [],
+ selectedClip: null,
+
+ selectClip: (trackId, clipId) => {
+ set({ selectedClip: { trackId, clipId } });
+ },
+ clearSelectedClip: () => {
+ set({ selectedClip: null });
+ },
addTrack: (type) => {
const newTrack: TimelineTrack = {