Skip to content

Commit

Permalink
feat: Inputselector buttons and Gain is only visible when added to mi…
Browse files Browse the repository at this point in the history
…xerprotocol.
  • Loading branch information
olzzon authored and olzzon committed Jun 9, 2020
1 parent c886066 commit 7d69ef7
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 117 deletions.
106 changes: 56 additions & 50 deletions client/components/ChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
SOCKET_SET_HIGH,
SOCKET_SET_AUX_LEVEL,
SOCKET_SET_INPUT_GAIN,
SOCKET_SET_INPUT_SELECTOR
SOCKET_SET_INPUT_SELECTOR,
} from '../../server/constants/SOCKET_IO_DISPATCHERS'
import CcgChannelInputSettings from './CcgChannelSettings'
import ReductionMeter from './ReductionMeter'
Expand Down Expand Up @@ -74,7 +74,7 @@ class ChanStrip extends React.PureComponent<
channel: -1,
})
}
handleInputSelect(selected:number) {
handleInputSelect(selected: number) {
window.socketIoClient.emit(SOCKET_SET_INPUT_SELECTOR, {
faderIndex: this.props.faderIndex,
selected: selected,
Expand Down Expand Up @@ -147,60 +147,69 @@ class ChanStrip extends React.PureComponent<
})
}

inputSelectorButton(index: number) {
return (
<button
className="input-select"
onClick={() => {
this.handleInputSelect(index + 1)
}}
>
{window.mixerProtocol.channelTypes[0].toMixer
.CHANNEL_INPUT_SELECTOR
? window.mixerProtocol.channelTypes[0].toMixer
.CHANNEL_INPUT_SELECTOR[index].label
: null}
</button>
)
}

inputSelector() {
return(
return (
<div className="input-buttons">
<button
className="input-select"
onClick={() => {
this.handleInputSelect(1)
}}
>
L-L
</button>
<button
className="input-select"
onClick={() => {
this.handleInputSelect(2)
}}
>
L-R
</button>
<button
className="input-select"
onClick={() => {
this.handleInputSelect(3)
}}
>
R-R
</button>
</div>
{window.mixerProtocol.channelTypes[0].toMixer
.CHANNEL_INPUT_SELECTOR ? (
<React.Fragment>
{window.mixerProtocol.channelTypes[0].toMixer.CHANNEL_INPUT_SELECTOR.map(
(none: any, index: number) => {
return this.inputSelectorButton(index)
}
)}
</React.Fragment>
) : null}
</div>
)

}

inputGain() {
return (
<div className="parameter-text">
Gain
<ReactSlider
className="chan-strip-fader"
thumbClassName="chan-strip-thumb"
orientation="vertical"
invert
min={0}
max={1}
step={0.01}
value={this.props.fader[this.props.faderIndex].inputGain}
onChange={(event: any) => {
this.handleInputGain(event)
}}
/>
{window.mixerProtocol.channelTypes[0].toMixer
.CHANNEL_INPUT_GAIN ? (
<React.Fragment>
<ReactSlider
className="chan-strip-fader"
thumbClassName="chan-strip-thumb"
orientation="vertical"
invert
min={0}
max={1}
step={0.01}
value={
this.props.fader[this.props.faderIndex]
.inputGain
}
onChange={(event: any) => {
this.handleInputGain(event)
}}
/>
</React.Fragment>
) : null}
</div>
)
}


threshold() {
return (
<div className="parameter-text">
Expand Down Expand Up @@ -254,7 +263,7 @@ class ChanStrip extends React.PureComponent<
delay() {
return (
<React.Fragment>
<div className="parameter-text">
<div className="parameter-text">
{Math.round(
500 *
(this.props.fader[this.props.faderIndex]
Expand Down Expand Up @@ -456,20 +465,17 @@ class ChanStrip extends React.PureComponent<
return (
<div className="parameters">
<div className="group-text">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
INPUT
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INPUT
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
COMPRESSOR
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COMPRESSOR
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DELAY
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DELAY
</div>

<div className="inp-comp-del-group">
Expand Down
3 changes: 2 additions & 1 deletion client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import {

import { I18nextProvider } from 'react-i18next'
import i18n from './i18n'
import { IMixerProtocol } from '../server/constants/MixerProtocolInterface'

declare global {
interface Window {
storeRedux: any
mixerProtocol: any
mixerProtocol: IMixerProtocol
mixerProtocolPresets: any
mixerProtocolList: any
socketIoClient: any
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/DmxIs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const DMXIS: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#3f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/dmxis/ch/{channel}',
Expand Down Expand Up @@ -45,8 +43,6 @@ export const DMXIS: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/dmxis/ch/{channel}',
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/LawoMC2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const LawoMC2: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down Expand Up @@ -55,8 +53,6 @@ export const LawoMC2: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/LawoRelayVrx4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const LawoRelayVrx4: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down Expand Up @@ -55,8 +53,6 @@ export const LawoRelayVrx4: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/LawoRuby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const LawoRuby: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down Expand Up @@ -55,8 +53,6 @@ export const LawoRuby: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/SSLsystemT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ export const SSLSystemT: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [emptyMixerMessage()], // Handled by SSLMixerconnection
CHANNEL_VU: [emptyMixerMessage()], // Not implemented in SSL Automation protocol yet
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
Expand Down Expand Up @@ -54,8 +52,6 @@ export const SSLSystemT: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: 'f1 06 00 80 00 {channel} {level}',
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/StuderOnAirEmber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ export const StuderOnAirMaster: IMixerProtocol = {
channelTypeName: 'MONO',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down Expand Up @@ -156,8 +154,6 @@ CH 96:7f 8f ff fe d9 5c 80 30 80 a4 19 31 17 a1 15 31 13 bf 60 10 31 0e a6 0c 31
*/

toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down
12 changes: 0 additions & 12 deletions server/constants/mixerProtocols/StuderVistaEmber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export const StuderVistaMaster: IMixerProtocol = {
channelTypeName: 'MONO',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: 'a1 a1 {ch-type} {channel} a1 a2 e1',
Expand Down Expand Up @@ -113,8 +111,6 @@ export const StuderVistaMaster: IMixerProtocol = {
],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
// 7f 8f ff fe d9 5c 80 30 80 a1 25 31 23 a1 21 31 1f a1 1d 31 1b a1 19 31 17 {a3} 15 31 13 a1 11 31 0f a2 0d 31 0b e1 09 31 07 63 {05 09 03 c0 06 13 00 00 00 00}
Expand Down Expand Up @@ -188,8 +184,6 @@ export const StuderVistaMaster: IMixerProtocol = {
channelTypeName: 'ST',
channelTypeColor: '#3f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down Expand Up @@ -228,8 +222,6 @@ export const StuderVistaMaster: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
// 7f 8f ff fe d9 5c 80 30 80 a1 25 31 23 a1 21 31 1f a1 1d 31 1b a2 19 31 17 b9 15 31 13 a1 11 31 0f a2 0d 31 0b e1 09 31 07 63 05 09 03 80 03 05 00 00 00 00
Expand Down Expand Up @@ -302,8 +294,6 @@ export const StuderVistaMaster: IMixerProtocol = {
channelTypeName: 'Inp X',
channelTypeColor: '#2f3f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down Expand Up @@ -342,8 +332,6 @@ export const StuderVistaMaster: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage:
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/ardourMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ export const ArdourMaster: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/strip/fader/{channel}',
Expand Down Expand Up @@ -90,8 +88,6 @@ export const ArdourMaster: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/strip/fader/{channel}',
Expand Down
2 changes: 0 additions & 2 deletions server/constants/mixerProtocols/behringerXrMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,6 @@ export const BehringerXrMaster: IMixerProtocol = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/ch/{channel}/mix/fader',
Expand Down
4 changes: 0 additions & 4 deletions server/constants/mixerProtocols/casparCGMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: 'none',
Expand Down Expand Up @@ -163,8 +161,6 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: 'none',
Expand Down
Loading

0 comments on commit 7d69ef7

Please sign in to comment.