Skip to content

Commit 499803f

Browse files
committed
feat: OGraf integration
1 parent af36ced commit 499803f

File tree

15 files changed

+2176
-0
lines changed

15 files changed

+2176
-0
lines changed

packages/timeline-state-resolver-types/src/generated/device-options.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ export interface DeviceOptionsObs extends DeviceOptionsBase<ObsOptions> {
5151
type: DeviceType.OBS
5252
}
5353

54+
import type { OgrafOptions } from './ograf'
55+
export interface DeviceOptionsOgraf extends DeviceOptionsBase<OgrafOptions> {
56+
type: DeviceType.OGRAF
57+
}
58+
5459
import type { OscOptions } from './osc'
5560
export interface DeviceOptionsOsc extends DeviceOptionsBase<OscOptions> {
5661
type: DeviceType.OSC
@@ -136,6 +141,7 @@ export type DeviceOptionsAny =
136141
| DeviceOptionsLawo
137142
| DeviceOptionsMultiOsc
138143
| DeviceOptionsObs
144+
| DeviceOptionsOgraf
139145
| DeviceOptionsOsc
140146
| DeviceOptionsPanasonicPTZ
141147
| DeviceOptionsPharos
@@ -168,6 +174,7 @@ export enum DeviceType {
168174
LAWO = 'LAWO',
169175
MULTI_OSC = 'MULTI_OSC',
170176
OBS = 'OBS',
177+
OGRAF = 'OGRAF',
171178
OSC = 'OSC',
172179
PANASONIC_PTZ = 'PANASONIC_PTZ',
173180
PHAROS = 'PHAROS',

packages/timeline-state-resolver-types/src/generated/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import type { SomeMappingMultiOsc } from './multiOsc'
3636
export * from './obs'
3737
import type { SomeMappingObs } from './obs'
3838

39+
export * from './ograf'
40+
import type { SomeMappingOgraf } from './ograf'
41+
3942
export * from './osc'
4043
import type { SomeMappingOsc } from './osc'
4144

@@ -91,6 +94,7 @@ export type TSRMappingOptions =
9194
| SomeMappingLawo
9295
| SomeMappingMultiOsc
9396
| SomeMappingObs
97+
| SomeMappingOgraf
9498
| SomeMappingOsc
9599
| SomeMappingPanasonicPTZ
96100
| SomeMappingPharos
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
/* eslint-disable */
2+
/**
3+
* This file was automatically generated by json-schema-to-typescript.
4+
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5+
* and re-run the "tsr-schema-types" tool to regenerate this file.
6+
*/
7+
import type { ActionExecutionResult } from "../actions"
8+
9+
export interface OgrafOptions {
10+
/**
11+
* URL of the OGraf server (http://my.ograf.server:8080)
12+
*/
13+
url?: string
14+
}
15+
16+
export interface MappingOgrafRenderTarget {
17+
rendererId: string
18+
renderTarget: string
19+
mappingType: MappingOgrafType.RenderTarget
20+
}
21+
22+
export interface MappingOgrafRenderer {
23+
rendererId: string
24+
mappingType: MappingOgrafType.Renderer
25+
}
26+
27+
export enum MappingOgrafType {
28+
RenderTarget = 'renderTarget',
29+
Renderer = 'renderer',
30+
}
31+
32+
export type SomeMappingOgraf = MappingOgrafRenderTarget | MappingOgrafRenderer
33+
34+
export interface DeltaStepPayload {
35+
/**
36+
* RendererId
37+
*/
38+
rendererId: string
39+
/**
40+
* RenderTarget
41+
*/
42+
renderTarget: string
43+
/**
44+
* ID of the graphic to trigger the customAction on
45+
*/
46+
graphicId: string
47+
/**
48+
* Number of steps to move, positive or negative
49+
*/
50+
delta: number
51+
skipAnimation?: boolean
52+
}
53+
54+
export interface GotoStepPayload {
55+
/**
56+
* RendererId
57+
*/
58+
rendererId: string
59+
/**
60+
* RenderTarget
61+
*/
62+
renderTarget: string
63+
/**
64+
* ID of the graphic to trigger the customAction on
65+
*/
66+
graphicId: string
67+
/**
68+
* The step to go to
69+
*/
70+
gotoStep?: number
71+
skipAnimation?: boolean
72+
}
73+
74+
export interface CustomActionPayload {
75+
/**
76+
* RendererId
77+
*/
78+
rendererId: string
79+
/**
80+
* RenderTarget
81+
*/
82+
renderTarget: string
83+
/**
84+
* ID of the graphic to trigger the customAction on
85+
*/
86+
graphicId: string
87+
/**
88+
* ID of the customAction to trigger
89+
*/
90+
actionId: string
91+
/**
92+
* The payload to send to the customAction
93+
*/
94+
payload: {
95+
[k: string]: unknown
96+
}
97+
skipAnimation?: boolean
98+
}
99+
100+
export interface RendererCustomActionPayload {
101+
/**
102+
* RendererId
103+
*/
104+
rendererId: string
105+
/**
106+
* ID of the customAction to trigger
107+
*/
108+
actionId: string
109+
/**
110+
* The payload to send to the customAction
111+
*/
112+
payload: {
113+
[k: string]: unknown
114+
}
115+
}
116+
117+
export enum OgrafActions {
118+
Resync = 'resync',
119+
DeltaStep = 'deltaStep',
120+
GotoStep = 'gotoStep',
121+
CustomAction = 'customAction',
122+
RendererCustomAction = 'rendererCustomAction'
123+
}
124+
export interface OgrafActionMethods {
125+
[OgrafActions.Resync]: (payload: Record<string, never>) => Promise<ActionExecutionResult<void>>,
126+
[OgrafActions.DeltaStep]: (payload: DeltaStepPayload) => Promise<ActionExecutionResult<void>>,
127+
[OgrafActions.GotoStep]: (payload: GotoStepPayload) => Promise<ActionExecutionResult<void>>,
128+
[OgrafActions.CustomAction]: (payload: CustomActionPayload) => Promise<ActionExecutionResult<void>>,
129+
[OgrafActions.RendererCustomAction]: (payload: RendererCustomActionPayload) => Promise<ActionExecutionResult<void>>
130+
}
131+
132+
export interface OgrafDeviceTypes {
133+
Options: OgrafOptions
134+
Mappings: SomeMappingOgraf
135+
Actions: OgrafActionMethods
136+
}

packages/timeline-state-resolver-types/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { TimelineContentVIZMSEAny } from './integrations/vizMSE'
2121
import { TimelineContentSingularLiveAny } from './integrations/singularLive'
2222
import { TimelineContentVMixAny } from './integrations/vmix'
2323
import { TimelineContentOBSAny } from './integrations/obs'
24+
import { TimelineContentOgrafAny } from './integrations/ograf'
2425
import { TimelineContentTriCasterAny } from './integrations/tricaster'
2526
import { TimelineContentWebSocketClientAny } from './integrations/websocketClient'
2627
import { DeviceType } from './generated'
@@ -43,6 +44,7 @@ export * from './integrations/vizMSE'
4344
export * from './integrations/singularLive'
4445
export * from './integrations/vmix'
4546
export * from './integrations/obs'
47+
export * from './integrations/ograf'
4648
export * from './integrations/tricaster'
4749
export * from './integrations/telemetrics'
4850
export * from './integrations/multiOsc'
@@ -108,6 +110,7 @@ export type TSRTimelineContent =
108110
| TimelineContentHyperdeckAny
109111
| TimelineContentLawoAny
110112
| TimelineContentOBSAny
113+
| TimelineContentOgrafAny
111114
| TimelineContentOSCAny
112115
| TimelineContentPharosAny
113116
| TimelineContentPanasonicPtzAny
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { DeviceType } from '..'
2+
3+
export type TimelineContentOgrafAny =
4+
| TimelineContentOGrafGraphic
5+
| TimelineContentOGrafGraphicStep
6+
| TimelineContentOGrafRendererCustomAction
7+
export interface TimelineContentOGrafBase {
8+
deviceType: DeviceType.OGRAF
9+
type: TimelineContentTypeOgraf
10+
}
11+
12+
export enum TimelineContentTypeOgraf {
13+
GRAPHIC = 'graphic',
14+
GRAPHIC_STEP = 'graphic_step',
15+
RENDERER_CUSTOM_ACTION = 'renderer_custom_action',
16+
}
17+
// export interface HTTPSendCommandContentExt extends Omit<HTTPSendCommandContent, 'url'> {
18+
// url: string | TemplateString
19+
// }
20+
21+
export type TimelineContentOGrafGraphic = TimelineContentOGrafBase & {
22+
type: TimelineContentTypeOgraf.GRAPHIC
23+
/** The Graphic to be loaded */
24+
graphicId: string
25+
26+
/** If the graphic is playing (or just being pre-loaded) */
27+
playing?: boolean
28+
29+
/** Any data to send into the graphic */
30+
data?: unknown
31+
32+
/** If true, skips animation (defaults to false) */
33+
skipAnimation?: boolean
34+
35+
/** Whether to use stop or CLEAR when stopping the graphic. Defaults to false = CLEAR */
36+
useStopCommand?: boolean
37+
38+
/** If set, goto step */
39+
goToStep?: number
40+
41+
/** If set, any CustomActions to call on the Graphic */
42+
customActions?: {
43+
[key: string]: {
44+
/** Action id, as defined by the Graphic manifest */
45+
id: string
46+
/** Payload to send into the Custom Action */
47+
payload: unknown
48+
49+
/** Whenever this changes, the CustomAction will be triggered */
50+
triggerValue?: string | number
51+
}
52+
}
53+
}
54+
export type TimelineContentOGrafGraphicStep = TimelineContentOGrafBase & {
55+
type: TimelineContentTypeOgraf.GRAPHIC_STEP
56+
/** The Graphic to be controlled */
57+
graphicId: string
58+
59+
/** The step delta to send to an ograf (playaction({delta})) */
60+
delta: number
61+
62+
/** Whenever this changes, the a playAction({delta}) */
63+
triggerValue?: string | number
64+
65+
/** If true, skips animation (defaults to false) */
66+
skipAnimation?: boolean
67+
}
68+
69+
export type TimelineContentOGrafRendererCustomAction = TimelineContentOGrafBase & {
70+
type: TimelineContentTypeOgraf.RENDERER_CUSTOM_ACTION
71+
72+
/** If set, any CustomActions to call on the Graphic */
73+
customActions?: {
74+
[key: string]: {
75+
/** Action id, as defined by the Graphic manifest */
76+
id: string
77+
/** Payload to send into the Custom Action */
78+
payload: unknown
79+
80+
/** Whenever this changes, the CustomAction will be triggered */
81+
triggerValue?: string | number
82+
}
83+
}
84+
}

0 commit comments

Comments
 (0)