Skip to content

Commit

Permalink
feat: full ch strip - initial setup
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Oct 26, 2020
1 parent f0186e4 commit 48c08de
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 24 deletions.
14 changes: 11 additions & 3 deletions client/components/ChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import { connect } from 'react-redux'
import {
storeShowChanStrip,
storeShowOptions,
storeShowMonitorOptions,
storeShowMonitorOptions, storeShowChanStripFull
} from '../../server/reducers/settingsActions'
import { IFader, IFxParam } from '../../server/reducers/fadersReducer'
import { IFader } from '../../server/reducers/fadersReducer'
import {
SOCKET_SET_THRESHOLD,
SOCKET_SET_RATIO,
Expand Down Expand Up @@ -62,7 +62,9 @@ class ChanStrip extends React.PureComponent<
this.props.dispatch(storeShowMonitorOptions(this.props.faderIndex))
this.props.dispatch(storeShowChanStrip(-1))
}

handleShowChStripFull() {
this.props.dispatch(storeShowChanStripFull(this.props.faderIndex))
}
handleClose = () => {
this.props.dispatch(storeShowChanStrip(-1))
}
Expand Down Expand Up @@ -638,6 +640,12 @@ class ChanStrip extends React.PureComponent<
Mon.Setup
</button>
)}
<button
className="button half"
onClick={() => this.handleShowChStripFull()}
>
FULL
</button>
</div>
<hr />
{this.props.selectedProtocol.includes('caspar') ? (
Expand Down
18 changes: 16 additions & 2 deletions client/components/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
SOCKET_RESTART_SERVER,
SOCKET_TOGGLE_ALL_MANUAL,
} from '../../server/constants/SOCKET_IO_DISPATCHERS'
import ChanStripFull from './ChanStripFull'

interface IChannelsInjectProps {
channels: IChannels
Expand All @@ -48,6 +49,8 @@ class Channels extends React.Component<IChannelsInjectProps & Store> {
nextProps.settings.showOptions ||
this.props.settings.showChanStrip !==
nextProps.settings.showChanStrip ||
this.props.settings.showChanStripFull !==
nextProps.settings.showChanStripFull ||
this.props.settings.showMonitorOptions !==
nextProps.settings.showMonitorOptions ||
this.props.settings.customPages !==
Expand All @@ -57,7 +60,8 @@ class Channels extends React.Component<IChannelsInjectProps & Store> {
this.props.faders.length !== nextProps.faders.length ||
this.props.settings.currentPage !==
nextProps.settings.currentPage ||
this.props.settings.numberOfCustomPages !== nextProps.settings.numberOfCustomPages ||
this.props.settings.numberOfCustomPages !==
nextProps.settings.numberOfCustomPages ||
!!nextProps.faders.find(
(f, i) =>
this.props.faders[i].ignoreAutomation !== f.ignoreAutomation
Expand Down Expand Up @@ -96,7 +100,7 @@ class Channels extends React.Component<IChannelsInjectProps & Store> {
}

handlePages(type: PageType, i: number | string) {
this.props.dispatch(storeSetPage(type, i))
this.props.dispatch(storeSetPage(type, i))
}

renderPageButtons() {
Expand Down Expand Up @@ -221,6 +225,16 @@ class Channels extends React.Component<IChannelsInjectProps & Store> {
/>
</div>
)}
{this.props.settings.showChanStripFull >= 0 ? (
<div>
<ChanStripFull
faderIndex={this.props.settings.showChanStripFull}
/>
</div>
) : (
<div></div>
)}

{this.props.settings.showMonitorOptions >= 0 ? (
<ChannelMonitorOptions
faderIndex={this.props.settings.showMonitorOptions}
Expand Down
21 changes: 14 additions & 7 deletions server/constants/MixerProtocolInterface.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
export enum fxParamsList {
EqLowGain,
EqLowMidGain,
EqMidGain,
EqHighGain,
EqLowFreq,
EqLowMidFreq,
EqMidFreq,
EqHighFreq,
EqLowQ,
EqLowMidQ,
EqMidQ,
EqHighQ,
}
export interface IMixerProtocolGeneric {
protocol: string
fxList?: {}
Expand Down Expand Up @@ -86,13 +100,6 @@ interface IFxProtocol {
params: Array<IMixerMessageProtocol>
}

export enum fxParamsList {
EqLowGain,
EqLowMidGain,
EqMidGain,
EqHighGain,
}

export const emptyMixerMessage = (): IMixerMessageProtocol => {
return {
mixerMessage: 'none',
Expand Down
164 changes: 152 additions & 12 deletions server/constants/mixerProtocols/midasMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,94 @@ export const MidasMaster: IMixerProtocol = {
},
],
},
{
key: fxParamsList.EqLowFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/1/f',
minLabel: -15,
maxLabel: 15,
label: 'Low',
},
],
},
{
key: fxParamsList.EqLowMidFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/2/f',
minLabel: -15,
maxLabel: 15,
label: 'LoMid',
},
],
},
{
key: fxParamsList.EqMidFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/3/f',
minLabel: -15,
maxLabel: 15,
label: 'HiMid',
},
],
},
{
key: fxParamsList.EqHighFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/4/f',
minLabel: -15,
maxLabel: 15,
label: 'High',
},
],
},
{
key: fxParamsList.EqLowQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/1/q',
minLabel: -15,
maxLabel: 15,
label: 'Low Q',
},
],
},
{
key: fxParamsList.EqLowMidQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/2/q',
minLabel: -15,
maxLabel: 15,
label: 'LoMid Q',
},
],
},
{
key: fxParamsList.EqMidQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/3/q',
minLabel: -15,
maxLabel: 15,
label: 'HiMid Q',
},
],
},
{
key: fxParamsList.EqHighQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/4/q',
minLabel: -15,
maxLabel: 15,
label: 'High Q',
},
],
},
],
AUX_LEVEL: [
{
Expand Down Expand Up @@ -190,9 +278,6 @@ export const MidasMaster: IMixerProtocol = {
params: [
{
mixerMessage: '/ch/{channel}/eq/1/g',
minLabel: -15,
maxLabel: 15,
label: 'Low',
},
],
},
Expand All @@ -201,9 +286,6 @@ export const MidasMaster: IMixerProtocol = {
params: [
{
mixerMessage: '/ch/{channel}/eq/2/g',
minLabel: -15,
maxLabel: 15,
label: 'LoMid',
},
],
},
Expand All @@ -212,9 +294,6 @@ export const MidasMaster: IMixerProtocol = {
params: [
{
mixerMessage: '/ch/{channel}/eq/3/g',
minLabel: -15,
maxLabel: 15,
label: 'HiMid',
},
],
},
Expand All @@ -223,9 +302,70 @@ export const MidasMaster: IMixerProtocol = {
params: [
{
mixerMessage: '/ch/{channel}/eq/4/g',
minLabel: -15,
maxLabel: 15,
label: 'High',
},
],
},
{
key: fxParamsList.EqLowFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/1/f',
},
],
},
{
key: fxParamsList.EqLowMidFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/2/f',
},
],
},
{
key: fxParamsList.EqMidFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/3/f',
},
],
},
{
key: fxParamsList.EqHighFreq,
params: [
{
mixerMessage: '/ch/{channel}/eq/4/f',
},
],
},
{
key: fxParamsList.EqLowQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/1/q',
},
],
},
{
key: fxParamsList.EqLowMidQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/2/q',
},
],
},
{
key: fxParamsList.EqMidQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/3/q',
},
],
},
{
key: fxParamsList.EqHighQ,
params: [
{
mixerMessage: '/ch/{channel}/eq/4/q',
},
],
},
Expand Down
7 changes: 7 additions & 0 deletions server/reducers/settingsActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { ICustomPages, PageType } from './settingsReducer'
export const TOGGLE_SHOW_SETTINGS = 'TOGGLE_SHOW_SETTINGS'
export const TOGGLE_SHOW_PAGES_SETUP = 'TOGGLE_SHOW_PAGES_SETUP'
export const TOGGLE_SHOW_CHAN_STRIP = 'TOGGLE_SHOW_CHAN_STRIP'
export const TOGGLE_SHOW_CHAN_STRIP_FULL = 'TOGGLE_SHOW_CHAN_STRIP_FULL'
export const TOGGLE_SHOW_OPTION = 'TOGGLE_SHOW_OPTION'
export const TOGGLE_SHOW_MONITOR_OPTIONS = 'TOGGLE_SHOW_MONITOR_OPTIONS'
export const TOGGLE_SHOW_STORAGE = 'TOGGLE_SHOW_STORAGE'
Expand All @@ -29,6 +30,12 @@ export const storeShowChanStrip = (faderIndex: number) => {
channel: faderIndex,
}
}
export const storeShowChanStripFull = (faderIndex: number) => {
return {
type: TOGGLE_SHOW_CHAN_STRIP_FULL,
channel: faderIndex,
}
}
export const storeShowOptions = (faderIndex: number) => {
return {
type: TOGGLE_SHOW_OPTION,
Expand Down
10 changes: 10 additions & 0 deletions server/reducers/settingsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
SET_PAGE,
TOGGLE_SHOW_PAGES_SETUP,
SET_PAGES_LIST,
TOGGLE_SHOW_CHAN_STRIP_FULL,
} from '../reducers/settingsActions'

export enum PageType {
Expand All @@ -26,6 +27,7 @@ export interface ISettings {
showSettings: boolean
showPagesSetup: boolean
showChanStrip: number
showChanStripFull: number
showOptions: number | false
showMonitorOptions: number
showStorage: boolean
Expand Down Expand Up @@ -86,6 +88,7 @@ const defaultSettingsReducerState: Array<ISettings> = [
showSettings: false,
showPagesSetup: false,
showChanStrip: -1,
showChanStripFull: -1,
showOptions: false,
showMonitorOptions: -1,
showStorage: false,
Expand Down Expand Up @@ -147,6 +150,13 @@ export const settings = (
nextState[0].showChanStrip = -1
}
return nextState
case TOGGLE_SHOW_CHAN_STRIP_FULL:
if (nextState[0].showChanStripFull !== action.channel) {
nextState[0].showChanStripFull = action.channel
} else {
nextState[0].showChanStripFull = -1
}
return nextState
case TOGGLE_SHOW_MONITOR_OPTIONS:
if (nextState[0].showMonitorOptions !== action.channel) {
nextState[0].showMonitorOptions = action.channel
Expand Down

0 comments on commit 48c08de

Please sign in to comment.