diff --git a/packages/timeline-state-resolver/src/__tests__/conductor.spec.ts b/packages/timeline-state-resolver/src/__tests__/conductor.spec.ts index cc23db37c..984d97067 100644 --- a/packages/timeline-state-resolver/src/__tests__/conductor.spec.ts +++ b/packages/timeline-state-resolver/src/__tests__/conductor.spec.ts @@ -58,10 +58,16 @@ describe('Conductor', () => { deviceId: 'device1', options: {}, } - const myLayerMapping: Mappings = { + const device0Mappings: Mappings = { myLayer0: myLayerMapping0, + } + const device1Mappings: Mappings = { myLayer1: myLayerMapping1, } + const myLayerMapping: Mappings = { + ...device0Mappings, + ...device1Mappings, + } const conductor = new Conductor({ multiThreadedResolver: false, @@ -139,14 +145,14 @@ describe('Conductor', () => { }, time: 10005, }), - myLayerMapping // TODO - is this correct? + device0Mappings ) expect(device0.handleState).toHaveBeenNthCalledWith( 2, expect.objectContaining({ time: 11000, }), - myLayerMapping // TODO - is this correct? + device0Mappings ) expect(device0.handleState).toHaveBeenNthCalledWith( 3, @@ -154,7 +160,7 @@ describe('Conductor', () => { layers: {}, time: 12000, }), - myLayerMapping // TODO - is this correct? + device0Mappings ) // Ensure device1 has been fed sensible states @@ -165,7 +171,7 @@ describe('Conductor', () => { expect.objectContaining({ layers: {}, }), - myLayerMapping // TODO - is this correct? + device1Mappings ) expect(device1.handleState).toHaveBeenNthCalledWith( 2, @@ -180,14 +186,14 @@ describe('Conductor', () => { }), }, }), - myLayerMapping // TODO - is this correct? + device1Mappings ) expect(device1.handleState).toHaveBeenNthCalledWith( 3, expect.objectContaining({ layers: {}, }), - myLayerMapping // TODO - is this correct? + device1Mappings ) // Remove the device diff --git a/packages/timeline-state-resolver/src/conductor.ts b/packages/timeline-state-resolver/src/conductor.ts index 0be3bdd07..008a13b73 100644 --- a/packages/timeline-state-resolver/src/conductor.ts +++ b/packages/timeline-state-resolver/src/conductor.ts @@ -1087,8 +1087,13 @@ export class Conductor extends EventEmitter { deviceId: string, time: number, state: Timeline.TimelineState, - mappings: Mappings + unfilteredMappings: Mappings ) { + // only take mappings that are for this deviceId + const mappings = Object.fromEntries( + Object.entries>(unfilteredMappings).filter(([_, mapping]) => mapping.deviceId === deviceId) + ) + if (!this._deviceStates[deviceId]) this._deviceStates[deviceId] = [] // find all references to the datastore that are in this state diff --git a/packages/timeline-state-resolver/src/service/devices.ts b/packages/timeline-state-resolver/src/service/devices.ts index 19c07b6ad..98574cbb5 100644 --- a/packages/timeline-state-resolver/src/service/devices.ts +++ b/packages/timeline-state-resolver/src/service/devices.ts @@ -146,6 +146,6 @@ export const DevicesDict: Record = { deviceClass: QuantelDevice, canConnect: true, deviceName: (deviceId: string) => 'Quantel' + deviceId, - executionMode: () => 'salvo', + executionMode: () => 'sequential', }, }