Skip to content

Commit

Permalink
fix: Build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eol-account committed Sep 2, 2021
1 parent 6f08deb commit 249032d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//ES6 example code based on playVideoInCaspar.ts
//copy and paste it to your own project

const { Conductor, DeviceType } = require('timeline-state-resolver')
const { Conductor, DeviceType } = require('@tv2media/timeline-state-resolver')

// Initialize TimelineStateResolver:
const tsrConductor = new Conductor()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export class VRundownMock implements VRundown {
return el
}
}
async listElements(): Promise<Array<string | number>> {
async listElements(): Promise<Array<string | ExternalElementId>> {
return []
}
async getElement(elementName: string | number): Promise<VElement> {
Expand Down
24 changes: 12 additions & 12 deletions packages/timeline-state-resolver/src/devices/vizMSE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {

import { TimelineState, ResolvedTimelineObjectInstance } from 'superfly-timeline'

import { createMSE, MSE, VRundown, InternalElement, ExternalElement, VElement } from 'v-connection'
import { createMSE, MSE, VRundown, InternalElement, ExternalElement, VElement, ExternalElementId } from 'v-connection'

import { DoOnTime, SendMode } from '../doOnTime'

Expand Down Expand Up @@ -914,7 +914,7 @@ class VizMSEManager extends EventEmitter {
templateName: number
channelName?: string
}[]
).map((item) => ({ vcpid: item.templateName, channelName: item.channelName }))
).map((item) => literal<ExternalElementId>({ vcpid: item.templateName, channel: item.channelName }))
await rundown.purge(elementsToKeep)
} catch (error) {
this.emit('error', error)
Expand Down Expand Up @@ -976,7 +976,7 @@ class VizMSEManager extends EventEmitter {
await this._checkElementExists(cmd)
await this._handleRetry(() => {
this.emit('debug', `VizMSE: cue "${elementRef}" on channel "${cmd.channelName}"`)
return rundown.cue(elementRef)
return rundown.cue(elementRef, cmd.channelName)
})
}
/**
Expand All @@ -1000,7 +1000,7 @@ class VizMSEManager extends EventEmitter {
await this._handleRetry(() => {
this.emit('debug', `VizMSE: take "${elementRef}" on channel "${cmd.channelName}"`)

return rundown.take(elementRef)
return rundown.take(elementRef, cmd.channelName)
})
}
/**
Expand All @@ -1023,7 +1023,7 @@ class VizMSEManager extends EventEmitter {
await this._checkElementExists(cmd)
await this._handleRetry(() => {
this.emit('debug', `VizMSE: out "${elementRef}" on channel "${cmd.channelName}"`)
return rundown.out(elementRef)
return rundown.out(elementRef, cmd.channelName)
})
}
/**
Expand All @@ -1037,7 +1037,7 @@ class VizMSEManager extends EventEmitter {
await this._checkElementExists(cmd)
await this._handleRetry(() => {
this.emit('debug', `VizMSE: continue "${elementRef}" on channel "${cmd.channelName}"`)
return rundown.continue(elementRef)
return rundown.continue(elementRef, cmd.channelName)
})
}
/**
Expand All @@ -1051,7 +1051,7 @@ class VizMSEManager extends EventEmitter {
await this._checkElementExists(cmd)
await this._handleRetry(() => {
this.emit('debug', `VizMSE: continue reverse "${elementRef}" on channel "${cmd.channelName}"`)
return rundown.continueReverse(elementRef)
return rundown.continueReverse(elementRef, cmd.channelName)
})
}
/**
Expand Down Expand Up @@ -1237,7 +1237,7 @@ class VizMSEManager extends EventEmitter {
const elementIsExternal = cachedElement && this._isExternalElement(cachedElement.element)

if (elementIsExternal) {
const element = await rundown.getElement(elementRef)
const element = await rundown.getElement(elementRef, cachedElement.element.channel)
if (this._isExternalElement(element) && element.exists === 'no') {
throw new Error(`Can't take the element "${elementRef}" while it has the property exists="no"`)
}
Expand Down Expand Up @@ -1275,7 +1275,7 @@ class VizMSEManager extends EventEmitter {
// If the object already exists, it's not an error, fetch and use the element instead

const element = _.isNumber(cmd.templateName)
? await rundown.getElement(cmd.templateName)
? await rundown.getElement(cmd.templateName, cmd.channelName)
: await rundown.getElement(cmd.templateInstance)

this._cacheElement(elementHash, element)
Expand Down Expand Up @@ -1381,7 +1381,7 @@ class VizMSEManager extends EventEmitter {
this.emit('debug', `Updating status of element ${elementRef}`)

// Update cached status of the element:
const newEl = await rundown.getElement(elementRef)
const newEl = await rundown.getElement(elementRef, e.element.channel)

const newLoadedEl = {
element: newEl,
Expand Down Expand Up @@ -1421,7 +1421,7 @@ class VizMSEManager extends EventEmitter {
'debug',
`Element "${this._getElementReference(newEl)}" went from loaded to not loaded, initializing`
)
await rundown.initialize(this._getElementReference(newEl))
await rundown.initialize(this._getElementReference(newEl), newEl.channel)
}
}
} catch (e) {
Expand Down Expand Up @@ -1482,7 +1482,7 @@ class VizMSEManager extends EventEmitter {
} else {
// The element has not started loading, load it:
this.emit('debug', `Element "${this._getElementReference(e.element)}" is not loaded, initializing`)
await rundown.initialize(this._getElementReference(e.element))
await rundown.initialize(this._getElementReference(e.element), e.element.channel)
}
} else {
this.emit('error', `Element "${this._getElementReference(e.element)}" type `)
Expand Down

0 comments on commit 249032d

Please sign in to comment.