|
|
@ -1864,7 +1864,16 @@ def insertKeySignature(root:int, scheme:list, lilypondOverride:str=None): |
|
|
|
insertItem(keysig) |
|
|
|
|
|
|
|
def setInitialKeySignatures(root:int, scheme:list, lilypondOverride:str=None): |
|
|
|
"""Variation of insertKeySignature to set the initial key sig for ALL tracks""" |
|
|
|
"""Variation of insertKeySignature to set the initial key sig for ALL tracks |
|
|
|
Undo depends on it that all tracks have the same initial.""" |
|
|
|
#Undo |
|
|
|
oldInitial = session.data.tracks[0].initialKeySignature.copy() #the first tracks one is the same as all track |
|
|
|
def registeredUndoFunction(): |
|
|
|
setInitialKeySignatures(oldInitial.root, oldInitial.deviationFromMajorScale, oldInitial.lilypondParameters["override"]) |
|
|
|
session.history.register(registeredUndoFunction, descriptionString=f"Initial Key Signature") |
|
|
|
callbacks._historyChanged() |
|
|
|
|
|
|
|
#New one |
|
|
|
keysig = items.KeySignature(root, scheme) |
|
|
|
if lilypondOverride: |
|
|
|
keysig.lilypondParameters["override"] = lilypondOverride |
|
|
@ -1959,7 +1968,7 @@ def setInitialMetricalInstruction(treeOfInstructions, lilypondOverride:str=None) |
|
|
|
Undo depends on it that all tracks have the same initial.""" |
|
|
|
|
|
|
|
#Undo |
|
|
|
oldInitial = session.data.tracks[0].initialMetricalInstruction #the first one is the same as all. |
|
|
|
oldInitial = session.data.tracks[0].initialMetricalInstruction.copy() #the first tracks one is the same as all tracks |
|
|
|
def registeredUndoFunction(): |
|
|
|
setInitialMetricalInstruction(oldInitial.treeOfInstructions, oldInitial.lilypondParameters["override"]) |
|
|
|
session.history.register(registeredUndoFunction, descriptionString=f"Initial Metrical Instruction") |
|
|
|