Skip to content

Commit

Permalink
fix: moved channelTypes to IMixerProtocolGeneric as it´s need when in…
Browse files Browse the repository at this point in the history
…itialising the App for total number of channels

chore: Added empty channelTypes in CasparCG for now.
fix: number of channels is based on totalNumber of channels in channelTypes
  • Loading branch information
olzzon committed Jun 27, 2019
1 parent b733529 commit 33400f3
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
9 changes: 8 additions & 1 deletion src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { loadSnapshotState, saveSnapshotState } from '../utils/SettingsStorage';
import { MixerGenericConnection } from '../utils/MixerConnection';
import { AutomationConnection } from '../utils/AutomationConnection';
import { HuiMidiRemoteConnection } from '../utils/HuiMidiRemoteConnection';
import { MixerProtocolPresets } from '../constants/MixerProtocolPresets';

import { Store, AnyAction } from 'redux';
import { ISettings } from '../reducers/settingsReducer';
import { IChannels } from '../reducers/channelsReducer';
Expand All @@ -30,7 +32,12 @@ class App extends React.Component<IAppProps> {
(window as any).automationConnection = new AutomationConnection();
(window as any).huiRemoteConnection = new HuiMidiRemoteConnection();
this.snapShopStoreTimer();
loadSnapshotState(this.props.store.channels[0], this.props.store.settings[0].numberOfChannelsInType[0]);
let totalNumberOfChannels = 0;
let selectedProtocol = MixerProtocolPresets[this.props.store.settings[0].mixerProtocol];
selectedProtocol.channelTypes.forEach((item, index) => {
totalNumberOfChannels =+ this.props.store.settings[0].numberOfChannelsInType[index];
});
loadSnapshotState(this.props.store.channels[0], totalNumberOfChannels);
}

public shouldComponentUpdate(nextProps: IAppProps) {
Expand Down
4 changes: 2 additions & 2 deletions src/constants/MixerProtocolPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ export interface IMixerProtocolGeneric {
max: number,
zero: number,
test: number,
}
},
channelTypes: Array<IChannelTypes>
}

export interface IMixerProtocol extends IMixerProtocolGeneric{
leadingZeros: boolean,
pingCommand: Array<IMixerMessageProtocol>,
pingTime: number,
initializeCommands: Array<IMixerMessageProtocol>,
channelTypes: Array<IChannelTypes>
}

export interface IChannelTypes {
Expand Down
32 changes: 31 additions & 1 deletion src/constants/mixerProtocols/casparCGMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,37 @@ if (geometry) {
test: 0.6,
},
channelLabels: geometry.channelLabels,
sourceOptions: geometry.sourceOptions
sourceOptions: geometry.sourceOptions,
//CHANNELTYES ARE NOT IMPLEMENTED.
//THIS IS JUST TO AVOID ERRORS AS
//channelTypes are moved to IMixerProtocolGeneric
channelTypes: [{
channelTypeName: 'Channels',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_FADER_LEVEL: ['none'],
CHANNEL_OUT_GAIN: ['none'],
CHANNEL_VU: ['none'],
CHANNEL_NAME: 'none',
PFL: ['todo'],
AUX_SEND: ['none'],
},
toMixer: {
CHANNEL_FADER_LEVEL: ['none'],
CHANNEL_OUT_GAIN: ['none'],
PFL_ON: [{
mixerMessage: "none",
value: 1,
type: "i"
}],
PFL_OFF: [{
mixerMessage: "none",
value: 0,
type: "i"
}],
AUX_SEND: ['none'],
},
}]
}
}

Expand Down

0 comments on commit 33400f3

Please sign in to comment.