From ad563753743ebcf4378dc975dbc492e82aec55f7 Mon Sep 17 00:00:00 2001 From: STEPHANVS Date: Mon, 5 Jul 2021 15:43:32 +0200 Subject: [PATCH] Support "add" in chord suffix, support song key definition with "=" --- openlp/core/display/render.py | 2 +- openlp/plugins/songs/lib/__init__.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/openlp/core/display/render.py b/openlp/core/display/render.py index 551bce5ef..721a316a1 100644 --- a/openlp/core/display/render.py +++ b/openlp/core/display/render.py @@ -48,7 +48,7 @@ ENGLISH_NOTES = '[CDEFGAB]?' GERMAN_NOTES = '[CDEFGABH]?' NEOLATIN_NOTES = '(Do|Re|Mi|Fa|Sol|La|Si)?' CHORD_PREFIXES = '(=|\\(|\\|)*?' -CHORD_SUFFIXES = '(b|bb|#|##|x|-|m|maj|min|sus|dim|0|1|2|3|4|5|6|7|8|9|\\))*?' +CHORD_SUFFIXES = '(b|bb|#|##|x|-|m|maj|min|sus|dim|add|0|1|2|3|4|5|6|7|8|9|\\))*?' SLIM_CHARS = 'fiíIÍjlĺľrtť.,;/ ()|"\'!:\\' CHORD_TEMPLATE = '{chord}' FIRST_CHORD_TEMPLATE = '{chord}' diff --git a/openlp/plugins/songs/lib/__init__.py b/openlp/plugins/songs/lib/__init__.py index 1bcd3a714..05fc43225 100644 --- a/openlp/plugins/songs/lib/__init__.py +++ b/openlp/plugins/songs/lib/__init__.py @@ -640,6 +640,12 @@ def transpose_chord(chord, transpose_value, notation): current_chord = current_chord[1:] else: current_chord = '' + if current_chord and current_chord[0] == '=': + transposed_chord += '=' + if len(current_chord) > 1: + current_chord = current_chord[1:] + else: + current_chord = '' if len(current_chord) > 0: if len(current_chord) > 1: if '#b'.find(current_chord[1]) == -1: