Make CSingNotes also implement Draw()

Also a bit refactoring
This commit is contained in:
Flamefire committed 2014-10-22 22:00:25 +02:00
1 parent 6bf8a5d64c
commit 2f99cd2560
17 files changed
+489 -697

No files matched your search

+8 -3
View File
@@ -80,10 +80,15 @@ namespace VocaluxeLib.Songs
get { return _Voices.Count; }
}
public CVoice GetVoice(int index)
public CVoice GetVoice(int index, bool add = false)
{
while (index >= _Voices.Count)
_Voices.Add(new CVoice());
if (add)
{
while (index >= _Voices.Count)
_Voices.Add(new CVoice());
}
else if (index >= _Voices.Count)
return null;
return _Voices[index];
}
+2 -2
View File
@@ -768,13 +768,13 @@ namespace VocaluxeLib.Songs
private bool _AddNote(int player, CSongNote note)
{
CVoice voice = _Song.Notes.GetVoice(player);
CVoice voice = _Song.Notes.GetVoice(player, true);
return voice.AddNote(note, false);
}
private bool _NewSentence(int player, int start)
{
CVoice voice = _Song.Notes.GetVoice(player);
CVoice voice = _Song.Notes.GetVoice(player, true);
return voice.AddLine(start);
}
}