Skip to content

Commit 148a856

Browse files
authored
Merge pull request #82 from olzzon/develop
Individual VO fadeTime, and Route-All buttons
2 parents 8d8a766 + 09ae478 commit 148a856

File tree

7 files changed

+142
-58
lines changed

7 files changed

+142
-58
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
"build-now": "webpack --config webpack.build.config.js --mode production",
3434
"package": "yarn run build",
3535
"postpackage": "electron-packager --overwrite ./ --out=./builds --overwrite",
36-
"package-linux": "electron-packager . sisyfos-audio-controller --overwrite --asar=true --platform=linux --arch=x64 --prune=true --out=builds",
37-
"package-win": "electron-packager . sisyfos-audio-controller --overwrite --asar=true --platform=win32 --arch=x64 --prune=true --out=builds",
36+
"package-linux": "electron-packager . sisyfos-audio-controller --overwrite --asar --platform=linux --arch=x64 --prune=true --out=builds",
37+
"package-win": "electron-packager . sisyfos-audio-controller --overwrite --asar --platform=win32 --arch=x64 --prune=true --out=builds",
3838
"package-release": "yarn package && yarn package-win && yarn package-linux"
3939
},
4040
"dependencies": {

src/assets/css/Channel.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,10 @@
159159
width: 460px;
160160
margin-top: 260px;
161161
transform: translate(-160px, 0px) rotate(270deg);
162-
163162
/*do same for other browsers if required*/
164163
background-color: rgb(39, 39, 39);
164+
165+
-webkit-overflow-scrolling: touch;
165166
}
166167

167168
.channel-body.with-snaps .channel-volume-slider {
Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.channel-settings-body {
1+
.channel-route-body {
22
position: absolute;
33
top: 50%;
44
left: 50%;
@@ -16,7 +16,7 @@
1616
color: #fff;
1717
}
1818

19-
.channel-settings-body > h2 {
19+
.channel-route-body > h2 {
2020
border-bottom: 1px solid #999;
2121
margin: 0;
2222
padding: 10px 0;
@@ -26,7 +26,7 @@
2626
}
2727

2828

29-
.channel-settings-body > h4 {
29+
.channel-route-body > h4 {
3030
margin: 0;
3131
margin-left: 40px;
3232
padding: 0px 0;
@@ -35,7 +35,7 @@
3535
font-size: 110%;
3636
}
3737

38-
.channel-settings-body > .close {
38+
.channel-route-body > .close {
3939
position: absolute;
4040
outline : none;
4141
border-color: rgb(99, 99, 99);
@@ -47,32 +47,22 @@
4747
height: 50px;
4848
font-size: 30px;
4949
line-height: 50px;
50-
top: 9px;
50+
top: -5px;
5151
right: 9px;
5252
}
5353

54-
.channel-settings-group {
55-
border-bottom: 1px solid #999;
56-
}
57-
58-
.channel-settings-group > button {
54+
.channel-route-body > button {
5955
line-height: 10px;
60-
6156
outline : none;
6257
border-color: rgb(99, 99, 99);
6358
background-color: rgb(27, 27, 27);
64-
margin-right: auto;
59+
margin-right: 10px;
6560
margin-top: 15px;
6661
margin-bottom: 15px;
67-
margin-left: auto;
62+
margin-left: 10px;
6863
border-radius: 7px;
69-
display: block;
7064
color: #fff;
71-
width: 90%;
72-
font-size: 30px;
65+
width: 34%;
66+
font-size: 10px;
7367
line-height: 50px;
7468
}
75-
76-
.channel-settings-group > button.active {
77-
border-color: rgb(17, 0, 255);
78-
}

src/components/ChannelRouteSettings.tsx

Lines changed: 83 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import CcgChannelSettings from './CcgChannelSettings';
99
const { dialog } = require('electron').remote;
1010

1111
interface IChannelSettingsInjectProps {
12-
label: string,
12+
label: string,
1313
selectedProtocol: string,
1414
numberOfChannelsInType: Array<number>,
1515
channel: Array<any>
1616
fader: Array<any>
1717
}
1818

1919
interface IChannelProps {
20-
faderIndex: number
20+
faderIndex: number
2121
}
2222

2323
class ChannelRouteSettings extends React.PureComponent<IChannelProps & IChannelSettingsInjectProps & Store> {
@@ -26,21 +26,21 @@ class ChannelRouteSettings extends React.PureComponent<IChannelProps & IChannelS
2626

2727
constructor(props: any) {
2828
super(props);
29-
this.faderIndex = this.props.faderIndex;
30-
this.mixerProtocol = MixerProtocolPresets[this.props.selectedProtocol];
29+
this.faderIndex = this.props.faderIndex;
30+
this.mixerProtocol = MixerProtocolPresets[this.props.selectedProtocol];
3131
}
3232

3333
handleAssignChannel(channel: number, event: any) {
3434
let faderAssign = this.faderIndex
3535
let assignedFader = this.props.channel[channel].assignedFader
36-
let assignedFaderLabel = (assignedFader >= 0)
37-
? this.props.fader[assignedFader].label
36+
let assignedFaderLabel = (assignedFader >= 0)
37+
? this.props.fader[assignedFader].label
3838
: 'undefined'
39-
assignedFaderLabel = (assignedFaderLabel === '')
39+
assignedFaderLabel = (assignedFaderLabel === '')
4040
? String(assignedFader + 1)
4141
: assignedFaderLabel
4242

43-
if (event.target.checked === false) {
43+
if (event.target.checked === false) {
4444
const options = {
4545
type: 'question',
4646
buttons: ['Yes', 'Cancel'],
@@ -56,8 +56,8 @@ class ChannelRouteSettings extends React.PureComponent<IChannelProps & IChannelS
5656
faderAssign = -1
5757
} else {
5858
let detail = (assignedFader < 0) ? 'NOT CURRENTLY ASSIGNED'
59-
: 'CHANNEL ' + String(channel + 1) + ' IS CURRENTLY CONNECTED TO FADER ' + String(assignedFaderLabel)
60-
59+
: 'CHANNEL ' + String(channel + 1) + ' IS CURRENTLY CONNECTED TO FADER ' + String(assignedFaderLabel)
60+
6161
const options = {
6262
type: 'question',
6363
buttons: ['Yes', 'Cancel'],
@@ -80,36 +80,92 @@ class ChannelRouteSettings extends React.PureComponent<IChannelProps & IChannelS
8080
return true;
8181
}
8282

83-
handleClose = () => {
84-
this.props.dispatch({
85-
type: 'TOGGLE_SHOW_OPTION',
86-
channel: this.faderIndex
87-
});
88-
}
83+
handleClearRouting() {
84+
const options = {
85+
type: 'question',
86+
buttons: ['Yes', 'Cancel'],
87+
defaultId: 1,
88+
title: 'WARNING',
89+
message: 'WARNING!!!!!',
90+
detail: 'This will remove all Fader-Channel assignments',
91+
};
92+
let response = dialog.showMessageBoxSync(options)
93+
if (response === 0) {
94+
this.props.channel.forEach((channel: any, index: number) => {
95+
this.props.dispatch({
96+
type: 'SET_ASSIGNED_FADER',
97+
channel: index,
98+
faderNumber: -1
99+
});
100+
})
101+
}
102+
return true
103+
}
104+
105+
handle11Routing() {
106+
const options = {
107+
type: 'question',
108+
buttons: ['Yes', 'Cancel'],
109+
defaultId: 1,
110+
title: 'WARNING',
111+
message: 'WARNING!!!!!',
112+
detail: 'This will reassign all Faders 1:1 to Channels',
113+
};
114+
let response = dialog.showMessageBoxSync(options)
115+
if (response === 0) {
116+
this.props.fader.forEach((fader: any, index: number) => {
117+
if (this.props.channel.length > index) {
118+
this.props.dispatch({
119+
type: 'SET_ASSIGNED_FADER',
120+
channel: index,
121+
faderNumber: index
122+
});
123+
}
124+
})
125+
}
126+
return true
127+
}
128+
129+
handleClose = () => {
130+
this.props.dispatch({
131+
type: 'TOGGLE_SHOW_OPTION',
132+
channel: this.faderIndex
133+
});
134+
}
89135

90136
render() {
91137
if (this.props.selectedProtocol.includes("caspar")) {
92138
return (
93-
<CcgChannelSettings channelIndex= {this.props.faderIndex}/>
94-
)
95-
}
139+
<CcgChannelSettings channelIndex={this.props.faderIndex} />
140+
)
141+
}
96142
else {
97143
return (
98-
<div className="channel-settings-body">
144+
<div className="channel-route-body">
99145
<h2>{this.props.label || ("FADER " + (this.faderIndex + 1))}</h2>
100-
<button className="close" onClick={() => this.handleClose()}>X</button>
101-
102-
146+
<button
147+
className="close"
148+
onClick={() => this.handleClose()}
149+
>X</button>
150+
<button
151+
className="button"
152+
onClick={() => this.handleClearRouting()}
153+
>CLEAR ALL</button>
154+
<button
155+
className="button"
156+
onClick={() => this.handle11Routing()}
157+
>ROUTE 1:1</button>
158+
<hr />
103159
{this.props.channel.map((channel: any, index: number) => {
104160
return <h4 key={index}>
105-
{(" Channel " + (index + 1) + " : " )}
161+
{(" Channel " + (index + 1) + " : ")}
106162
<input
107163
type="checkbox"
108-
checked={ this.props.channel[index].assignedFader === this.faderIndex }
164+
checked={this.props.channel[index].assignedFader === this.faderIndex}
109165
onChange={(event) => this.handleAssignChannel(index, event)}
110166
/>
111-
{this.props.channel[index].assignedFader >=0
112-
? ( " (Fader " + (this.props.channel[index].assignedFader + 1) + ")")
167+
{this.props.channel[index].assignedFader >= 0
168+
? (" (Fader " + (this.props.channel[index].assignedFader + 1) + ")")
113169
: ' (not assigned)'}
114170
</h4>
115171
})

src/components/Settings.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,15 @@ class Settings extends React.PureComponent<IAppProps & Store, IState> {
316316
</label>
317317
<br/>
318318
<label className="settings-input-field">
319-
FADE TIME IN ms :
319+
FADE TIME :
320320
<input name="fadeTime" type="text" value={this.state.settings.fadeTime} onChange={this.handleChange} />
321+
ms
322+
</label>
323+
<br/>
324+
<label className="settings-input-field">
325+
VOICE OVER FADE TIME :
326+
<input name="voFadeTime" type="text" value={this.state.settings.voFadeTime} onChange={this.handleChange} />
327+
ms
321328
</label>
322329
<br/>
323330
<label className="settings-input-field">
@@ -326,7 +333,12 @@ class Settings extends React.PureComponent<IAppProps & Store, IState> {
326333
%
327334
</label>
328335
<br/>
329-
336+
<label className="settings-input-field">
337+
AUTORESET LEVEL :
338+
<input name="autoResetLevel" type="text" value={this.state.settings.autoResetLevel} onChange={this.handleChange} />
339+
%
340+
</label>
341+
<br/>
330342
<label className="settings-input-field">
331343
PROTOCOL LATENCY :
332344
<input name="protocolLatency" type="text" value={this.state.settings.protocolLatency} onChange={this.handleChange} />

src/reducers/settingsReducer.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface ISettings {
1111
localOscPort: number,
1212
deviceIp: string,
1313
devicePort: number,
14-
protocolLatency: number,
14+
protocolLatency: number, // If a protocol has latency and feedback, the amount of time before enabling receiving data from channel again
1515
enableRemoteFader: boolean,
1616
mixerMidiInputPort: string,
1717
mixerMidiOutputPort: string,
@@ -20,9 +20,11 @@ export interface ISettings {
2020
numberOfChannelsInType: Array<number>,
2121
numberOfFaders: number,
2222
numberOfSnaps: number,
23-
fadeTime: number,
24-
voLevel: number,
25-
automationMode: boolean,
23+
fadeTime: number, // Default fade time for PGM ON - OFF
24+
voFadeTime: number, // Default fade time for VO ON - OFF
25+
voLevel: number, // Relative level of PGM in %
26+
autoResetLevel: number, // Autoreset before pgm on, if level is lower than in %
27+
automationMode: boolean,
2628
showPfl: boolean
2729
}
2830

@@ -48,8 +50,10 @@ const defaultSettingsReducerState: Array<ISettings> = [
4850
numberOfFaders: 8,
4951
numberOfSnaps: DEFAULTS.NUMBER_OF_SNAPS,
5052
voLevel: 20,
53+
autoResetLevel: 10,
5154
automationMode: true,
52-
fadeTime: 60, //Time in ms
55+
fadeTime: 60,
56+
voFadeTime: 200,
5357
showPfl: false
5458
},
5559
];

src/utils/MixerConnection.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,15 @@ export class MixerGenericConnection {
6161
});
6262
}
6363

64-
updateOutLevel(faderIndex: number, fadeTime: number = this.store.settings[0].fadeTime) {
64+
updateOutLevel(faderIndex: number, fadeTime: number = -1) {
65+
if (fadeTime === -1) {
66+
if (this.store.faders[0].fader[faderIndex].voOn) {
67+
fadeTime = this.store.settings[0].voFadeTime
68+
} else {
69+
fadeTime = this.store.settings[0].fadeTime
70+
}
71+
}
72+
6573
this.store.channels[0].channel.map((channel: IChannel, index: number) => {
6674
if (faderIndex === channel.assignedFader) {
6775
this.fadeInOut(index, fadeTime);
@@ -123,6 +131,19 @@ export class MixerGenericConnection {
123131
fadeUp(channelIndex: number, fadeTime: number, faderIndex: number) {
124132
let outputLevel = parseFloat(this.store.channels[0].channel[channelIndex].outputLevel);
125133
let targetVal = parseFloat(this.store.faders[0].fader[faderIndex].faderLevel);
134+
135+
// Reset targetVal if it´s lower than AutoReset threshold:
136+
if (targetVal < (this.store.settings[0].autoResetLevel/100)
137+
&& this.store.channels[0].channel[channelIndex].outputLevel === this.mixerProtocol.fader.min
138+
) {
139+
targetVal = this.mixerProtocol.fader.zero
140+
window.storeRedux.dispatch({
141+
type:'SET_FADER_LEVEL',
142+
channel: faderIndex,
143+
level: targetVal
144+
});
145+
}
146+
126147
if (this.store.faders[0].fader[faderIndex].voOn) {
127148
targetVal = targetVal * (100-parseFloat(this.store.settings[0].voLevel))/100
128149
}

0 commit comments

Comments
 (0)