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): def react_instrumentStatusChanged(self, instrumentStatus:dict):
self.parentMainWindow.qtApp.restoreOverrideCursor() #Sometimes the instrument was loaded with a cursor animation self.parentMainWindow.qtApp.restoreOverrideCursor() #Sometimes the instrument was loaded with a cursor animation
gi = self.guiInstruments[instrumentStatus["idKey"]] if instrumentStatus["idKey"] in self.guiInstruments:
gi.updateStatus(instrumentStatus) gi = self.guiInstruments[instrumentStatus["idKey"]]
gi.updateStatus(instrumentStatus)
self._adjustColumnSize() 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 #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): def react_instrumentMidiNoteOnActivity(self, idKey:tuple, pitch:int, velocity:int):
#First figure out which instrument has activity #First figure out which instrument has activity
gi = self.guiInstruments[idKey] if idKey in self.guiInstruments:
gi.activity() #We only do a quick flash here. No need for velocity, pitch or note-off 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 def contextMenu(self, qpoint): #strange that this is not an event but a qpoint

Loading…
Cancel
Save