Skip to content

Commit 5c9cc85

Browse files
committed
Mediator: add member current_music_section
1 parent 3aa99ee commit 5c9cc85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ly/musicxml/ly2xml_mediator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def __init__(self):
4444
self.sections = []
4545
""" default and initial values """
4646
self.insert_into = None
47+
48+
# Current music section are useful when using "\addlyrics"
49+
self.current_music_section = None
50+
4751
self.current_note = None
4852
self.current_lynote = None
4953
self.current_is_rest = False
@@ -92,6 +96,8 @@ def new_header_assignment(self, name, value):
9296
def new_section(self, name, glob=False):
9397
name = self.check_name(name)
9498
section = xml_objs.ScoreSection(name, glob)
99+
100+
self.current_music_section = section
95101
self.insert_into = section
96102
self.sections.append(section)
97103
self.bar = None
@@ -150,6 +156,8 @@ def new_part(self, pid=None, to_part=None, piano=False):
150156
self.group.partlist.append(self.part)
151157
else:
152158
self.score.partlist.append(self.part)
159+
160+
self.current_music_section = self.part
153161
self.insert_into = self.part
154162
self.bar = None
155163

0 commit comments

Comments
 (0)