aboutsummaryrefslogtreecommitdiffstats
path: root/solo-tool-project/src/solo_tool/midi_wrapper_mido.py
diff options
context:
space:
mode:
Diffstat (limited to 'solo-tool-project/src/solo_tool/midi_wrapper_mido.py')
-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: