Skip to content

Commit

Permalink
fix(casparcg): calculate proper VU level
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Nov 10, 2020
1 parent f196cc1 commit ee89d7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/utils/mixerConnections/CasparCGConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { storeSetChPrivate } from '../../reducers/channelActions'
import { storeFaderLabel, storeVuLevel } from '../../reducers/faderActions'
import { logger } from '../logger'
import { SOCKET_SET_VU } from '../../constants/SOCKET_IO_DISPATCHERS'
import { dbToFloat, floatToDB } from './LawoRubyConnection'

interface CommandChannelMap {
[key: string]: number
Expand Down Expand Up @@ -99,6 +100,9 @@ export class CasparCGConnection {
}

setupMixerConnection() {
const calcVuLevel = (level: number) => {
return dbToFloat(20 * Math.log(level) + 12)
}
if (!this.oscClient) {
const remotePort =
parseInt(
Expand All @@ -123,7 +127,7 @@ export class CasparCGConnection {
store.dispatch(storeVuLevel(index, message.args[0]))
socketServer.emit(SOCKET_SET_VU, {
faderIndex: index,
level: message.args[0],
level: calcVuLevel(message.args[0]),
})
} else if (this.mixerProtocol.sourceOptions) {
const m = message.address.split('/')
Expand Down

0 comments on commit ee89d7c

Please sign in to comment.