Skip to content

Commit

Permalink
chore: cleanup old "client"-"master" mode
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Jun 4, 2020
1 parent 55bc40a commit 5bedab5
Show file tree
Hide file tree
Showing 23 changed files with 2,354 additions and 1,470 deletions.
28 changes: 28 additions & 0 deletions client/components/RoutingStorage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
SOCKET_SAVE_SNAPSHOT,
SOCKET_GET_CCG_LIST,
SOCKET_SAVE_CCG_FILE,
SOCKET_GET_MIXER_PRESET_LIST,
SOCKET_LOAD_MIXER_PRESET,
} from '../../server/constants/SOCKET_IO_DISPATCHERS'

interface IStorageProps {
Expand Down Expand Up @@ -64,6 +66,7 @@ class Storage extends React.PureComponent<IStorageProps & Store> {
}
this.handleClose()
}

loadCcgFile(event: any) {
if (window.confirm('Are you sure you will load a CasparCG setup?')) {
console.log('Setting default CasparCG file')
Expand All @@ -75,6 +78,17 @@ class Storage extends React.PureComponent<IStorageProps & Store> {
this.handleClose()
}

loadMixerPreset(event: any) {
if (window.confirm('Are you sure you will load a full Mixer setup?')) {
console.log('Loading Mixer preset')
window.socketIoClient.emit(
SOCKET_LOAD_MIXER_PRESET,
event.target.textContent
)
}
this.handleClose()
}

ListSnapshotFiles() {
window.socketIoClient.emit(SOCKET_GET_SNAPSHOT_LIST)
const listItems = window.snapshotFileList.map(
Expand Down Expand Up @@ -103,6 +117,20 @@ class Storage extends React.PureComponent<IStorageProps & Store> {
return <ul className="storage-list">{listItems}</ul>
}

ListPresetFiles() {
window.socketIoClient.emit(SOCKET_GET_MIXER_PRESET_LIST)
const listItems = window.mixerPresetList.map(
(file: string, index: number) => {
return (
<li key={index} onClick={this.loadCcgFile} className="item">
{file}
</li>
)
}
)
return <ul className="storage-list">{listItems}</ul>
}

render() {
return (
<div className="channel-storage-body">
Expand Down
3 changes: 3 additions & 0 deletions client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import indexReducer from '../server/reducers/indexReducer'
import {
SOCKET_GET_SNAPSHOT_LIST,
SOCKET_GET_CCG_LIST,
SOCKET_GET_MIXER_PRESET_LIST,
} from '../server/constants/SOCKET_IO_DISPATCHERS'

import { I18nextProvider } from 'react-i18next'
Expand All @@ -25,6 +26,7 @@ declare global {
socketIoClient: any
snapshotFileList: string[]
ccgFileList: string[]
mixerPresetList: string[]
}
}

Expand All @@ -36,6 +38,7 @@ window.storeRedux = storeRedux
window.socketIoClient = io()
window.socketIoClient.emit(SOCKET_GET_SNAPSHOT_LIST)
window.socketIoClient.emit(SOCKET_GET_CCG_LIST)
window.socketIoClient.emit(SOCKET_GET_MIXER_PRESET_LIST)

console.log('Setting up SocketIO connection')
socketClientHandlers()
Expand Down
4 changes: 4 additions & 0 deletions client/utils/SocketClientHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
SOCKET_SET_VU_REDUCTION,
SOCKET_SET_MIXER_ONLINE,
SOCKET_SET_ALL_VU,
SOCKET_RETURN_MIXER_PRESET_LIST,
} from '../../server/constants/SOCKET_IO_DISPATCHERS'

export const socketClientHandlers = () => {
Expand Down Expand Up @@ -144,4 +145,7 @@ export const socketClientHandlers = () => {
.on(SOCKET_RETURN_CCG_LIST, (payload: any) => {
window.ccgFileList = payload
})
.on(SOCKET_RETURN_MIXER_PRESET_LIST, (payload: any) => {
window.mixerPresetList = payload
})
}
18 changes: 17 additions & 1 deletion server/MainThreadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
getSnapShotList,
getCcgSettingsList,
setCcgDefault,
getMixerPresetList,
} from './utils/SettingsStorage'
import {
SOCKET_TOGGLE_PGM,
Expand Down Expand Up @@ -50,6 +51,9 @@ import {
SOCKET_SAVE_CCG_FILE,
SOCKET_SET_DELAY_TIME,
SOCKET_SHOW_IN_MINI_MONITOR,
SOCKET_GET_MIXER_PRESET_LIST,
SOCKET_RETURN_MIXER_PRESET_LIST,
SOCKET_LOAD_MIXER_PRESET,
} from './constants/SOCKET_IO_DISPATCHERS'
import {
TOGGLE_PGM,
Expand Down Expand Up @@ -162,14 +166,26 @@ export class MainThreadHandlers {
)
})
.on(SOCKET_GET_CCG_LIST, () => {
logger.info('Get snapshot list', {})
logger.info('Get CCG settings list', {})
socketServer.emit(SOCKET_RETURN_CCG_LIST, getCcgSettingsList())
})
.on(SOCKET_GET_MIXER_PRESET_LIST, () => {
logger.info('Get Preset list', {})
socketServer.emit(
SOCKET_RETURN_MIXER_PRESET_LIST,
getMixerPresetList()
)
})
.on(SOCKET_SAVE_CCG_FILE, (payload: any) => {
logger.info('Set default CCG File :' + String(payload), {})
setCcgDefault(payload)
this.updateFullClientStore()
})
.on(SOCKET_LOAD_MIXER_PRESET, (payload: any) => {
logger.info('Set default CCG File :' + String(payload), {})
mixerGenericConnection.loadMixerPreset(payload)
this.updateFullClientStore()
})
.on(SOCKET_SAVE_SETTINGS, (payload: any) => {
logger.info('Save settings :' + String(payload), {})
saveSettings(payload)
Expand Down
2 changes: 1 addition & 1 deletion server/constants/MixerProtocolInterface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface IMixerProtocolGeneric {
protocol: string
label: string
mode: string
presetFileExtension: string
FADE_DISPATCH_RESOLUTION: number
fader: {
min: number
Expand Down
3 changes: 3 additions & 0 deletions server/constants/SOCKET_IO_DISPATCHERS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export const SOCKET_GET_SNAPSHOT_LIST = 'getSnapshotList'
export const SOCKET_RETURN_SNAPSHOT_LIST = 'returnSnapshotList'
export const SOCKET_GET_CCG_LIST = 'getCcgList'
export const SOCKET_RETURN_CCG_LIST = 'returnCcgList'
export const SOCKET_GET_MIXER_PRESET_LIST = 'getMixerPresetList'
export const SOCKET_RETURN_MIXER_PRESET_LIST = 'returnMixerPresetList'
export const SOCKET_LOAD_MIXER_PRESET = 'loadMixerPreset'
export const SOCKET_LOAD_SNAPSHOT = 'loadSnapshot'
export const SOCKET_SAVE_SNAPSHOT = 'saveSnapshot'
export const SOCKET_SAVE_CCG_FILE = 'saveCcgFile'
Expand Down
157 changes: 93 additions & 64 deletions server/constants/mixerProtocols/DmxIs.ts
Original file line number Diff line number Diff line change
@@ -1,64 +1,93 @@
import { IMixerProtocol, emptyMixerMessage } from '../MixerProtocolInterface';

export const DMXIS: IMixerProtocol = {
protocol: 'OSC',
label: 'DMXIS Light Controller Protocol',
mode: "master",
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
pingResponseCommand: [emptyMixerMessage()],
pingTime: 0, //Bypass ping when pingTime is zero
initializeCommands: [emptyMixerMessage()],
channelTypes: [{
channelTypeName: 'CH',
channelTypeColor: '#3f2f2f',
fromMixer: {
CHANNEL_OUT_GAIN: [{ mixerMessage: '/dmxis/ch/{channel}', value: 0, type: 'f', min: 0, max: 1, zero: 0.75}],
CHANNEL_VU: [emptyMixerMessage()],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [emptyMixerMessage()],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
THRESHOLD: [emptyMixerMessage()],
RATIO: [emptyMixerMessage()],
DELAY_TIME: [emptyMixerMessage()],
LOW: [emptyMixerMessage()],
LO_MID: [emptyMixerMessage()],
MID: [emptyMixerMessage()],
HIGH: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()]
},
toMixer: {
CHANNEL_OUT_GAIN: [{ mixerMessage: '/dmxis/ch/{channel}', value: 0, type: 'f', min: 0, max: 1, zero: 0.75}],
CHANNEL_NAME: [{ mixerMessage: '/dmxis/ch/name/{channel}', value: 0, type: 'f', min: 0, max: 1, zero: 0.75}],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
THRESHOLD: [emptyMixerMessage()],
RATIO: [emptyMixerMessage()],
DELAY_TIME: [emptyMixerMessage()],
LOW: [emptyMixerMessage()],
LO_MID: [emptyMixerMessage()],
MID: [emptyMixerMessage()],
HIGH: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()]
},
}],
fader: {
min: 0,
max: 1,
zero: 0.75,
step: 0.01,
},
meter: {
min: 0,
max: 1,
zero: 0.75,
test: 0.6,
},
}
import { IMixerProtocol, emptyMixerMessage } from '../MixerProtocolInterface'

export const DMXIS: IMixerProtocol = {
protocol: 'OSC',
label: 'DMXIS Light Controller Protocol',
presetFileExtension: '',
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
pingResponseCommand: [emptyMixerMessage()],
pingTime: 0, //Bypass ping when pingTime is zero
initializeCommands: [emptyMixerMessage()],
channelTypes: [
{
channelTypeName: 'CH',
channelTypeColor: '#3f2f2f',
fromMixer: {
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/dmxis/ch/{channel}',
value: 0,
type: 'f',
min: 0,
max: 1,
zero: 0.75,
},
],
CHANNEL_VU: [emptyMixerMessage()],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [emptyMixerMessage()],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
THRESHOLD: [emptyMixerMessage()],
RATIO: [emptyMixerMessage()],
DELAY_TIME: [emptyMixerMessage()],
LOW: [emptyMixerMessage()],
LO_MID: [emptyMixerMessage()],
MID: [emptyMixerMessage()],
HIGH: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/dmxis/ch/{channel}',
value: 0,
type: 'f',
min: 0,
max: 1,
zero: 0.75,
},
],
CHANNEL_NAME: [
{
mixerMessage: '/dmxis/ch/name/{channel}',
value: 0,
type: 'f',
min: 0,
max: 1,
zero: 0.75,
},
],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
THRESHOLD: [emptyMixerMessage()],
RATIO: [emptyMixerMessage()],
DELAY_TIME: [emptyMixerMessage()],
LOW: [emptyMixerMessage()],
LO_MID: [emptyMixerMessage()],
MID: [emptyMixerMessage()],
HIGH: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
},
],
fader: {
min: 0,
max: 1,
zero: 0.75,
step: 0.01,
},
meter: {
min: 0,
max: 1,
zero: 0.75,
test: 0.6,
},
}
Loading

0 comments on commit 5bedab5

Please sign in to comment.