Skip to content

Commit

Permalink
feat: full chstrip - Delay fader uses fxParam
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Oct 29, 2020
1 parent 61300dc commit 55d7de4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 85 deletions.
45 changes: 1 addition & 44 deletions client/components/ChanStrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,52 +195,9 @@ class ChanStrip extends React.PureComponent<
)
}
delay() {
let maxLabel: number =
window.mixerProtocol.channelTypes[0].fromMixer[
fxParamsList.DelayTime
][0].maxLabel ?? 1
let minLabel =
window.mixerProtocol.channelTypes[0].fromMixer[
fxParamsList.DelayTime
][0].minLabel ?? 0
return (
<React.Fragment>
<div className="parameter-text">
Time
<div className="parameter-mini-text">
{maxLabel + ' ms'}
</div>
<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][
fxParamsList.DelayTime
]?.[0] || 0
}
renderThumb={(props: any, state: any) => (
<div {...props}>
{Math.round(
(maxLabel - minLabel) *
parseFloat(state.valueNow) +
minLabel
)}
ms
</div>
)}
onChange={(event: any) => {
this.handleFx(fxParamsList.DelayTime, event)
}}
/>
<div className="parameter-mini-text">
{minLabel + ' ms'}
</div>
</div>
{this.fxParamFader(fxParamsList.DelayTime)}
<div className="delayButtons">
<button
className="delayTime"
Expand Down
42 changes: 1 addition & 41 deletions client/components/ChanStripFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,49 +432,9 @@ class ChanStripFull extends React.PureComponent<
)
}
delay() {
let maxLabel: number =
window.mixerProtocol.channelTypes[0].fromMixer[fxParamsList.DelayTime][0]
.maxLabel ?? 1
let minLabel =
window.mixerProtocol.channelTypes[0].fromMixer[fxParamsList.DelayTime][0]
.minLabel ?? 0
return (
<React.Fragment>
<div className="parameter-text">
Time
<div className="parameter-mini-text">
{maxLabel + ' ms'}
</div>
<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][fxParamsList.DelayTime] ||
0
}
renderThumb={(props: any, state: any) => (
<div {...props}>
{Math.round(
(maxLabel - minLabel) *
parseFloat(state.valueNow) +
minLabel
)}
ms
</div>
)}
onChange={(event: any) => {
this.handleFx(fxParamsList.DelayTime, event)
}}
/>
<div className="parameter-mini-text">
{minLabel + ' ms'}
</div>
</div>
{this.fxParamFader(fxParamsList.DelayTime)}
<div className="delayButtons">
<button
className="delayTime"
Expand Down

0 comments on commit 55d7de4

Please sign in to comment.