Skip to content

Commit

Permalink
feat: prepare change to meter pr assigned channel
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Mar 22, 2021
1 parent 878df56 commit fefa810
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
44 changes: 35 additions & 9 deletions client/components/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import VuMeter from './VuMeter'
import { Store, compose } from 'redux'
import Nouislider from 'nouislider-react'
import '../assets/css/NoUiSlider.css'
import { vuMeters } from '../utils/SocketClientHandlers'


//assets:
import '../assets/css/Channel.css'
Expand Down Expand Up @@ -133,6 +135,38 @@ class Channel extends React.Component<
this.props.dispatch(storeShowChanStrip(this.faderIndex))
}

handleVuMeter() {
if (window.mixerProtocol.protocol === 'CasparCG') {
return (
<React.Fragment>
{!window.location.search.includes('vu=0') &&
window.mixerProtocol.channelTypes[0].fromMixer.CHANNEL_VU?.map(
(_, i) => (
<VuMeter
faderIndex={this.faderIndex}
channel={i}
/>
)
)}{' '}
</React.Fragment>
)
} else {
let assignedChannels: number[] = this.props.fader.assignedChannels || [1]
return (
<React.Fragment>
{!window.location.search.includes('vu=0') && assignedChannels?.map(
(_, i) => (
<VuMeter
faderIndex={this.faderIndex}
channel={i}
/>
)
)}{' '}
</React.Fragment>
)
}
}

fader() {
const showFormat = !!window.mixerProtocol.vuLabelConversionType
const values = (showFormat && window.mixerProtocol.vuLabelValues) || [
Expand Down Expand Up @@ -396,15 +430,7 @@ class Channel extends React.Component<
{this.amixButton()}
</div>
<div className="fader">
{!window.location.search.includes('vu=0') &&
window.mixerProtocol.channelTypes[0].fromMixer.CHANNEL_VU?.map(
(_, i) => (
<VuMeter
faderIndex={this.faderIndex}
channel={i}
/>
)
)}
{this.handleVuMeter()}
{this.fader()}
</div>
<div className="out-control">
Expand Down
1 change: 1 addition & 0 deletions server/reducers/fadersReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export interface IFader {
showInMiniMonitor: boolean
ignoreAutomation: boolean
disabled: boolean
assignedChannels?: number[]

/**
* Assuming that the protocol has a "feature", can it be enabled on this fader?
Expand Down

0 comments on commit fefa810

Please sign in to comment.