コード例 #1
0
    public Note GetNextSingableNote(double currentBeat)
    {
        Note nextSingableNote = SortedSentences
                                .SelectMany(sentence => sentence.Notes)
                                // Freestyle notes are not displayed and not sung.
                                // They do not contribute to the score.
                                .Where(note => !note.IsFreestyle)
                                .Where(note => currentBeat <= note.StartBeat)
                                .OrderBy(note => note.StartBeat)
                                .FirstOrDefault();

        return(nextSingableNote);
    }
コード例 #2
0
 public void SetCurrentBeat(double currentBeat)
 {
     // Change the current display sentence, when the current beat is over its last note.
     if (displaySentenceIndex < SortedSentences.Count && currentBeat >= GetDisplaySentence().LinebreakBeat)
     {
         Sentence nextDisplaySentence      = GetUpcomingSentenceForBeat(currentBeat);
         int      nextDisplaySentenceIndex = SortedSentences.IndexOf(nextDisplaySentence);
         if (nextDisplaySentenceIndex >= 0)
         {
             SetDisplaySentenceIndex(nextDisplaySentenceIndex);
         }
     }
 }
コード例 #3
0
 public Note GetLastNoteInSong()
 {
     return(SortedSentences.Last().Notes.OrderBy(note => note.EndBeat).Last());
 }