aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/known-issues.md7
-rw-r--r--gui-project/src/solo_tool_gui.py4
-rw-r--r--solo-tool-project/src/solo_tool/midi_wrapper_mido.py12
3 files changed, 14 insertions, 9 deletions
diff --git a/doc/known-issues.md b/doc/known-issues.md
index 7604811..e87a3fc 100644
--- a/doc/known-issues.md
+++ b/doc/known-issues.md
@@ -16,10 +16,6 @@
* skip ahead and behind by steps of a few seconds
* set A and B points at current play head position (during playback)
-* GUI feature requests:
- * wipe LED state when application closes
-
-
# Closed Issues
* Moving AB sliders does not set AB limit. Instead need to save AB limit and then select it to apply
@@ -41,6 +37,9 @@
* close application without crashing
* wipe LED state when application closes
+* GUI feature requests:
+ * wipe LED state when application closes
+
# Use Cases
## Song/solo practice
diff --git a/gui-project/src/solo_tool_gui.py b/gui-project/src/solo_tool_gui.py
index 0488f84..cd73c9a 100644
--- a/gui-project/src/solo_tool_gui.py
+++ b/gui-project/src/solo_tool_gui.py
@@ -231,6 +231,10 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if event.key() == Qt.Key_Super_L:
self.soloTool.jumpToA()
+ def closeEvent(self, event):
+ self.midiController.disconnect()
+ event.accept()
+
def main():
app = QApplication([])
app.setApplicationName("Solo Tool")
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: