Browse Source

undo for initial key sig

master
Nils 2 years ago
parent
commit
e9fb07bd5a
  1. 3
      CHANGELOG
  2. 13
      engine/api.py

3
CHANGELOG

@ -9,12 +9,15 @@ External contributors notice at the end of the line: (LastName, FirstName / nick
Add more time signatures to the quick-insert dialog: 8/4, three variants of 7/8, two variants of 5/4 and more. Also reorder and better labels.
Fix splitting of notes that were created by a previous split.
Block Mode: Fix invisible block labels and graphics when dragging blocks (adopting to unannounced Qt regressions once again)
Barlines more visible
Undo for initial metrical instruction and key sig (track editor)
Various small fixes, like typos in variable names and wrong string quotes. Small things can crash as well.
Lilypond:
Add transposition of the whole score to properties and metadata dialog
Only set tempo markings in parenthesis when user provided a string like Allegro
Add lilypond template filename to properties and metadata dialog. Will be symlinked into the session dir automatically.
Overhaul Key Signature GUI dialog to indicate "Deviation" better, instead of absolute accidentals.
Update German translation.
## 2022-07-15 2.1.0

13
engine/api.py

@ -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")

Loading…
Cancel
Save