Fix overlapping notes
More consistent CLyric Some renaming for clearer meaning
This commit is contained in:
1 parent
bf1c00b5d1
commit
55d5c61a66
11 files changed
+177
-201
No files matched your search
@@ -77,12 +77,19 @@ namespace VocaluxeLib.Songs
|
||||
_Notes.Add(note);
|
||||
else
|
||||
{
|
||||
//Insert AFTER this note
|
||||
int insPos = FindPreviousNote(note.StartBeat);
|
||||
//Check for overlapping notes
|
||||
if (insPos >= 0 && _Notes[insPos].EndBeat > note.StartBeat)
|
||||
return false;
|
||||
if (insPos < _Notes.Count - 1 && _Notes[insPos + 1].StartBeat > note.EndBeat)
|
||||
return false;
|
||||
if (insPos >= 0) //Check note before
|
||||
{
|
||||
if (_Notes[insPos].EndBeat > note.StartBeat)
|
||||
return false;
|
||||
}
|
||||
if (insPos < _Notes.Count - 1) //Check note after
|
||||
{
|
||||
if (_Notes[insPos + 1].StartBeat < note.EndBeat)
|
||||
return false;
|
||||
}
|
||||
_Notes.Insert(insPos + 1, note);
|
||||
}
|
||||
return true;
|
||||
@@ -91,7 +98,7 @@ namespace VocaluxeLib.Songs
|
||||
public void SetMedley(int startBeat, int endBeat)
|
||||
{
|
||||
foreach (CSongNote note in _Notes.Where(note => note.StartBeat < startBeat || note.EndBeat > endBeat))
|
||||
note.NoteType = ENoteType.Freestyle;
|
||||
note.Type = ENoteType.Freestyle;
|
||||
|
||||
VisibleInTimeLine = FirstNoteBeat >= startBeat && LastNoteBeat <= endBeat;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user