Skip to content
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

fix: lookahead transitions respect prev_full class #101

Merged
merged 3 commits into from Oct 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions meteor/client/ui/Settings/StudioSettings.tsx
Expand Up @@ -356,6 +356,18 @@ const StudioMappings = translate()(class StudioMappings extends React.Component<
className='input text-input input-l'></EditAttribute>
</label>
</div>
<div className='mod mvs mhs'>
<label className='field'>
{t('Priority')}
<EditAttribute
modifiedClassName='bghl'
attribute={'mappings.' + layerId + '.priority'}
obj={this.props.studio}
type='int'
collection={Studios}
className='input text-input input-l'></EditAttribute>
</label>
</div>
</React.Fragment>
)
}
Expand Down
Expand Up @@ -280,8 +280,8 @@ export const PlayoutDeviceSettingsComponent = translate()(class PlayoutDeviceSet
</div>
<div className='mod mvs mhs'>
<label className='field'>
{t('Ramp Function Path')}
<EditAttribute modifiedClassName='bghl' attribute={'settings.devices.' + deviceId + '.options.rampMotorFunctionPath'} obj={this.props.device} type='text' collection={PeripheralDevices} className='input text-input input-l'></EditAttribute>
{t('Priority')}
<EditAttribute modifiedClassName='bghl' attribute={'settings.devices.' + deviceId + '.options.priority'} obj={this.props.device} type='text' collection={PeripheralDevices} className='input text-input input-l'></EditAttribute>
</label>
</div>
</React.Fragment>
Expand Down
9 changes: 9 additions & 0 deletions meteor/server/api/playout/lookahead.ts
Expand Up @@ -312,9 +312,11 @@ function findObjectsForPart (rundownData: RundownData, layer: string, timeOrdere
const orderedItems = getOrderedPiece(startingPartOnLayer.part)

let allowTransition = false
let classesFromPreviousPart: string[] = []
if (startingPartOnLayerIndex >= 1 && activeRundown.currentPartId) {
const prevPieceGroup = timeOrderedPartsWithPieces[startingPartOnLayerIndex - 1]
allowTransition = !prevPieceGroup.part.disableOutTransition
classesFromPreviousPart = prevPieceGroup.part.classesForNext || []
}

const transObj = orderedItems.find(i => !!i.isTransition)
Expand Down Expand Up @@ -354,6 +356,13 @@ function findObjectsForPart (rundownData: RundownData, layer: string, timeOrdere
let transitionKF: TimelineTypes.TimelineKeyframe | undefined = undefined
if (allowTransition) {
transitionKF = _.find(obj.keyframes || [], kf => kf.enable.while === '.is_transition')

// TODO - this keyframe matching is a hack, and is very fragile

if (!transitionKF && classesFromPreviousPart && classesFromPreviousPart.length > 0) {
// Check if the keyframe also uses a class to match. This handles a specific edge case
transitionKF = _.find(obj.keyframes || [], kf => _.any(classesFromPreviousPart, cl => kf.enable.while === `.is_transition & .${cl}`))
}
}
const newContent = Object.assign({}, obj.content, transitionKF ? transitionKF.content : {})

Expand Down