|
|
@ -1955,7 +1955,17 @@ def insertMetricalInstruction(treeOfInstructions, lilypondOverride = None): |
|
|
|
|
|
|
|
|
|
|
|
def setInitialMetricalInstruction(treeOfInstructions, lilypondOverride:str=None): |
|
|
|
"""Variation of insertMetricalInstruction to set the initial one for ALL tracks""" |
|
|
|
"""Variation of insertMetricalInstruction to set the initial one for ALL tracks. |
|
|
|
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. |
|
|
|
def registeredUndoFunction(): |
|
|
|
setInitialMetricalInstruction(oldInitial.treeOfInstructions, oldInitial.lilypondParameters["override"]) |
|
|
|
session.history.register(registeredUndoFunction, descriptionString=f"Initial Metrical Instruction") |
|
|
|
callbacks._historyChanged() |
|
|
|
|
|
|
|
#New one |
|
|
|
item = items.MetricalInstruction(treeOfInstructions) |
|
|
|
|
|
|
|
if lilypondOverride: |
|
|
|