summaryrefslogtreecommitdiff
path: root/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-09-01 22:15:32 +0200
committerMaze Winther <mazewinther@gmail.com>2025-09-01 22:15:32 +0200
commitd8f446580c2636e87aa39c00b1565406c56f9343 (patch)
treed538f50f10d114bc6d5843efb27cc38cd4d39328 /apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx
parentb84e699e9c4f0a56685697f46f52af86479a1265 (diff)
downloadopencut-d8f446580c2636e87aa39c00b1565406c56f9343.tar.gz
feat: remove default background scene and add scene management
Diffstat (limited to 'apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx')
-rw-r--r--apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx b/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx
index ef667d67..7def2985 100644
--- a/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx
+++ b/apps/web/src/components/editor/timeline/timeline-cache-indicator.tsx
@@ -5,6 +5,7 @@ import { TIMELINE_CONSTANTS } from "@/constants/timeline-constants";
import { TimelineTrack } from "@/types/timeline";
import { MediaFile } from "@/types/media";
import { TProject } from "@/types/project";
+import { useSceneStore } from "@/stores/scene-store";
interface CacheSegment {
startTime: number;
@@ -22,7 +23,8 @@ interface TimelineCacheIndicatorProps {
time: number,
tracks: TimelineTrack[],
mediaFiles: MediaFile[],
- activeProject: TProject | null
+ activeProject: TProject | null,
+ sceneId?: string
) => "cached" | "not-cached";
}
@@ -34,6 +36,8 @@ export function TimelineCacheIndicator({
activeProject,
getRenderStatus,
}: TimelineCacheIndicatorProps) {
+ const { currentScene } = useSceneStore();
+
// Calculate cache segments by sampling the timeline
const calculateCacheSegments = (): CacheSegment[] => {
const segments: CacheSegment[] = [];
@@ -49,7 +53,13 @@ export function TimelineCacheIndicator({
for (let i = 0; i <= totalSamples; i++) {
const time = i / sampleRate;
const cached =
- getRenderStatus(time, tracks, mediaFiles, activeProject) === "cached";
+ getRenderStatus(
+ time,
+ tracks,
+ mediaFiles,
+ activeProject,
+ currentScene?.id
+ ) === "cached";
if (!currentSegment) {
// Start first segment