Skip to content

Commit

Permalink
fix: casparcg online status
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Jan 26, 2021
1 parent 4be630b commit b0c079d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions server/utils/mixerConnections/CasparCGConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { logger } from '../logger'
import { dbToFloat, floatToDB } from './LawoRubyConnection'
import { IFader } from '../../reducers/fadersReducer'
import { sendVuLevel, VuType } from '../vuServer'
import { storeSetMixerOnline } from '../../reducers/settingsActions'
import { SOCKET_SET_MIXER_ONLINE } from '../../constants/SOCKET_IO_DISPATCHERS'

interface CommandChannelMap {
[key: string]: number
Expand Down Expand Up @@ -59,9 +61,21 @@ export class CasparCGConnection {
this.connection.onConnected = () => {
logger.info('CasparCG connected')
this.setupMixerConnection()

store.dispatch(storeSetMixerOnline(this.mixerIndex, true))
socketServer.emit(SOCKET_SET_MIXER_ONLINE, {
mixerIndex: this.mixerIndex,
mixerOnline: true,
})
}
this.connection.onDisconnected = () => {
logger.info('CasparCG disconnected')

store.dispatch(storeSetMixerOnline(this.mixerIndex, false))
socketServer.emit(SOCKET_SET_MIXER_ONLINE, {
mixerIndex: this.mixerIndex,
mixerOnline: false,
})
}
this.connection.connect()

Expand Down

0 comments on commit b0c079d

Please sign in to comment.