-
Notifications
You must be signed in to change notification settings - Fork 25
feat: TSR Device Feedback #456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dcb111d
wip: types POC
Julusian b0e4228
wip: some messing with types
Julusian eede41e
wip: types
Julusian fc7a269
wip
Julusian b362ed7
wip: source
Julusian a4e7785
wip: simplify
Julusian f007de9
wip: first attempt of producing events
Julusian 5b27882
wip: event filtering
Julusian cb9320e
fix
Julusian d105283
tidy
Julusian 1f6caf8
docs
Julusian 82b989f
fix tests
Julusian cd848d3
review
Julusian 4079605
emit for every state change
Julusian f7acc75
Merge branch 'main' into feat/tsr-device-feedback
Julusian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,12 @@ | ||
| import { TSRInput } from '../src/index.js' | ||
| // import { DeviceType } from 'timeline-state-resolver-types' | ||
|
|
||
| export const input: TSRInput = { | ||
| settings: { | ||
| multiThreading: true, | ||
| multiThreadedResolver: false, | ||
| // stateEvents: { | ||
| // atem0: { type: DeviceType.ATEM, events: ['me.0.inputs'] }, | ||
| // }, | ||
| }, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import type { DeviceTypeExt, TSRDeviceTypesMap } from './index.js' | ||
|
|
||
| /** | ||
| * A map of device types to their event types, derived from TSRDeviceTypesMap. This is used to type the events emitted by devices, to be listened on by `connectionEvent:stateEvent` | ||
| */ | ||
| export type TSREventTypesMap = { | ||
| [K in keyof TSRDeviceTypesMap]: 'Events' extends keyof TSRDeviceTypesMap[K] ? TSRDeviceTypesMap[K]['Events'] : never | ||
| } | ||
|
|
||
| /** | ||
| * A union of all event types from all known device types. | ||
| */ | ||
| export type TSREventTypes = TSREventTypesMap[keyof TSREventTypesMap] | ||
|
|
||
| /** | ||
| * Represents an event emitted by a device, to be listened on by `connectionEvent:stateEvent` | ||
| * Note: the payload can be null to indicate a return to TSR controlled state. | ||
| */ | ||
| export type TSRStateEvent<TDeviceType extends DeviceTypeExt, TEventTypes extends Record<string, unknown>> = { | ||
| [K in keyof TEventTypes]: { | ||
| deviceId: string // eg atem0 | ||
| deviceType: TDeviceType | ||
| event: K // the 'shared control address', or somethins like `me-program.1` | ||
| payload: TEventTypes[K] | ||
| /** | ||
| * Indicate whether this event is for a state from the timeline | ||
| */ | ||
| isFromTimeline: boolean | ||
| } | ||
| }[keyof TEventTypes] | ||
|
|
||
| /** | ||
| * A union of all possible state events from all devices, to be listened on by `connectionEvent:stateEvent` | ||
| */ | ||
| export type SomeTSRStateEvent<TDevice extends DeviceTypeExt = DeviceTypeExt> = TDevice extends keyof TSREventTypesMap | ||
| ? TSREventTypesMap[TDevice] extends Record<string, unknown> | ||
| ? TSRStateEvent<TDevice, TSREventTypesMap[TDevice]> | ||
| : never | ||
| : never |
2 changes: 1 addition & 1 deletion
2
packages/timeline-state-resolver-types/src/expectedPlayoutItems.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| import { VIZMSEPlayoutItemContent } from './integrations/vizMSE.js' | ||
| import { VIZMSEPlayoutItemContent } from './integrations/vizMSE/timeline.js' | ||
|
|
||
| export type ExpectedPlayoutItemContent = VIZMSEPlayoutItemContent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.