Skip to content

Commit

Permalink
Merge pull request #291 from nrkno/SOFIE-2489-quantel-state-handler
Browse files Browse the repository at this point in the history
Sofie 2489 quantel state handler
  • Loading branch information
mint-dewit authored Dec 12, 2023
2 parents 75e2cbe + be884b6 commit b5c9088
Show file tree
Hide file tree
Showing 16 changed files with 2,285 additions and 2,649 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export class MockDeviceInstanceWrapper
| 'removeAllListeners'
>
{
constructor(
public readonly deviceId: string,
_startTime: string,
public readonly config: DeviceOptionsAnyInternal,
public readonly getCurrentTime: () => Promise<number>
) {
constructor(public readonly deviceId: string, _startTime: string, public readonly config: DeviceOptionsAnyInternal) {
super()

// const deviceSpecs = DevicesDict[config.type]
Expand All @@ -54,6 +49,11 @@ export class MockDeviceInstanceWrapper
ConstructedMockDevices[deviceId] = this
}

getCurrentTime = jest.fn((): number => {
// throw new Error('Method not implemented.')
return Date.now()
})

initDevice = jest.fn(async (_activeRundownPlaylistId?: string | undefined): Promise<boolean> => {
// throw new Error('Method not implemented.')
return true
Expand Down
16 changes: 4 additions & 12 deletions packages/timeline-state-resolver/src/conductor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
DeviceOptionsAbstract,
DeviceOptionsAtem,
DeviceOptionsTCPSend,
DeviceOptionsQuantel,
} from 'timeline-state-resolver-types'

import { DoOnTime } from './devices/doOnTime'
Expand All @@ -42,7 +43,6 @@ import { LawoDevice, DeviceOptionsLawoInternal } from './integrations/lawo'
import { PanasonicPtzDevice, DeviceOptionsPanasonicPTZInternal } from './integrations/panasonicPTZ'
import { HyperdeckDevice, DeviceOptionsHyperdeckInternal } from './integrations/hyperdeck'
import { PharosDevice, DeviceOptionsPharosInternal } from './integrations/pharos'
import { QuantelDevice, DeviceOptionsQuantelInternal } from './integrations/quantel'
import { SisyfosMessageDevice, DeviceOptionsSisyfosInternal } from './integrations/sisyfos'
import { SingularLiveDevice, DeviceOptionsSingularLiveInternal } from './integrations/singularLive'
import { VMixDevice, DeviceOptionsVMixInternal } from './integrations/vmix'
Expand Down Expand Up @@ -546,15 +546,6 @@ export class Conductor extends EventEmitter<ConductorEvents> {
getCurrentTime,
threadedClassOptions
)
case DeviceType.QUANTEL:
return DeviceContainer.create<DeviceOptionsQuantelInternal, typeof QuantelDevice>(
'../../dist/integrations/quantel/index.js',
'QuantelDevice',
deviceId,
deviceOptions,
getCurrentTime,
threadedClassOptions
)
case DeviceType.SISYFOS:
return DeviceContainer.create<DeviceOptionsSisyfosInternal, typeof SisyfosMessageDevice>(
'../../dist/integrations/sisyfos/index.js',
Expand Down Expand Up @@ -642,7 +633,8 @@ export class Conductor extends EventEmitter<ConductorEvents> {
case DeviceType.HTTPWATCHER:
case DeviceType.OSC:
case DeviceType.SHOTOKU:
case DeviceType.TCPSEND: {
case DeviceType.TCPSEND:
case DeviceType.QUANTEL: {
ensureIsImplementedAsService(deviceOptions.type)

// presumably this device is implemented in the new service handler
Expand Down Expand Up @@ -1559,7 +1551,7 @@ export type DeviceOptionsAnyInternal =
| DeviceOptionsMultiOSCInternal
| DeviceOptionsSisyfosInternal
| DeviceOptionsSofieChefInternal
| DeviceOptionsQuantelInternal
| DeviceOptionsQuantel
| DeviceOptionsSingularLiveInternal
| DeviceOptionsVMixInternal
| DeviceOptionsShotoku
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function getDeviceContext(): DeviceContextAPI<any> {
info: jest.fn(),
debug: jest.fn(),
},
getCurrentTime: jest.fn(() => Date.now()),
emitDebugState: jest.fn(),
connectionChanged: jest.fn(),
resetResolver: jest.fn(),
Expand Down
Loading

0 comments on commit b5c9088

Please sign in to comment.