Skip to content

Commit

Permalink
feature: chennelsettings untick channel to fader
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Olsson Hans authored and Kasper Olsson Hans committed Sep 20, 2019
1 parent 84be91f commit 672f86d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 11 deletions.
14 changes: 13 additions & 1 deletion src/assets/css/ChannelRouteSettings.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
border-color: rgb(124, 124, 124);
border-style: solid;
border-width: 4px;
text-align: center;
text-align: left;
z-index: 1;

color: #fff;
Expand All @@ -21,6 +21,18 @@
margin: 0;
padding: 10px 0;
line-height: 50px;
text-align: center;

}


.channel-settings-body > h4 {
margin: 0;
margin-left: 40px;
padding: 0px 0;
line-height: 20px;
text-align: left;
font-size: 110%;
}

.channel-settings-body > .close {
Expand Down
23 changes: 13 additions & 10 deletions src/components/ChannelRouteSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ class ChannelRouteSettings extends React.PureComponent<IChannelProps & IChannelS
this.mixerProtocol = MixerProtocolPresets[this.props.selectedProtocol];
}

handleAssignChannel(index: number) {
this.props.dispatch({
type: 'SET_ASSIGNED_FADER',
handleAssignChannel(index: number, event: any) {
let faderAssign = this.faderIndex
if (event.target.checked === false) {
faderAssign = -1
}
this.props.dispatch({
type: 'SET_ASSIGNED_FADER',
channel: index,
faderNumber: this.faderIndex
});

faderNumber: faderAssign
});
return true;
}

Expand All @@ -60,15 +63,15 @@ class ChannelRouteSettings extends React.PureComponent<IChannelProps & IChannelS


{this.props.channel.map((channel: any, index: number) => {
return <div key={index}>
return <h4 key={index}>
{(" Channel " + (index + 1) + " : " )}
<input
type="checkbox"
checked={ this.props.channel[index].assignedFader === this.faderIndex }
onChange={(event) => this.handleAssignChannel(index)}
onChange={(event) => this.handleAssignChannel(index, event)}
/>
{( " (Fader " + (this.props.channel[index].assignedFader + 1) + ")")}
</div>
{this.props.channel[index].assignedFader >=0 ? ( " (Fader " + (this.props.channel[index].assignedFader + 1) + ")") : ''}
</h4>
})
}
</div>
Expand Down

0 comments on commit 672f86d

Please sign in to comment.