Skip to content

Commit ce7da9d

Browse files
committed
Fix #324232: after a MIDI export without expanding repeats, those are not played in the current session anymore either
Backport of musescore#8979
1 parent 1a49f55 commit ce7da9d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

libmscore/rendermidi.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,11 +2309,13 @@ void Score::renderMidi(EventMap* events, const SynthesizerState& synthState)
23092309

23102310
void Score::renderMidi(EventMap* events, bool metronome, bool expandRepeats, const SynthesizerState& synthState)
23112311
{
2312+
bool expandRepeatsBackup = masterScore()->expandRepeats();
23122313
masterScore()->setExpandRepeats(expandRepeats);
23132314
MidiRenderer::Context ctx(synthState);
23142315
ctx.metronome = metronome;
23152316
ctx.renderHarmony = true;
23162317
MidiRenderer(this).renderScore(events, ctx);
2318+
masterScore()->setExpandRepeats(expandRepeatsBackup);
23172319
}
23182320

23192321
void MidiRenderer::renderScore(EventMap* events, const Context& ctx)

libmscore/score.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1335,6 +1335,7 @@ class MasterScore : public Score {
13351335
void setPlaylistClean() { _playlistDirty = false; }
13361336

13371337
void setExpandRepeats(bool expandRepeats);
1338+
bool expandRepeats() const { return _expandRepeats; }
13381339
void updateRepeatListTempo();
13391340
virtual const RepeatList& repeatList() const override;
13401341
virtual const RepeatList& repeatList2() const override;

0 commit comments

Comments
 (0)