Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Score"/> class.
 /// </summary>
 public Score()
 {
     MasterBars          = new FastList <MasterBar>();
     Tracks              = new FastList <Track>();
     _currentRepeatGroup = new RepeatGroup();
     Album            = Artist = Copyright =
         Instructions = Music = Notices = SubTitle = Title = Words = Tab = TempoLabel = "";
     Tempo            = 120;
     Stylesheet       = new RenderStylesheet();
 }
Ejemplo n.º 2
0
        internal void RebuildRepeatGroups()
        {
            var currentGroup = new RepeatGroup();

            foreach (var bar in MasterBars)
            {
                // if the group is closed only the next upcoming header can
                // reopen the group in case of a repeat alternative, so we
                // remove the current group
                if (bar.IsRepeatStart || _currentRepeatGroup.IsClosed && bar.AlternateEndings <= 0)
                {
                    currentGroup = new RepeatGroup();
                }

                currentGroup.AddMasterBar(bar);
            }
        }
Ejemplo n.º 3
0
        internal void AddMasterBar(MasterBar bar)
        {
            bar.Score = this;
            bar.Index = MasterBars.Count;
            if (MasterBars.Count != 0)
            {
                bar.PreviousMasterBar = MasterBars[MasterBars.Count - 1];
                bar.PreviousMasterBar.NextMasterBar = bar;
                bar.Start = bar.PreviousMasterBar.Start + bar.PreviousMasterBar.CalculateDuration();
            }

            // if the group is closed only the next upcoming header can
            // reopen the group in case of a repeat alternative, so we
            // remove the current group
            if (bar.IsRepeatStart || _currentRepeatGroup.IsClosed && bar.AlternateEndings <= 0)
            {
                _currentRepeatGroup = new RepeatGroup();
            }

            _currentRepeatGroup.AddMasterBar(bar);
            MasterBars.Add(bar);
        }