From c6f07a92425f93cd3347e8f242309c5e820d4210 Mon Sep 17 00:00:00 2001 From: olzzon Date: Mon, 3 Jun 2019 12:11:01 +0200 Subject: [PATCH] feat: Hui Remote - change of fader from Sisyfos to HUI working. --- src/components/App.tsx | 9 ++++++--- src/components/Channel.tsx | 1 + src/components/Channels.tsx | 1 + src/utils/HuiMidiRemoteConnection.ts | 16 ++++++++++------ 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/App.tsx b/src/components/App.tsx index 0d8ebe87..37ab4f54 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -16,7 +16,7 @@ import { HuiMidiRemoteConnection } from '../utils/HuiMidiRemoteConnection'; class App extends Component { mixerConnection: any; automationConnection: any; - midiRemoteConnection: any; + huiRemoteConnection: any; constructor(props: any) { super(props) @@ -25,7 +25,7 @@ class App extends Component { componentWillMount() { this.mixerConnection = new MixerConnection(this.props.store); this.automationConnection = new AutomationConnection(this.mixerConnection); - this.midiRemoteConnection = new HuiMidiRemoteConnection(this.mixerConnection); + this.huiRemoteConnection = new HuiMidiRemoteConnection(this.mixerConnection); this.snapShopStoreTimer(); loadSnapshotState(this.props.store.channels[0], this.props.store.settings[0].numberOfChannels); } @@ -40,7 +40,10 @@ class App extends Component { render() { return (
- + {this.props.store.settings[0].showSettings ? :
}
) diff --git a/src/components/Channel.tsx b/src/components/Channel.tsx index bf25eb48..a46fc4ce 100644 --- a/src/components/Channel.tsx +++ b/src/components/Channel.tsx @@ -57,6 +57,7 @@ class Channel extends PureComponent { level: event.target.value }); this.mixerConnection.updateOutLevel(this.channelIndex); + this.props.huiRemoteConnection.updateRemoteFaderLevel(this.channelIndex, event.target.value) } diff --git a/src/components/Channels.tsx b/src/components/Channels.tsx index 25fde5f4..c715582d 100644 --- a/src/components/Channels.tsx +++ b/src/components/Channels.tsx @@ -75,6 +75,7 @@ class Channels extends PureComponent { channelIndex = {index} key={index} mixerConnection = { this.props.mixerConnection} + huiRemoteConnection = { this.props.huiRemoteConnection } /> }) } diff --git a/src/utils/HuiMidiRemoteConnection.ts b/src/utils/HuiMidiRemoteConnection.ts index c6dffbf9..2cd17a67 100644 --- a/src/utils/HuiMidiRemoteConnection.ts +++ b/src/utils/HuiMidiRemoteConnection.ts @@ -46,11 +46,15 @@ export class HuiMidiRemoteConnection { this.midiInput = WebMidi.getInputByName(this.store.settings[0].remoteFaderMidiInputPort); this.midiOutput = WebMidi.getOutputByName(this.store.settings[0].remoteFaderMidiOutputPort); - console.log("Remote Midi Controller connected on port") - console.log("Midi input :", this.store.settings[0].remoteFaderMidiInputPort) - console.log("Midi output :", this.store.settings[0].remoteFaderMidiOutputPort) - - this.setupRemoteFaderConnection(); + if (this.midiInput && this.midiOutput ) { + console.log("Remote Midi Controller connected on port") + console.log("Midi input :", this.store.settings[0].remoteFaderMidiInputPort) + console.log("Midi output :", this.store.settings[0].remoteFaderMidiOutputPort) + + this.setupRemoteFaderConnection(); + } else { + console.log("Remote Midi Controller not found or not configured.") + } }); } @@ -127,7 +131,7 @@ export class HuiMidiRemoteConnection { ); this.midiOutput.sendControlChange( (32+channelIndex), - 28, + 1, 1 ); }