Skip to content

Commit

Permalink
fix(casparcg): use normal input selector rather than custom component
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Nov 10, 2020
1 parent 50b3c30 commit f33a18f
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 302 deletions.
108 changes: 0 additions & 108 deletions client/components/CcgChannelSettings.tsx

This file was deleted.

9 changes: 1 addition & 8 deletions client/components/ChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
SOCKET_SET_INPUT_GAIN,
SOCKET_SET_INPUT_SELECTOR,
} from '../../server/constants/SOCKET_IO_DISPATCHERS'
import CcgChannelInputSettings from './CcgChannelSettings'
import ReductionMeter from './ReductionMeter'
import ClassNames from 'classnames'
import { fxParamsList } from '../../server/constants/MixerProtocolInterface'
Expand Down Expand Up @@ -506,13 +505,7 @@ class ChanStrip extends React.PureComponent<
</button>
</div>
<hr />
{this.props.selectedProtocol.includes('caspar') ? (
<CcgChannelInputSettings
channelIndex={this.props.faderIndex}
/>
) : (
this.parameters()
)}
{this.parameters()}
</div>
)
} else {
Expand Down
42 changes: 18 additions & 24 deletions client/components/MiniChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Store } from 'redux'
import { connect } from 'react-redux'
import { IFader } from '../../server/reducers/fadersReducer'
import { SOCKET_SET_AUX_LEVEL } from '../../server/constants/SOCKET_IO_DISPATCHERS'
import CcgChannelInputSettings from './CcgChannelSettings'

interface IChanStripInjectProps {
label: string
Expand Down Expand Up @@ -73,28 +72,21 @@ class MiniChanStrip extends React.PureComponent<
)
}
parameters() {
if (this.props.selectedProtocol.includes('caspar')) {
return (
<CcgChannelInputSettings channelIndex={this.props.faderIndex} />
)
} else {
return (
<div className="parameters">
<div className="group-text">
{this.props.label ||
'FADER ' + (this.props.faderIndex + 1)}
{' - MONITOR MIX MINUS'}
</div>
<ul className="monitor-sends">
{this.props.channel.map((ch: any, index: number) => {
if (ch.auxLevel[this.props.auxSendIndex] >= 0) {
return this.monitor(index)
}
})}
</ul>
return (
<div className="parameters">
<div className="group-text">
{this.props.label || 'FADER ' + (this.props.faderIndex + 1)}
{' - MONITOR MIX MINUS'}
</div>
)
}
<ul className="monitor-sends">
{this.props.channel.map((ch: any, index: number) => {
if (ch.auxLevel[this.props.auxSendIndex] >= 0) {
return this.monitor(index)
}
})}
</ul>
</div>
)
}

render() {
Expand All @@ -114,7 +106,8 @@ const mapStateToProps = (state: any, props: any): IChanStripInjectProps => {
let inject: IChanStripInjectProps = {
label: '',
selectedProtocol: state.settings[0].mixers[0].mixerProtocol,
numberOfChannelsInType: state.settings[0].mixers[0].numberOfChannelsInType,
numberOfChannelsInType:
state.settings[0].mixers[0].numberOfChannelsInType,
channel: state.channels[0].chConnection[0].channel,
fader: state.faders[0].fader,
auxSendIndex: -1,
Expand All @@ -124,7 +117,8 @@ const mapStateToProps = (state: any, props: any): IChanStripInjectProps => {
inject = {
label: state.faders[0].fader[props.faderIndex].label,
selectedProtocol: state.settings[0].mixers[0].mixerProtocol,
numberOfChannelsInType: state.settings[0].mixers[0].numberOfChannelsInType,
numberOfChannelsInType:
state.settings[0].mixers[0].numberOfChannelsInType,
channel: state.channels[0].chConnection[0].channel,
fader: state.faders[0].fader,
auxSendIndex: state.faders[0].fader[props.faderIndex].monitor - 1,
Expand Down
2 changes: 2 additions & 0 deletions server/constants/MixerProtocolInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export interface ICasparCGMixerGeometryFile {
PGM_CHANNEL_FADER_LEVEL: Array<ICasparCGChannelLayerPair[]>
PFL_AUX_FADER_LEVEL: Array<ICasparCGChannelLayerPair[]>
NEXT_AUX_FADER_LEVEL: Array<ICasparCGChannelLayerPair[]>
CHANNEL_INPUT_SELECTOR?: Array<IMixerMessageProtocol>
}
sourceOptions?: {
sources: Array<
Expand Down Expand Up @@ -160,6 +161,7 @@ export interface ICasparCGMixerGeometry extends IMixerProtocolGeneric {
PGM_CHANNEL_FADER_LEVEL: Array<ICasparCGChannelLayerPair[]>
PFL_AUX_FADER_LEVEL: Array<ICasparCGChannelLayerPair[]>
NEXT_AUX_FADER_LEVEL: Array<ICasparCGChannelLayerPair[]>
CHANNEL_INPUT_SELECTOR?: Array<IMixerMessageProtocol>
}
channelLabels?: string[]
sourceOptions?: {
Expand Down
49 changes: 27 additions & 22 deletions server/constants/mixerProtocols/casparCGMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
sourceOptions: geometry.sourceOptions,
fader: {
min: 0,
max: 1.5,
zero: 1,
max: 1,
zero: 0.75,
step: 0.001,
},
meter: {
Expand All @@ -136,22 +136,20 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
fromMixer: {
CHANNEL_OUT_GAIN: [
{
mixerMessage: 'none',
mixerMessage: 'MIXER ${CHANNEL} VOLUME ',
value: 0,
type: 'f',
min: 0,
max: 1.5,
zero: 1,
max: 1,
zero: 0.75,
},
],
CHANNEL_VU: [
{
mixerMessage:
'/stage/channel/{ch}/layer/{layer}/mixer/volume',
},
],
CHANNEL_VU: [emptyMixerMessage()],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [emptyMixerMessage()],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
Expand All @@ -160,17 +158,24 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
value: 0,
type: 'f',
min: 0,
max: 1.5,
zero: 1,
max: 1,
zero: 0.75,
},
],
CHANNEL_INPUT_SELECTOR: [
{
mixerMessage: '',
label: '1L-2R',
},
{
mixerMessage: '',
label: '1L-1R',
},
{
mixerMessage: '',
label: '2L-2R',
},
],
CHANNEL_NAME: [emptyMixerMessage()],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
},
],
Expand Down
Loading

0 comments on commit f33a18f

Please sign in to comment.