diff --git a/client/assets/css/Channels.css b/client/assets/css/Channels.css index 9b4d6383..1819d6e8 100644 --- a/client/assets/css/Channels.css +++ b/client/assets/css/Channels.css @@ -48,6 +48,13 @@ background-color: #2f475b; } +.button-all-manual.all { + background-color: #af39b9; +} +.button-all-manual.any { + border-color: #af39b9; +} + .channels-mix-body { display: flex; flex-direction: column; diff --git a/client/components/Channel.tsx b/client/components/Channel.tsx index 6bb101b9..e2e2acaa 100644 --- a/client/components/Channel.tsx +++ b/client/components/Channel.tsx @@ -38,6 +38,10 @@ interface IChannelProps { faderIndex: number } +function XOR(a: any, b: any): boolean { + return (a && !b) || (b && !a) +} + class Channel extends React.Component< IChannelProps & IChannelInjectProps & Store > { @@ -69,7 +73,12 @@ class Channel extends React.Component< nextProps.settings.showPfl != this.props.settings.showPfl || nextProps.settings.showChanStrip != this.props.settings.showChanStrip || - nextProps.fader.amixOn != this.props.fader.amixOn + nextProps.fader.amixOn != this.props.fader.amixOn || + XOR(nextProps.fader.capabilities, this.props.fader.capabilities) || + XOR( + nextProps.fader.capabilities?.hasAMix, + this.props.fader.capabilities?.hasAMix + ) ) } diff --git a/client/components/Channels.tsx b/client/components/Channels.tsx index 4baaf971..272932d8 100644 --- a/client/components/Channels.tsx +++ b/client/components/Channels.tsx @@ -21,6 +21,7 @@ import { SOCKET_NEXT_MIX, SOCKET_CLEAR_PST, SOCKET_RESTART_SERVER, + SOCKET_TOGGLE_ALL_MANUAL, } from '../../server/constants/SOCKET_IO_DISPATCHERS' interface IChannelsInjectProps { @@ -48,7 +49,11 @@ class Channels extends React.Component { this.props.faders.length !== nextProps.faders.length || this.props.settings.currentPage !== nextProps.settings.currentPage || - this.props.settings.pageLength !== nextProps.settings.pageLength + this.props.settings.pageLength !== nextProps.settings.pageLength || + !!nextProps.faders.find( + (f, i) => + this.props.faders[i].ignoreAutomation !== f.ignoreAutomation + ) ) } @@ -60,6 +65,10 @@ class Channels extends React.Component { window.socketIoClient.emit(SOCKET_CLEAR_PST) } + handleAllManual() { + window.socketIoClient.emit(SOCKET_TOGGLE_ALL_MANUAL) + } + handleReconnect() { if (window.confirm('Are you sure you will restart server?')) { window.socketIoClient.emit(SOCKET_RESTART_SERVER) @@ -163,6 +172,34 @@ class Channels extends React.Component { ) } + renderAllManualButton() { + // TODO - ignore disabled / hidden faders? + const isAllManual = + this.props.faders.find((f) => f.ignoreAutomation !== true) === + undefined + const isAnyManual = !!this.props.faders.find( + (f) => f.ignoreAutomation === true + ) + + console.log('all manual', isAllManual, 'any manual', isAnyManual) + + return ( + + + + ) + } + renderFaders() { const curPage = this.props.settings.currentPage const pageLength = this.props.settings.pageLength @@ -295,6 +332,7 @@ class Channels extends React.Component { )}
+ {this.renderAllManualButton()} {!this.props.settings.showPfl && (