Skip to content

Commit

Permalink
feat(midi): Adds handling of MIDI devices
Browse files Browse the repository at this point in the history
Fixes #256
  • Loading branch information
2xAA committed Oct 18, 2018
1 parent dd33cd9 commit 3dd4ba7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/extra/midi-assignment/assigner.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ function generateMidiAssigner(settings) {
},

handleInput(message) {
const data = message.data;
const { data, currentTarget: { id } } = message;
const midiChannel = parseInt(data[1], 10);

if (this.learning) {
this.set(midiChannel, { variable: this.toLearn, value: null });
this.set(midiChannel, { deviceId: id, variable: this.toLearn, value: null });
Vue.$toast.open({
message: `Learned MIDI control for ${this.toLearn.replace(',', '.')}`,
type: 'is-success',
Expand All @@ -80,7 +80,7 @@ function generateMidiAssigner(settings) {
}

const assignment = this.get(midiChannel);
if (assignment && this.messageCallback) {
if (assignment && this.messageCallback && assignment.deviceId === id) {
this.messageCallback({
midiChannel,
assignment,
Expand Down

0 comments on commit 3dd4ba7

Please sign in to comment.