public void GotoSection(StyleSections section, bool instant) { MIDIMarker oldMarker = CurrentMarker; CurrentMarker = GetMarkerOnSection(section); CurrentMarker.Section = section; StyleSections nextSection = GetNextSection(CurrentMarker); NextMarker = GetMarkerOnSection(nextSection); NextMarker.Section = nextSection; if (CurrentMarker == null) { isPlaying = false; } else { isPlaying = true; Tracks[0].CurrentEventIndex = CurrentMarker.StartIndex; currentSongPosition = Tracks[0].MidiEvents[CurrentMarker.StartIndex].absTime; } if (oldMarker != CurrentMarker) { AllNotesOff(); OnSectionChangeEvent(); } }
protected StyleSections GetNextSection(MIDIMarker marker) { switch (Common.GetSectionCode(marker.Name)) { case StyleSections.Init: return(StyleSections.MainA); case StyleSections.MainA: return(StyleSections.MainA); case StyleSections.MainB: return(StyleSections.MainB); case StyleSections.FillInAB: return(StyleSections.MainB); case StyleSections.FillInBA: return(StyleSections.MainA); case StyleSections.FillInAA: return(StyleSections.MainA); case StyleSections.FillInBB: return(StyleSections.MainB); case StyleSections.IntroA: return(StyleSections.MainA); default: return(StyleSections.EndingA); } }