MCPcopy
hub / github.com/CapSoftware/Cap / serializeProjectConfiguration

Function serializeProjectConfiguration

apps/desktop/src/routes/editor/context.ts:263–294  ·  view source on GitHub ↗
(
	project: EditorProjectConfiguration,
)

Source from the content-addressed store, hash-verified

261}
262
263export function serializeProjectConfiguration(
264 project: EditorProjectConfiguration,
265): ProjectConfiguration {
266 const { background, camera, ...rest } = project;
267 const { roundingType: backgroundRoundingType, ...backgroundRest } =
268 background;
269 const { roundingType: cameraRoundingType, ...cameraRest } = camera;
270
271 const timeline = project.timeline
272 ? {
273 ...project.timeline,
274 captionSegments: project.timeline.captionSegments ?? [],
275 keyboardSegments: project.timeline.keyboardSegments ?? [],
276 maskSegments: project.timeline.maskSegments ?? [],
277 textSegments: project.timeline.textSegments ?? [],
278 audioSegments: project.timeline.audioSegments ?? [],
279 }
280 : project.timeline;
281
282 return {
283 ...rest,
284 timeline: timeline as unknown as ProjectConfiguration["timeline"],
285 background: {
286 ...backgroundRest,
287 roundingType: backgroundRoundingType,
288 },
289 camera: {
290 ...cameraRest,
291 roundingType: cameraRoundingType,
292 },
293 };
294}
295
296export const [EditorContextProvider, useEditorContext] = createContextProvider(
297 (props: {

Callers 7

getPreviewProjectConfigFunction · 0.90
appendRecordedClipFunction · 0.90
PlayerContentFunction · 0.90
beginEditorRecordingFunction · 0.90
importRecordingPathFunction · 0.90
flushProjectConfigFunction · 0.85
context.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected