Do not add line before first line

Calculate start beat automatically
More stable note loading with better warnings
This commit is contained in:
Flamefire committed 2013-10-11 14:50:29 +02:00
1 parent ee6aaebfbc
commit bbe8cfbe08
3 files changed
+100 -77

No files matched your search

+15 -5
View File
@@ -127,9 +127,18 @@ namespace VocaluxeLib.Songs
if (lineIndex < 0)
{
//Note is before ALL lines
var line = new CSongLine {StartBeat = note.StartBeat};
line.AddNote(note);
_Lines.Insert(0, line);
if (_Lines.Count > 0)
{
//Add to first line
if (!_Lines[0].AddNote(note))
return false;
}
else
{
var line = new CSongLine();
line.AddNote(note);
_Lines.Add(line);
}
}
else
{
@@ -157,8 +166,9 @@ namespace VocaluxeLib.Songs
{
CSongNote lastNote;
if (_Lines.Count > 0)
_Lines[0].StartBeat = -10000;
if (_Lines.Count == 0)
return;
_Lines[0].StartBeat = -10000;
for (int i = 1; i < _Lines.Count; i++)
{