Skip to content

Commit

Permalink
fix: HUI remote - change test order of midi message so it checks for …
Browse files Browse the repository at this point in the history
…fader change before test for button
  • Loading branch information
olzzon committed Jun 3, 2019
1 parent df620b9 commit 38a71f7
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/utils/HuiMidiRemoteConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ export class HuiMidiRemoteConnection {
setupRemoteFaderConnection() {
this.midiInput.addListener(this.midiReceiveTypes[this.remoteProtocol.fromRemote.CHANNEL_FADER_LEVEL.type], undefined,
(message: any) => {
if (message.data[1] = 15) {
if (message.data[1] < 9) {
//Fader changed:
console.log("Received Fader message (" + message.data + ").");
window.storeRedux.dispatch({
type:'SET_FADER_LEVEL',
channel: message.data[1],
level: this.convertFromRemoteLevel(message.data[2])
});
this.mixerConnection.updateOutLevel(message.data[1]);
this.updateRemoteFaderState(message.data[1], this.convertFromRemoteLevel(message.data[2]))
} else if (message.data[1] = 15) {
if (message.data[2]<9) {
//Set active channel for next midi message:
this.activeHuiChannel = message.data[2];
Expand All @@ -84,17 +94,6 @@ export class HuiMidiRemoteConnection {
this.updateRemotePgmPstPfl(this.activeHuiChannel);
}
}
if (message.data[1] < 9) {
//Fader changed:
console.log("Received Fader message (" + message.data + ").");
window.storeRedux.dispatch({
type:'SET_FADER_LEVEL',
channel: message.data[1],
level: this.convertFromRemoteLevel(message.data[2])
});
this.mixerConnection.updateOutLevel(message.data[1]);
this.updateRemoteFaderState(message.data[1], this.convertFromRemoteLevel(message.data[2]))
}
}
);
//for testing:
Expand Down

0 comments on commit 38a71f7

Please sign in to comment.