From 3e1785f974e1f662609a688370c7e6b18a1a5648 Mon Sep 17 00:00:00 2001 From: Sam Lavigne Date: Tue, 29 Aug 2023 11:36:57 -0400 Subject: [PATCH] gifs! --- src/App.svelte | 27 ++++++++++++++++++++------- src/Node.svelte | 27 +++++++++++++++++++++++---- src/stores.js | 18 ++++++++++++++++-- 3 files changed, 59 insertions(+), 13 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index 30e1d85..99d639d 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -1,6 +1,6 @@
@@ -20,8 +32,15 @@
{#if data.nodeType == "input"} + {:else if data.nodeType == "output"} + {:else} {data.name} diff --git a/src/stores.js b/src/stores.js index 0efb9ff..51ead7d 100644 --- a/src/stores.js +++ b/src/stores.js @@ -6,8 +6,18 @@ export const edges = writable([]); export const auto = writable(true); export const selectedFilter = writable(); -addNode({ name: "punch.mp4" }, "input"); -addNode({ name: "out.mp4" }, "output"); +export const INPUTNAMES = [ + {name: "punch.mp4", ext: "mp4", outputs: ["v", "a"], inputs: []}, + {name: "shoe.mp4", ext: "mp4", outputs: ["v", "a"], inputs: []} +]; + +export const OUTPUTNAMES = [ + {name: "out.mp4", ext: "mp4", inputs: ["v", "a"], outputs: []}, + {name: "out.gif", ext: "gif", inputs: ["v"], outputs: []} +]; + +addNode({...INPUTNAMES[0]}, "input"); +addNode({...OUTPUTNAMES[0]}, "output"); export function makeFilterArgs(f) { let fCommand = f.name; @@ -166,6 +176,10 @@ export const inputs = derived(nodes, ($nodes) => { return $nodes.filter((n) => n.nodeType === "input").map((n) => n.data); }); +export const outputs = derived(nodes, ($nodes) => { + return $nodes.filter((n) => n.nodeType === "output").map((n) => n.data); +}); + nodes.subscribe(($nodes) => { const isAuto = get(auto); if (!isAuto) return;