Skip to content

Commit 8317496

Browse files
authored
Merge pull request #85 from olzzon/develop
feat/Next send to Aux
2 parents 71050cc + 48ed2ae commit 8317496

11 files changed

Lines changed: 84 additions & 36 deletions

src/components/Channel.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,12 @@ class Channel extends React.Component<IChannelProps & IChannelInjectProps & Stor
8787
}
8888
}
8989

90-
handlePst() {
90+
handlePst() {
9191
this.props.dispatch({
9292
type:'TOGGLE_PST',
9393
channel: this.channelIndex
9494
});
95+
window.mixerGenericConnection.updateNextAux(this.channelIndex);
9596
}
9697

9798
handlePfl() {

src/constants/mixerProtocols/SSLsystemT.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ export const SSLSystemT: IMixerProtocol = {
2222
},
2323
toMixer: {
2424
CHANNEL_FADER_LEVEL: [emptyMixerMessage()],
25-
CHANNEL_OUT_GAIN: [{ mixerMessage: "f1 06 00 80 00 00 {channel} {level}", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
25+
CHANNEL_OUT_GAIN: [{ mixerMessage: "f1 06 00 80 00 {channel} {level}", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
2626
CHANNEL_NAME: [emptyMixerMessage()],
27-
PFL_ON: [{ mixerMessage: "f1 05 00 80 05 00 {channel} 01", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
28-
PFL_OFF: [{ mixerMessage: "f1 05 00 80 05 00 {channel} 00", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
29-
AUX_SEND: [emptyMixerMessage()],
27+
PFL_ON: [{ mixerMessage: "f1 05 00 80 05 {channel} 01", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
28+
PFL_OFF: [{ mixerMessage: "f1 05 00 80 05 {channel} 00", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
29+
AUX_SEND: [{ mixerMessage: "f1 06 00 80 00 {channel} {level}", value: 0, type: '', min: 0, max: 1, zero: 0.75}],
3030
},
3131
}],
3232
fader: {

src/reducers/fadersReducer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const defaultFadersReducerState = (numberOfFaders: number) => {
3030

3131
for (let index=0; index < numberOfFaders; index++) {
3232
defaultObj[0].fader[index] = ({
33-
faderLevel: 0,
33+
faderLevel: 0.75,
3434
label: "",
3535
pgmOn: false,
3636
voOn: false,

src/utils/AutomationConnection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class AutomationConnection {
9090
pstOn: false
9191
});
9292
}
93-
window.mixerGenericConnection.updateOutLevel(ch-1);
93+
window.mixerGenericConnection.updateNextAux(ch-1);
9494
} else if ( this.checkOscCommand(message.address, this.automationProtocol.fromAutomation
9595
.CHANNEL_FADER_LEVEL)){
9696
let ch = message.address.split("/")[2];
@@ -135,7 +135,7 @@ export class AutomationConnection {
135135
window.storeRedux.dispatch({
136136
type:'FADE_TO_BLACK'
137137
});
138-
window.mixerGenericConnection.updateOutLevels();
138+
window.mixerGenericConnection.updateFadeToBlack();
139139
} else if (this.checkOscCommand(message.address, this.automationProtocol.fromAutomation
140140
.CLEAR_PST)) {
141141
window.storeRedux.dispatch({

src/utils/CasparCGConnection.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ export class CasparCGConnection {
288288
}
289289
}
290290

291+
updateNextAux(channelIndex: number, level: number) {
292+
return true
293+
}
291294

292295
updateFadeIOLevel(channelIndex: number, outputLevel: number) {
293296
if (channelIndex > this.mixerProtocol.toMixer.PGM_CHANNEL_FADER_LEVEL.length - 1) {

src/utils/EmberMixerConnection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@ export class EmberMixerConnection {
203203
}
204204
}
205205

206+
updateNextAux(channelIndex: number, level: number) {
207+
return true
208+
}
209+
206210
updateFadeIOLevel(channelIndex: number, outputLevel: number) {
207211
let channelType = this.store.channels[0].channel[channelIndex].channelType;
208212
let channelTypeIndex = this.store.channels[0].channel[channelIndex].channelTypeIndex;

src/utils/MidiMixerConnection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ return true;
172172
}
173173
}
174174

175+
updateNextAux(channelIndex: number, level: number) {
176+
return true
177+
}
178+
175179

176180
updateFadeIOLevel(channelIndex: number, outputLevel: number) {
177181
this.sendOutMessage(

src/utils/MixerConnection.ts

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ export class MixerGenericConnection {
5555
this.fadeActiveTimer = new Array(this.store.channels[0].channel.length);
5656
}
5757

58+
updateFadeToBlack() {
59+
this.store.faders[0].fader.map((channel: any, index: number) => {
60+
this.updateOutLevel(index);
61+
});
62+
}
63+
5864
updateOutLevels() {
5965
this.store.faders[0].fader.map((channel: any, index: number) => {
6066
this.updateOutLevel(index);
67+
this.updateNextAux(index);
6168
});
6269
}
6370

@@ -70,22 +77,34 @@ export class MixerGenericConnection {
7077
}
7178
}
7279

73-
this.store.channels[0].channel.map((channel: IChannel, index: number) => {
80+
this.store.channels[0].channel.map((channel: IChannel, channelIndex: number) => {
7481
if (faderIndex === channel.assignedFader) {
75-
this.fadeInOut(index, fadeTime);
76-
//this.mixerConnection.updateOutLevel(index);
82+
this.fadeInOut(channelIndex, fadeTime);
7783
}
7884
})
7985
if (window.huiRemoteConnection) {
8086
window.huiRemoteConnection.updateRemoteFaderState(faderIndex, this.store.faders[0].fader[faderIndex].faderLevel)
8187
}
8288
}
8389

84-
8590
updatePflState(channelIndex: number) {
8691
this.mixerConnection.updatePflState(channelIndex);
8792
}
8893

94+
updateNextAux(faderIndex: number) {
95+
let level = 0
96+
if (this.store.faders[0].fader[faderIndex].pstOn) {
97+
level = this.store.faders[0].fader[faderIndex].faderLevel
98+
} else if (this.store.faders[0].fader[faderIndex].pstVoOn) {
99+
level = this.store.faders[0].fader[faderIndex].faderLevel * (100-parseFloat(this.store.settings[0].voLevel))/100
100+
}
101+
this.store.channels[0].channel.map((channel: IChannel, channelIndex: number) => {
102+
if (faderIndex === channel.assignedFader) {
103+
this.mixerConnection.updateNextAux(channelIndex, level)
104+
}
105+
})
106+
}
107+
89108
updateChannelName(channelIndex: number) {
90109
this.mixerConnection.updateChannelName(channelIndex);
91110
}
@@ -110,6 +129,12 @@ export class MixerGenericConnection {
110129

111130
fadeInOut (channelIndex: number, fadeTime: number){
112131
let faderIndex = this.store.channels[0].channel[channelIndex].assignedFader
132+
if (!this.store.faders[0].fader[faderIndex].pgmOn
133+
&& !this.store.faders[0].fader[faderIndex].voOn
134+
&& this.store.channels[0].channel[channelIndex].outputLevel === 0
135+
) {
136+
return
137+
}
113138
//Clear Old timer or set Fade to active:
114139
if (this.store.channels[0].channel[channelIndex].fadeActive) {
115140
clearInterval(this.fadeActiveTimer[channelIndex]);

src/utils/OscMixerConnection.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ export class OscMixerConnection {
253253
}
254254
}
255255

256+
updateNextAux(channelIndex: number, level: number) {
257+
return true
258+
}
259+
260+
256261
updateFadeIOLevel(channelIndex: number, outputLevel: number) {
257262
let channelType = this.store.channels[0].channel[channelIndex].channelType;
258263
let channelTypeIndex = this.store.channels[0].channel[channelIndex].channelTypeIndex;

src/utils/QlClMixerConnection.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,10 @@ export class QlClMixerConnection {
219219
}
220220
}
221221

222+
updateNextAux(channelIndex: number, level: number) {
223+
return true
224+
}
225+
222226
updateFadeIOLevel(channelIndex: number, outputLevel: number) {
223227
let channelType = this.store.channels[0].channel[channelIndex].channelType;
224228
let channelTypeIndex = this.store.channels[0].channel[channelIndex].channelTypeIndex;

0 commit comments

Comments
 (0)