Skip to content

Commit

Permalink
fix(CasparCG): Fixes VU meters for CasparCG
Browse files Browse the repository at this point in the history
  • Loading branch information
jesperstarkar committed Mar 26, 2020
1 parent fb0c0f8 commit 1899d1f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions server/utils/mixerConnections/CasparCGConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ const osc = require('osc')
const fs = require('fs')
import * as path from 'path';
import { CasparCG } from 'casparcg-connection'
import { socketServer } from '../../expressHandler'

//Utils:
import { store, state } from '../../reducers/store'
import { ICasparCGMixerGeometry, ICasparCGChannelLayerPair, ICasparCGMixerGeometryFile } from '../../constants/MixerProtocolInterface';
import { IChannel } from '../../reducers/channelsReducer';
import { SET_PRIVATE } from '../../reducers/channelActions'
import { SET_VU_LEVEL, SET_CHANNEL_LABEL } from '../../reducers/faderActions'
import { SOCKET_SET_VU } from '../../constants/SOCKET_IO_DISPATCHERS';
import { logger } from '../logger'

interface CommandChannelMap {
Expand Down Expand Up @@ -100,10 +102,15 @@ export class CasparCGConnection {
store.dispatch({
type: SET_VU_LEVEL,
channel: index,
// CCG returns "produced" audio levels, before the Volume mixer transform
// We therefore want to premultiply this to show useful information about audio levels
level: Math.min(1, message.args[0] * state.faders[0].fader[index].faderLevel)
level: message.args[0]
});
socketServer.emit(
SOCKET_SET_VU,
{
faderIndex: index,
level: message.args[0]
}
)
} else if (this.mixerProtocol.sourceOptions) {
const m = message.address.split('/');

Expand Down

0 comments on commit 1899d1f

Please sign in to comment.