Skip to content

Commit

Permalink
feat: ChannelTypes - Channel color and label injected from mixerprotocol
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jun 28, 2019
1 parent 0d630bb commit 9552320
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 16 deletions.
19 changes: 13 additions & 6 deletions src/components/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { Store } from 'redux';
//assets:
import '../assets/css/Channel.css';
import { IMixerProtocol, MixerProtocolPresets, IMixerProtocolGeneric, ICasparCGMixerGeometry } from '../constants/MixerProtocolPresets';
import { any } from 'prop-types';
import { any, number } from 'prop-types';

interface IChannelInjectProps {
pgmOn: boolean,
pstOn: boolean,
pflOn: boolean,
channelType: number,
channelTypeIndex: number,
showChannel: boolean,
faderLevel: number,
label: string,
Expand Down Expand Up @@ -220,10 +222,13 @@ class Channel extends React.Component<IChannelProps & IChannelInjectProps & Stor
this.props.showChannel === false ?
<div></div>
:
<div className={ClassNames("channel-body", {
"with-snaps": this.props.showSnaps,
"with-pfl": this.props.showPfl
})}>
<div
style={{backgroundColor: this.mixerProtocol.channelTypes[this.props.channelType].channelTypeColor}}
className={
ClassNames("channel-body", {
"with-snaps": this.props.showSnaps,
"with-pfl": this.props.showPfl
})}>
{this.channelSettings()}
{this.fader()}
<VuMeter channelIndex = {this.channelIndex}/>
Expand All @@ -240,7 +245,7 @@ class Channel extends React.Component<IChannelProps & IChannelInjectProps & Stor
: null
}
<div className="channel-name">
{this.props.label != "" ? this.props.label : ("CH " + (this.channelIndex + 1)) }
{this.props.label != "" ? this.props.label : (this.mixerProtocol.channelTypes[this.props.channelType].channelTypeName + " " + (this.props.channelTypeIndex + 1)) }
</div>
<div className="channel-snap-body">
{this.props.snapOn
Expand All @@ -261,6 +266,8 @@ const mapStateToProps = (state: any, props: any): IChannelInjectProps => {
pflOn: state.channels[0].channel[props.channelIndex].pflOn,
showChannel: state.channels[0].channel[props.channelIndex].showChannel,
faderLevel: state.channels[0].channel[props.channelIndex].faderLevel,
channelType: state.channels[0].channel[props.channelIndex].channelType,
channelTypeIndex: state.channels[0].channel[props.channelIndex].channelTypeIndex,
label: state.channels[0].channel[props.channelIndex].label,
snapOn: state.channels[0].channel[props.channelIndex].snapOn.map((item: number) => {return item}),
mixerProtocol: state.settings[0].mixerProtocol,
Expand Down
6 changes: 3 additions & 3 deletions src/constants/mixerProtocols/EmberLawo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const LawoClient: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['Sapphire/Sources/Source{channel}/Fader'],
Expand All @@ -52,8 +52,8 @@ export const LawoClient: IMixerProtocol = {
},
},
{
channelTypeName: 'Sums',
channelTypeColor: '#2f2f2f',
channelTypeName: 'MST',
channelTypeColor: 'rgb(21, 21, 49)',
fromMixer: {
CHANNEL_FADER_LEVEL: ['Sapphire/Sums/Source{channel}/Fader'],
CHANNEL_OUT_GAIN: [''],
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/ardourMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ArdourMaster: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['none'], //'none' ignores this command
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/behringerXrMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const BehringerXrMaster: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['none'], //'none' ignores this command
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/casparCGMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if (geometry) {
//THIS IS JUST TO AVOID ERRORS AS
//channelTypes are moved to IMixerProtocolGeneric
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['none'],
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/genericMidi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const GenericMidi: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ["39"], //PgmChange 0 - ignores this command
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/midasMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const MidasMaster: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['none'], //'none' ignores this command
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/reaper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Reaper: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['/track/{channel}/volume'],
Expand Down
2 changes: 1 addition & 1 deletion src/constants/mixerProtocols/reaperMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const ReaperMaster: IMixerProtocol = {
}
],
channelTypes: [{
channelTypeName: 'Channels',
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['none'],
Expand Down

0 comments on commit 9552320

Please sign in to comment.