Skip to content

Commit

Permalink
feat: Full channelstrip - only show eq,comp,delay if part of protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Nov 9, 2020
1 parent 26e44b5 commit 104cbbc
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 25 deletions.
5 changes: 5 additions & 0 deletions client/assets/css/ChanStripFull.css
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,14 @@
}
.content > .delayButtons {
width: 30px;
min-height: 220px;
margin-top: 24px;
margin-left: 50px;
}
.noDelayButtons {
margin-top: 24px;
min-height: 220px;
}

.delayButtons > .delayTime {
outline: none;
Expand Down
78 changes: 53 additions & 25 deletions client/components/ChanStripFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ class ChanStripFull extends React.PureComponent<
}

fxParamFader(fxParam: fxParamsList) {
if (!window.mixerProtocol.channelTypes[0].fromMixer[fxParam]) {
if (!this.doesParamExists(fxParam)) {
return
}
let maxLabel: number =
Expand Down Expand Up @@ -656,6 +656,10 @@ class ChanStripFull extends React.PureComponent<
)
}

doesParamExists(fxParam: fxParamsList): boolean {
return !!window.mixerProtocol.channelTypes[0].fromMixer[fxParam]
}

parameters() {
if (this.props.offtubeMode) {
const hasInput =
Expand All @@ -678,30 +682,50 @@ class ChanStripFull extends React.PureComponent<
</React.Fragment>
)}
<React.Fragment>
<div className="item">
<div className="title">COMPRESSOR</div>
<div className="content">
{this.fxParamFader(fxParamsList.CompThrs)}
<p className="zero-comp">______</p>
{this.fxParamFader(fxParamsList.CompRatio)}
<p className="zero-comp">______</p>
{this.gainReduction()}
{this.fxParamFader(fxParamsList.CompMakeUp)}
<p className="zero-comp">______</p>
{this.fxParamFader(fxParamsList.CompAttack)}
<p className="zero-comp">______</p>
{this.fxParamFader(fxParamsList.CompHold)}
<p className="zero-comp">______</p>
{this.fxParamFader(
fxParamsList.CompRelease
)}
<p className="zero-comp">______</p>
{this.doesParamExists(fxParamsList.CompThrs) ? (
<div className="item">
<div className="title">COMPRESSOR</div>
<div className="content">
{this.fxParamFader(
fxParamsList.CompThrs
)}
<p className="zero-comp">______</p>
{this.fxParamFader(
fxParamsList.CompRatio
)}
<p className="zero-comp">______</p>
{this.gainReduction()}
{this.fxParamFader(
fxParamsList.CompMakeUp
)}
<p className="zero-comp">______</p>
{this.fxParamFader(
fxParamsList.CompAttack
)}
<p className="zero-comp">______</p>
{this.fxParamFader(
fxParamsList.CompHold
)}
<p className="zero-comp">______</p>
{this.fxParamFader(
fxParamsList.CompRelease
)}
<p className="zero-comp">______</p>
</div>
</div>
</div>
<div className="item">
<div className="title">DELAY</div>
<div className="content">{this.delay()}</div>
</div>
) : (
<React.Fragment></React.Fragment>
)}
{this.doesParamExists(fxParamsList.DelayTime) ? (
<div className="item">
<div className="title">DELAY</div>
<div className="content">
{this.delay()}
</div>
</div>
) : (
<div className="noDelayButtons"></div>
)}
<div className="item">
<div className="title">
{this.props.label ||
Expand All @@ -728,7 +752,11 @@ class ChanStripFull extends React.PureComponent<
</div>
<React.Fragment>
<hr />
<div className="horizontal">{this.eq()}</div>
{this.doesParamExists(fxParamsList.EqGain01) ? (
<div className="horizontal">{this.eq()}</div>
) : (
<React.Fragment></React.Fragment>
)}
</React.Fragment>
</div>
)
Expand Down

0 comments on commit 104cbbc

Please sign in to comment.