Browse Source

Add checks to prevent a lot of redundant calls

master
Nils 1 year ago
parent
commit
77734b2042
  1. 3
      engine/pattern.py
  2. 17
      qtgui/songeditor.py

3
engine/pattern.py

@ -332,7 +332,10 @@ class Pattern(object):
except KeyError:
pass
#The following is only executed if the pattern was not cached yet
#If uncertain if the cache works print cacheHash to see what is really different. This function is called more than once per pattern sometimes, which is correct.
#print (cacheHash)
oneMeasureInTicks = howManyUnits * whatTypeOfUnit
oneMeasureInTicks /= subdivisions #subdivisions is 1 by default. bigger values mean shorter durations, which is compensated by the user setting bigger howManyUnits manually.

17
qtgui/songeditor.py

@ -804,30 +804,29 @@ class Switch(QtWidgets.QGraphicsRectItem):
if not bscale == self.scaleTranspose:
api.setSwitchScaleTranspose(self.parentTrackStructure.exportDict["id"], self.position, bscale) #we flip the polarity here. The receiving flip is done in the callback.
#new transpose/buffer gets set via callback
if bscale == 0:
self.scaleTransposeOff()
if bscale == 0:
self.scaleTransposeOff()
#Halftone Transpose. Independent of Scale Transpose
if not bhalftone == self.halftoneTranspose:
api.setSwitchHalftoneTranspose(self.parentTrackStructure.exportDict["id"], self.position, bhalftone) #half tone transposition is not flipped
#new transpose/buffer gets set via callback
if bhalftone == 0:
self.halftoneTransposeOff()
if bhalftone == 0:
self.halftoneTransposeOff()
#Step Delay. Also independent.
if not bdelay == self.stepDelay:
api.setSwitchStepDelay(self.parentTrackStructure.exportDict["id"], self.position, bdelay)
#new value/buffer gets set via callback
if bdelay == 0:
self.stepDelayOff()
if bdelay == 0:
self.stepDelayOff()
#Augmentation Factor. Interconnected... nah, just joking. Independent of the other stuff.
if not baugment == self.augmentationFactor:
api.setSwitchAugmentationsFactor(self.parentTrackStructure.exportDict["id"], self.position, baugment)
#new value/buffer gets set via callback
if baugment == 1.0:
self.augmentationFactorOff()
if baugment == 1.0:
self.augmentationFactorOff()
def deprecated_wheelEvent(self, event):
#We now use dedicated keyboard shortcuts and not the mousewheel anymore.

Loading…
Cancel
Save