diff --git a/Vocaluxe/Lib/Song/CNotes.cs b/Vocaluxe/Lib/Song/CNotes.cs index c732054e..43bb7a29 100644 --- a/Vocaluxe/Lib/Song/CNotes.cs +++ b/Vocaluxe/Lib/Song/CNotes.cs @@ -43,9 +43,7 @@ namespace Vocaluxe.Lib.Song if (Index >= _Lines.Count) return false; - CLines lines = new CLines(); - lines = Lines; - _Lines[Index] = lines; + _Lines[Index] = Lines; return true; } @@ -549,9 +547,16 @@ namespace Vocaluxe.Lib.Song #region Methods public void AddLine(CLine Line) + { + AddLine(Line, true); + } + public void AddLine(CLine Line, bool updateTimings) { _Lines.Add(Line); - UpdateTimings(); + if (updateTimings) + { + UpdateTimings(); + } } public bool InsertLine(CLine Line, int Index) @@ -581,16 +586,23 @@ namespace Vocaluxe.Lib.Song _Lines.Clear(); } - public bool AddNote(CNote Note, int LineIndex) + public bool AddNote(CNote Note, int LineIndex, bool updateTimings) { if (_Lines.Count > LineIndex) { _Lines[LineIndex].AddNote(Note); - UpdateTimings(); + if (updateTimings) + { + UpdateTimings(); + } return true; } return false; } + public bool AddNote(CNote Note, int LineIndex) + { + return AddNote(Note, LineIndex, true); + } public bool InsertNote(CNote Note, int LineIndex, int NoteIndex) { diff --git a/Vocaluxe/Lib/Song/CSong.cs b/Vocaluxe/Lib/Song/CSong.cs index 87ba20e7..60fb2049 100644 --- a/Vocaluxe/Lib/Song/CSong.cs +++ b/Vocaluxe/Lib/Song/CSong.cs @@ -463,6 +463,10 @@ namespace Vocaluxe.Lib.Song TempC = (char)c; } while ((TempC.CompareTo('E') != 0) && !sr.EndOfStream && (c == 19 || c == 16 || c == 13)); } + foreach(CLines lines in this.Notes.Lines) + { + lines.UpdateTimings(); + } } catch (Exception e) { @@ -482,11 +486,11 @@ namespace Vocaluxe.Lib.Song { CLine line = new CLine(); line.AddNote(note); - lines.AddLine(line); + lines.AddLine(line, false); } else { - lines.AddNote(note, lines.LineCount - 1); + lines.AddNote(note, lines.LineCount - 1, false); } }