Skip to content

Commit

Permalink
feat: Hui Remote - change of fader from Sisyfos to HUI working.
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jun 3, 2019
1 parent 97e6faa commit c6f07a9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
9 changes: 6 additions & 3 deletions src/components/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { HuiMidiRemoteConnection } from '../utils/HuiMidiRemoteConnection';
class App extends Component<any, any> {
mixerConnection: any;
automationConnection: any;
midiRemoteConnection: any;
huiRemoteConnection: any;

constructor(props: any) {
super(props)
Expand All @@ -25,7 +25,7 @@ class App extends Component<any, any> {
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);
}
Expand All @@ -40,7 +40,10 @@ class App extends Component<any, any> {
render() {
return (
<div>
<Channels mixerConnection = {this.mixerConnection} />
<Channels
mixerConnection = {this.mixerConnection}
huiRemoteConnection = { this.huiRemoteConnection }
/>
{this.props.store.settings[0].showSettings ? <Settings/> : <div></div>}
</div>
)
Expand Down
1 change: 1 addition & 0 deletions src/components/Channel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class Channel extends PureComponent<any, any> {
level: event.target.value
});
this.mixerConnection.updateOutLevel(this.channelIndex);
this.props.huiRemoteConnection.updateRemoteFaderLevel(this.channelIndex, event.target.value)
}


Expand Down
1 change: 1 addition & 0 deletions src/components/Channels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Channels extends PureComponent<any, any> {
channelIndex = {index}
key={index}
mixerConnection = { this.props.mixerConnection}
huiRemoteConnection = { this.props.huiRemoteConnection }
/>
})
}
Expand Down
16 changes: 10 additions & 6 deletions src/utils/HuiMidiRemoteConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
}
});
}

Expand Down Expand Up @@ -127,7 +131,7 @@ export class HuiMidiRemoteConnection {
);
this.midiOutput.sendControlChange(
(32+channelIndex),
28,
1,
1
);
}
Expand Down

0 comments on commit c6f07a9

Please sign in to comment.