Skip to content

Commit c8eec2e

Browse files
authored
Merge pull request #63 from olzzon/develop
Develop
2 parents cb38c60 + 504440f commit c8eec2e

40 files changed

+1278
-1289
lines changed

.vscode/tasks.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "start",
8+
"type": "npm",
9+
"script": "start",
10+
"problemMatcher": [
11+
"$tsc"
12+
],
13+
"isBackground": true,
14+
"promptOnClose": false
15+
}
16+
]
17+
}

README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,6 @@ To set the state send these OSC commands from you Automation to ProducersAudioMi
8080
/ch/1/mix/faderlevel - float {between 0 and 1}
8181
#### Set channel label:
8282
/ch/1/label - string {name of channel}
83-
#### Set group to PGM:
84-
/grp/1/pgm - integer: { 0 or 1 }
85-
#### Set group to PST:
86-
/grp/1/pst - integer: { 0 or 1 }
87-
#### Set group faderlevel:
88-
/grp/1/faderlevel - float {between 0 and 1}
8983
#### Crossfade between PGM and PST:
9084
/take
9185
#### Set snap 1-xx to PST:
@@ -94,10 +88,10 @@ To set the state send these OSC commands from you Automation to ProducersAudioMi
9488
/fadetoblack
9589
#### Hide or show channel strips on GUI:
9690
/ch/{value1}/visible - integer { 0 or 1 }
97-
#### Hide or show group strips on GUI:
98-
/grp/{value1}/visible - integer { 0 or 1 }
9991

10092
## Get state:
93+
#### Get full state of all channels:
94+
/state/full - returns a json string with an array of channels: { pgmOn: boolean, pstOn: boolean, faderLevel: boolean }
10195
#### Get state channel PGM:
10296
/state/ch/1/mix/pgm - returns pgm state integer { 0 or 1 }
10397
#### get state channel PST:
@@ -110,3 +104,7 @@ To set the state send these OSC commands from you Automation to ProducersAudioMi
110104
/state/ch/1/mix/pst - returns pgm state integer { 0 or 1 }
111105
#### Get state group faderlevel:
112106
/state/ch/1/mix/faderlevel - float {between 0 and 1}
107+
108+
## Check connectivity
109+
/ping/{value}
110+
_In response to a ping, sisyfos will reply with /pong and the provided value_

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
},
1111
"contributors": [
1212
{
13-
"name": "Jan Starzak",
14-
"email": "jan@superfly.tv",
15-
"url": "https://superfly.tv"
13+
"name": "Jan Starzak",
14+
"email": "jan@superfly.tv",
15+
"url": "https://superfly.tv"
1616
}
1717
],
1818
"keywords": [
@@ -32,18 +32,18 @@
3232
"build": "yarn tsc && webpack --config webpack.build.config.js --mode production",
3333
"build-now": "webpack --config webpack.build.config.js --mode production",
3434
"package": "yarn run build",
35-
"postpackage": "electron-packager ./ --out=./builds --overwrite",
35+
"postpackage": "electron-packager --overwrite ./ --out=./builds --overwrite",
3636
"package-linux": "electron-packager . sisyfos-audio-controller --overwrite --asar=true --platform=linux --arch=x64 --prune=true --out=builds",
3737
"package-win": "electron-packager . sisyfos-audio-controller --overwrite --asar=true --platform=win32 --arch=x64 --prune=true --out=builds",
3838
"package-release": "yarn package && yarn package-win && yarn package-linux"
39-
4039
},
4140
"dependencies": {
4241
"@types/hoist-non-react-statics": "^3.3.1",
4342
"@types/react-redux": "^7.0.9",
4443
"@types/react-select": "^2.0.19",
4544
"casparcg-connection": "^4.7.0",
4645
"classnames": "^2.2.6",
46+
"emberplus": "https://github.com/olzzon/tv-automation-emberplus-connection.git",
4747
"osc": "https://github.com/PieceMeta/osc.js/tarball/master",
4848
"react": "^16.8.6",
4949
"react-dom": "^16.8.6",

src/@types/emberplus/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'emberplus';

src/assets/css/ChannelSettings.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,8 @@
5959
width: 90%;
6060
font-size: 30px;
6161
line-height: 50px;
62+
}
63+
64+
.channel-settings-group > button.active {
65+
border-color: rgb(17, 0, 255);
6266
}

src/assets/css/GrpFader.css

Lines changed: 0 additions & 103 deletions
This file was deleted.

src/components/App.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { loadSnapshotState, saveSnapshotState } from '../utils/SettingsStorage';
1111
import { MixerGenericConnection } from '../utils/MixerConnection';
1212
import { AutomationConnection } from '../utils/AutomationConnection';
1313
import { HuiMidiRemoteConnection } from '../utils/HuiMidiRemoteConnection';
14+
import { MixerProtocolPresets } from '../constants/MixerProtocolPresets';
15+
1416
import { Store, AnyAction } from 'redux';
1517
import { ISettings } from '../reducers/settingsReducer';
1618
import { IChannels } from '../reducers/channelsReducer';
@@ -30,7 +32,12 @@ class App extends React.Component<IAppProps> {
3032
(window as any).automationConnection = new AutomationConnection();
3133
(window as any).huiRemoteConnection = new HuiMidiRemoteConnection();
3234
this.snapShopStoreTimer();
33-
loadSnapshotState(this.props.store.channels[0], this.props.store.settings[0].numberOfChannels);
35+
let selectedProtocol = MixerProtocolPresets[this.props.store.settings[0].mixerProtocol];
36+
let numberOfChannels: Array<number> = [];
37+
selectedProtocol.channelTypes.forEach((item, index) => {
38+
numberOfChannels.push(this.props.store.settings[0].numberOfChannelsInType[index]);
39+
});
40+
loadSnapshotState(this.props.store.channels[0], numberOfChannels);
3441
}
3542

3643
public shouldComponentUpdate(nextProps: IAppProps) {

src/components/Channel.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ import { Store } from 'redux';
77

88
//assets:
99
import '../assets/css/Channel.css';
10-
import { IMixerProtocol, MixerProtocolPresets, IMixerProtocolGeneric, ICasparCGMixerGeometry } from '../constants/MixerProtocolPresets';
11-
import { any } from 'prop-types';
10+
import { MixerProtocolPresets} from '../constants/MixerProtocolPresets';
11+
import { IMixerProtocolGeneric, ICasparCGMixerGeometry } from '../constants/MixerProtocolInterface';
12+
import { any, number } from 'prop-types';
1213

1314
interface IChannelInjectProps {
1415
pgmOn: boolean,
1516
pstOn: boolean,
1617
pflOn: boolean,
18+
channelType: number,
19+
channelTypeIndex: number,
1720
showChannel: boolean,
1821
faderLevel: number,
1922
label: string,
@@ -115,8 +118,14 @@ class Channel extends React.Component<IChannelProps & IChannelInjectProps & Stor
115118
<input className="channel-volume-slider"
116119
id="typeinp"
117120
type="range"
118-
min={this.mixerProtocol.fader.min}
119-
max={this.mixerProtocol.fader.max}
121+
min={this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_FADER_LEVEL[0].mixerMessage != 'none' ?
122+
this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_FADER_LEVEL[0].min
123+
: this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_OUT_GAIN[0].min
124+
}
125+
max={this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_FADER_LEVEL[0].mixerMessage != 'none' ?
126+
this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_FADER_LEVEL[0].max
127+
: this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_OUT_GAIN[0].max
128+
}
120129
step={this.mixerProtocol.fader.step}
121130
value= {this.props.faderLevel}
122131
onChange={event => {
@@ -220,10 +229,13 @@ class Channel extends React.Component<IChannelProps & IChannelInjectProps & Stor
220229
this.props.showChannel === false ?
221230
<div></div>
222231
:
223-
<div className={ClassNames("channel-body", {
224-
"with-snaps": this.props.showSnaps,
225-
"with-pfl": this.props.showPfl
226-
})}>
232+
<div
233+
style={{backgroundColor: this.mixerProtocol.channelTypes[this.props.channelType].channelTypeColor}}
234+
className={
235+
ClassNames("channel-body", {
236+
"with-snaps": this.props.showSnaps,
237+
"with-pfl": this.props.showPfl
238+
})}>
227239
{this.channelSettings()}
228240
{this.fader()}
229241
<VuMeter channelIndex = {this.channelIndex}/>
@@ -240,7 +252,7 @@ class Channel extends React.Component<IChannelProps & IChannelInjectProps & Stor
240252
: null
241253
}
242254
<div className="channel-name">
243-
{this.props.label != "" ? this.props.label : ("CH " + (this.channelIndex + 1)) }
255+
{this.props.label != "" ? this.props.label : (this.mixerProtocol.channelTypes[this.props.channelType].channelTypeName + " " + (this.props.channelTypeIndex + 1)) }
244256
</div>
245257
<div className="channel-snap-body">
246258
{this.props.snapOn
@@ -261,6 +273,8 @@ const mapStateToProps = (state: any, props: any): IChannelInjectProps => {
261273
pflOn: state.channels[0].channel[props.channelIndex].pflOn,
262274
showChannel: state.channels[0].channel[props.channelIndex].showChannel,
263275
faderLevel: state.channels[0].channel[props.channelIndex].faderLevel,
276+
channelType: state.channels[0].channel[props.channelIndex].channelType,
277+
channelTypeIndex: state.channels[0].channel[props.channelIndex].channelTypeIndex,
264278
label: state.channels[0].channel[props.channelIndex].label,
265279
snapOn: state.channels[0].channel[props.channelIndex].snapOn.map((item: number) => {return item}),
266280
mixerProtocol: state.settings[0].mixerProtocol,

src/components/ChannelSettings.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
import React from 'react';
22

33
import '../assets/css/ChannelSettings.css';
4-
import { IMixerProtocolGeneric, MixerProtocolPresets, ICasparCGMixerGeometry } from '../constants/MixerProtocolPresets';
4+
import { MixerProtocolPresets } from '../constants/MixerProtocolPresets';
5+
import { IMixerProtocolGeneric, ICasparCGMixerGeometry } from '../constants/MixerProtocolInterface';
56
import { Store } from 'redux';
67
import { connect } from 'react-redux';
8+
import { IStore } from '../reducers/indexReducer';
79

810
interface IChannelSettingsInjectProps {
911
label: string,
1012
mixerProtocol: string,
13+
sourceOption: string
1114
}
1215

1316
interface IChannelProps {
@@ -26,7 +29,7 @@ class ChannelSettings extends React.PureComponent<IChannelProps & IChannelSettin
2629
this.mixerProtocol = protocol;
2730
}
2831
}
29-
32+
3033
handleOption = (prop: string, option: string) => {
3134
this.props.dispatch({
3235
type: 'SET_OPTION',
@@ -54,23 +57,29 @@ class ChannelSettings extends React.PureComponent<IChannelProps & IChannelSettin
5457
return (
5558
<div className="channel-settings-group" key={prop}>
5659
{Object.getOwnPropertyNames(this.mixerProtocol!.sourceOptions!.options[prop]).map(option => {
57-
console.log(prop, option)
58-
return <button key={option} className="channel-settings-group-item" onClick={() => this.handleOption(prop, this.mixerProtocol!.sourceOptions!.options[prop][option])}>{option}</button>
60+
return <button
61+
key={option}
62+
className={"channel-settings-group-item" +
63+
(this.props.sourceOption === this.mixerProtocol!.sourceOptions!.options[prop][option] ? ' active' : '')
64+
}
65+
onClick={() => this.handleOption(prop, this.mixerProtocol!.sourceOptions!.options[prop][option])}>
66+
{option}
67+
</button>
5968
}) || null}
6069
</div>
6170
)
62-
})}
71+
})}
6372
</div>
6473
)
6574
}
6675
}
6776

6877
const mapStateToProps = (state: any, props: any): IChannelSettingsInjectProps => {
69-
console.log(state.channels[0].channel, props.channelIndex);
7078
return {
7179
label: state.channels[0].channel[props.channelIndex].label,
72-
mixerProtocol: state.settings[0].mixerProtocol
80+
mixerProtocol: state.settings[0].mixerProtocol,
81+
sourceOption: (state.channels[0].channel[props.channelIndex].private || {})['channel_layout']
7382
}
7483
}
7584

76-
export default connect<any, IChannelSettingsInjectProps>(mapStateToProps)(ChannelSettings) as any;
85+
export default connect<any, IChannelSettingsInjectProps>(mapStateToProps)(ChannelSettings) as any;

src/components/Channels.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as React from 'react';
22
import { connect } from "react-redux";
33

44
import Channel from './Channel';
5-
import GrpFader from './GrpFader';
65
import '../assets/css/Channels.css';
76
import { Store } from 'redux';
87
import { IAppProps } from './App';
@@ -14,7 +13,7 @@ class Channels extends React.Component<IAppProps & Store> {
1413
}
1514

1615
public shouldComponentUpdate(nextProps: IAppProps) {
17-
return false;
16+
return this.props.store.settings[0].showOptions !== nextProps.store.settings[0].showOptions;
1817
}
1918

2019

@@ -78,13 +77,6 @@ class Channels extends React.Component<IAppProps & Store> {
7877
/>
7978
})
8079
}
81-
{this.props.store.channels[0].grpFader.map((none: any, index: number) => {
82-
return <GrpFader
83-
faderIndex = {index}
84-
key={index}
85-
/>
86-
})
87-
}
8880
<br/>
8981
<div className="channels-mix-body">
9082
<button

0 commit comments

Comments
 (0)