From 7c00f418caf8f1e9fcb235563127a9c8cea22bb4 Mon Sep 17 00:00:00 2001 From: Eddy Pedroni Date: Sat, 9 Nov 2024 23:29:08 +0100 Subject: Minor GUI improvement --- solo-tool-project/src/solo_tool/midi_wrapper_mido.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'solo-tool-project/src/solo_tool/midi_wrapper_mido.py') diff --git a/solo-tool-project/src/solo_tool/midi_wrapper_mido.py b/solo-tool-project/src/solo_tool/midi_wrapper_mido.py index 4cfc9c3..34f1031 100644 --- a/solo-tool-project/src/solo_tool/midi_wrapper_mido.py +++ b/solo-tool-project/src/solo_tool/midi_wrapper_mido.py @@ -12,12 +12,14 @@ class MidiWrapper: self._outPort = mido.open_output(deviceName) def disconnect(self): - self._inPort.close() - self._inPort = None + if self._inPort is not None: + self._inPort.close() + self._inPort = None - self._outPort.reset() - self._outPort.close() - self._outPort = None + if self._outPort is not None: + self._outPort.reset() + self._outPort.close() + self._outPort = None def sendMessage(self, note, velocity, channel): if self._outPort is not None: -- cgit v1.2.3