aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2024-11-09 23:29:08 +0100
committerEddy Pedroni <epedroni@pm.me>2024-11-09 23:29:08 +0100
commit7c00f418caf8f1e9fcb235563127a9c8cea22bb4 (patch)
tree286b790e1b1cd28d078212721f3721df7efddbcd /solo-tool-project
parentf676c50ba91ca6d4d0da9f77aeadc8b3fb16dc26 (diff)
Minor GUI improvement
Diffstat (limited to 'solo-tool-project')
-rw-r--r--solo-tool-project/src/solo_tool/midi_wrapper_mido.py12
1 files changed, 7 insertions, 5 deletions
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: