Browse Source

Guard against race condition where a note-off gui notification comes right after the instrument has been disabled

master
Nils 2 years ago
parent
commit
4168794620
  1. 10
      qtgui/instrument.py

10
qtgui/instrument.py

@ -309,8 +309,9 @@ class InstrumentTreeController(object):
def react_instrumentStatusChanged(self, instrumentStatus:dict):
self.parentMainWindow.qtApp.restoreOverrideCursor() #Sometimes the instrument was loaded with a cursor animation
gi = self.guiInstruments[instrumentStatus["idKey"]]
gi.updateStatus(instrumentStatus)
if instrumentStatus["idKey"] in self.guiInstruments:
gi = self.guiInstruments[instrumentStatus["idKey"]]
gi.updateStatus(instrumentStatus)
self._adjustColumnSize()
#We also cache the last status, as we cache the initial data. This way we can delete and recreate TreeItems without requesting new status data from the engine
@ -327,8 +328,9 @@ class InstrumentTreeController(object):
def react_instrumentMidiNoteOnActivity(self, idKey:tuple, pitch:int, velocity:int):
#First figure out which instrument has activity
gi = self.guiInstruments[idKey]
gi.activity() #We only do a quick flash here. No need for velocity, pitch or note-off
if idKey in self.guiInstruments:
gi = self.guiInstruments[idKey]
gi.activity() #We only do a quick flash here. No need for velocity, pitch or note-off
def contextMenu(self, qpoint): #strange that this is not an event but a qpoint

Loading…
Cancel
Save