From 8ddee033eb1aab92aaecddb39370f6c5478b302f Mon Sep 17 00:00:00 2001 From: bordun Date: Fri, 5 Feb 2021 18:34:19 +0100 Subject: [PATCH] midi: display an error when the midi bridge process crashes and prevent further errors when attempting to send messages --- CHANGELOG.md | 5 ++++- src/server/midi.js | 8 ++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ee048dd..61029659 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,11 @@ ## 1.8.4 +- midi + - display an error when the midi bridge process crashes and prevent further errors when attempting to send messages + - ui - - hide the console toggle button when the bottom panel is minimized and the editor is disabled + - hide the console toggle button when the bottom panel is minimized and the editor is disabled - widgets - file: add `mode` property, for choosing between `open` and `save` modes diff --git a/src/server/midi.js b/src/server/midi.js index f33d626c..a1017459 100644 --- a/src/server/midi.js +++ b/src/server/midi.js @@ -43,10 +43,18 @@ class MidiConverter { } }) + this.running = true + this.py.childProcess.on('exit', (code)=>{ + if (code === null) console.error(`(ERROR, MIDI) Midi bridge process crashed`) + this.running = false + }) + } send(data) { + if (!this.running) return + var args = [] for (let i in data.args) { args.push(data.args[i].value)