mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 19:23:59 +00:00
Improve handling of empty songs
This commit is contained in:
parent
4a5e1574ca
commit
83194fc368
|
@ -2288,6 +2288,8 @@ void VLSongVisitor::VisitMeasures(VLSong & song, bool performanceOrder)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
size_t e = song.CountMeasures() - song.EmptyEnding();
|
size_t e = song.CountMeasures() - song.EmptyEnding();
|
||||||
|
if (!e && song.CountMeasures())
|
||||||
|
e = 1;
|
||||||
|
|
||||||
for (size_t m=0; m!=e; ++m) {
|
for (size_t m=0; m!=e; ++m) {
|
||||||
VLMeasure & meas = song.fMeasures[m];
|
VLMeasure & meas = song.fMeasures[m];
|
||||||
|
|
|
@ -491,6 +491,11 @@ advanceAt:
|
||||||
[self readMeasuresFromPlist:[plist objectForKey:@"measures"]];
|
[self readMeasuresFromPlist:[plist objectForKey:@"measures"]];
|
||||||
[undoMgr enableUndoRegistration];
|
[undoMgr enableUndoRegistration];
|
||||||
|
|
||||||
|
if (song->fMeasures.empty()) {
|
||||||
|
delete song;
|
||||||
|
song = new VLSong(true);
|
||||||
|
}
|
||||||
|
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user