How to use the superfly-timeline.Resolver.getTimelineInWindow function in superfly-timeline

To help you get started, we’ve selected a few superfly-timeline examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nrkno / tv-automation-server-core / meteor / client / ui / NymansPlayground.tsx View on Github external
export const ComponentTimelineSimulate = withTracker(() => {

	// These properties will be exposed under this.props
	// Note that these properties are reactively recalculated
	let timeline = transformTimeline(
		Timeline.find({}, { sort: { _id: 1 } }).fetch()
	)

	// pre-process the timeline
	let now = getCurrentTimeReactive()

	let tl = Resolver.getTimelineInWindow(timeline)

	let state = Resolver.getState(tl, now)

	return {
		now: now,
		state: state
	}
})(
class extends MeteorReactComponent {
github nrkno / tv-automation-server-core / meteor / server / api / playout.ts View on Github external
function getOrderedPiece (line: Part): Array {
	const items = line.getAllPieces()

	const itemMap: { [key: string]: Piece } = {}
	items.forEach(i => itemMap[i._id] = i)

	const objs: Array = items.map(
		i => clone(createPieceGroup(i, i.durationOverride || i.duration || i.expectedDuration || 0))
	)
	objs.forEach(o => {
		if (o.trigger.type === TriggerType.TIME_ABSOLUTE && (o.trigger.value === 0 || o.trigger.value === 'now')) {
			o.trigger.value = 100
		}
	})
	const tlResolved = Resolver.getTimelineInWindow(transformTimeline(objs))

	let resolvedItems: Array = []
	_.each(tlResolved.resolved, e => {
		const id = ((e as any || {}).metadata || {}).pieceId
		let item = _.clone(itemMap[id]) as PieceResolved
		item.resolvedStart = e.resolved.startTime || 0
		item.resolved = true
		resolvedItems.push(item)
	})
	_.each(tlResolved.unresolved, e => {
		const id = ((e as any || {}).metadata || {}).pieceId

		let item = _.clone(itemMap[id]) as PieceResolved
		item.resolvedStart = 0
		item.resolved = false
github nrkno / tv-automation-server-core / meteor / server / api / playout.ts View on Github external
function getResolvedPieces (line: Part): Piece[] {
	const items = line.getAllPieces()

	const itemMap: { [key: string]: Piece } = {}
	items.forEach(i => itemMap[i._id] = i)

	const objs = items.map(i => clone(createPieceGroup(i, i.durationOverride || i.duration || i.expectedDuration || 0)))
	objs.forEach(o => {
		if (o.trigger.type === TriggerType.TIME_ABSOLUTE && (o.trigger.value === 0 || o.trigger.value === 'now')) {
			o.trigger.value = 1
		}
	})
	const events = Resolver.getTimelineInWindow(transformTimeline(objs))

	let eventMap = events.resolved.map(e => {
		const id = ((e as any || {}).metadata || {}).pieceId
		return {
			start: e.resolved.startTime || 0,
			end: e.resolved.endTime || 0,
			id: id,
			item: itemMap[id]
		}
	})
	events.unresolved.forEach(e => {
		const id = ((e as any || {}).metadata || {}).pieceId
		eventMap.push({
			start: 0,
			end: 0,
			id: id,