session.history.register(lambdatr=trackId,v=track.whichPatternsAreHalftoneTransposed.copy():_setSwitchHalftoneTranspose(trackId,v),descriptionString="Set Half Tone Shift")
track.whichPatternsAreHalftoneTransposed=whichPatternsAreHalftoneTransposed#restore data
session.history.register(lambdatrId=trackId,v=track.whichPatternsAreHalftoneTransposed.copy():_setSwitchHalftoneTranspose(trId,v),descriptionString="Set Half Tone Shift")
@ -113,10 +114,11 @@ class Track(object): #injection at the bottom of this file!
#First clean all modifications from the default value.
#We test for k in self.structure to not have modifications for measures that will be switched on later
#TODO: Can this possibly lead to a race condition where we load modifications first and then load the structure, which results in the mods getting perma-deleted here. e.g. we could not set default value in init, even for testing purposes.
self.whichPatternsHaveAugmentationFactor={k:vfork,vinself.whichPatternsHaveAugmentationFactor.items()ifv!=1.0andkinself.structure}#default is 1.0
#TODO: Yes, this happened with undo. every {comprehension} had a "and if k in self.structure" at the end. We took that out without remembering what that was for.
self.whichPatternsHaveAugmentationFactor={k:vfork,vinself.whichPatternsHaveAugmentationFactor.items()ifv!=1.0}#default is 1.0
oneMeasureInTicks=(self.parentData.howManyUnits*self.parentData.whatTypeOfUnit)/self.parentData.subdivisions#subdivisions is 1 by default. bigger values mean shorter values, which is compensated by the user setting bigger howManyUnits manually.
api.session.data.setLanguageForEmptyFile(language=QtCore.QLocale().languageToString(QtCore.QLocale().language()))#TODO: this is a hack because we access the session directly. But this is also a function tied to Qts language string. Two wrongs...
self.start()#This shows the GUI, or not, depends on the NSM gui save setting. We need to call that after the menu, otherwise the about dialog will block and then we get new menu entries, which looks strange.
@ -985,11 +985,22 @@ class TrackLabelEditor(QtWidgets.QGraphicsScene):
delitem#yes, manual memory management in Python. We need to get rid of anything we want to delete later or Qt will crash because we have a python wrapper without a qt object
#Preare both on and off variants so we have a static string translation