claudes variant of ui
This commit is contained in:
@@ -0,0 +1,102 @@
|
||||
import type { NodeTypeDef, ParamDef } from './types'
|
||||
|
||||
export const RESOLUTION_OPTIONS = [
|
||||
{ label: '1920×1080', value: '1920x1080' },
|
||||
{ label: '1280×720', value: '1280x720' },
|
||||
{ label: '3840×2160', value: '3840x2160' },
|
||||
]
|
||||
|
||||
export const FPS_OPTIONS = [
|
||||
{ label: '23.98', value: '23.98' },
|
||||
{ label: '24', value: '24' },
|
||||
{ label: '25', value: '25' },
|
||||
{ label: '29.97', value: '29.97' },
|
||||
{ label: '30', value: '30' },
|
||||
{ label: '50', value: '50' },
|
||||
{ label: '59.94', value: '59.94' },
|
||||
{ label: '60', value: '60' },
|
||||
]
|
||||
|
||||
export const DEVICE_OPTIONS = [
|
||||
{ label: 'Port 1', value: 0 },
|
||||
{ label: 'Port 2', value: 1 },
|
||||
{ label: 'Port 3', value: 2 },
|
||||
{ label: 'Port 4', value: 3 },
|
||||
]
|
||||
|
||||
// Format params shown on source nodes; values go into edge format (not node params)
|
||||
const FORMAT_PARAMS: ParamDef[] = [
|
||||
{ key: 'res', label: 'Resolution', type: 'select', options: RESOLUTION_OPTIONS, default: '1920x1080', isFormat: true },
|
||||
{ key: 'fps', label: 'FPS', type: 'select', options: FPS_OPTIONS, default: '25', isFormat: true },
|
||||
]
|
||||
|
||||
export const NODE_TYPES: Record<string, NodeTypeDef> = {
|
||||
testpattern: {
|
||||
type: 'testpattern',
|
||||
label: 'Test Pattern',
|
||||
ports: [
|
||||
{ id: 'video-out', kind: 'video', direction: 'out' },
|
||||
{ id: 'audio-out', kind: 'audio', direction: 'out' },
|
||||
],
|
||||
params: [...FORMAT_PARAMS],
|
||||
},
|
||||
ndiin: {
|
||||
type: 'ndiin',
|
||||
label: 'NDI In',
|
||||
ports: [
|
||||
{ id: 'video-out', kind: 'video', direction: 'out' },
|
||||
{ id: 'audio-out', kind: 'audio', direction: 'out' },
|
||||
],
|
||||
params: [
|
||||
{ key: 'source_num', label: 'NDI Source #', type: 'number', default: 0, min: 0, max: 15 },
|
||||
...FORMAT_PARAMS,
|
||||
],
|
||||
},
|
||||
decklinkin: {
|
||||
type: 'decklinkin',
|
||||
label: 'DeckLink In',
|
||||
ports: [
|
||||
{ id: 'video-out', kind: 'video', direction: 'out' },
|
||||
{ id: 'audio-out', kind: 'audio', direction: 'out' },
|
||||
],
|
||||
params: [
|
||||
{ key: 'device_index', label: 'Port', type: 'select', options: DEVICE_OPTIONS, default: 0 },
|
||||
...FORMAT_PARAMS,
|
||||
],
|
||||
},
|
||||
ndiout: {
|
||||
type: 'ndiout',
|
||||
label: 'NDI Out',
|
||||
ports: [
|
||||
{ id: 'video-in', kind: 'video', direction: 'in' },
|
||||
{ id: 'audio-in', kind: 'audio', direction: 'in' },
|
||||
],
|
||||
params: [],
|
||||
},
|
||||
decklinkout: {
|
||||
type: 'decklinkout',
|
||||
label: 'DeckLink Out',
|
||||
ports: [
|
||||
{ id: 'video-in', kind: 'video', direction: 'in' },
|
||||
{ id: 'audio-in', kind: 'audio', direction: 'in' },
|
||||
],
|
||||
params: [
|
||||
{ key: 'device_index', label: 'Port', type: 'select', options: DEVICE_OPTIONS, default: 0 },
|
||||
],
|
||||
},
|
||||
fakesink: {
|
||||
type: 'fakesink',
|
||||
label: 'Fake Sink',
|
||||
ports: [
|
||||
{ id: 'video-in', kind: 'video', direction: 'in' },
|
||||
],
|
||||
params: [],
|
||||
},
|
||||
}
|
||||
|
||||
// Default params for a new node of the given type
|
||||
export function defaultParams(nodeType: string): Record<string, string | number> {
|
||||
const def = NODE_TYPES[nodeType]
|
||||
if (!def) return {}
|
||||
return Object.fromEntries(def.params.map(p => [p.key, p.default]))
|
||||
}
|
||||
Reference in New Issue
Block a user