public override void DoLayout()
 {
     _helpers = Staff.StaveGroup.Helpers.Helpers[Bar.Staff.Track.Index][Bar.Staff.Index][Bar.Index];
     base.DoLayout();
     Height = Staff.GetSetting("rhythm-height", 24) * Scale;
     IsEmpty = false;
 }
Exemple #2
0
        public void BuildHelpers(Track[] tracks, int barIndex)
        {
            for (int i = 0; i < tracks.Length; i++)
            {
                var t = tracks[i];
                FastList <FastDictionary <int, BarHelpers> > h;
                if (!Helpers.ContainsKey(t.Index))
                {
                    h = new FastList <FastDictionary <int, BarHelpers> >();
                    for (int s = 0; s < t.Staves.Count; s++)
                    {
                        h.Add(new FastDictionary <int, BarHelpers>());
                    }
                    Helpers[t.Index] = h;
                }
                else
                {
                    h = Helpers[t.Index];
                }

                for (int s = 0; s < t.Staves.Count; s++)
                {
                    if (!h[s].ContainsKey(barIndex))
                    {
                        h[s][barIndex] = new BarHelpers(t.Staves[s].Bars[barIndex]);
                    }
                }
            }
        }
Exemple #3
0
 public override void DoLayout()
 {
     _helpers = Stave.StaveGroup.Helpers.Helpers[Bar.Track.Index][Bar.Index];
     base.DoLayout();
     Height = LineOffset * (Bar.Track.Tuning.Length - 1) + (NumberOverflow * 2);
     if (Index == 0)
     {
         Stave.RegisterStaveTop(NumberOverflow);
         Stave.RegisterStaveBottom(Height - NumberOverflow);
     }
 }
        public void BuildHelpers(Track[] tracks, int barIndex)
        {
            for (int i = 0; i < tracks.Length; i++)
            {
                var t = tracks[i];
                FastDictionary <int, BarHelpers> h;
                if (!Helpers.ContainsKey(t.Index))
                {
                    h = new FastDictionary <int, BarHelpers>();
                    Helpers[t.Index] = h;
                }
                else
                {
                    h = Helpers[t.Index];
                }

                if (!h.ContainsKey(barIndex))
                {
                    h[barIndex] = new BarHelpers(t.Bars[barIndex]);
                }
            }
        }
Exemple #5
0
        public override void DoLayout()
        {
            _helpers = Stave.StaveGroup.Helpers.Helpers[Bar.Track.Index][Bar.Index];
            base.DoLayout();


            Height = (LineOffset * 4) + TopPadding + BottomPadding;
            if (Index == 0)
            {
                Stave.RegisterStaveTop(GlyphOverflow);
                Stave.RegisterStaveBottom(Height - GlyphOverflow);
            }

            var top = GetScoreY(0);
            var bottom = GetScoreY(8);

            for (int i = 0, j = _helpers.BeamHelpers.Count; i < j; i++)
            {
                var v = _helpers.BeamHelpers[i];
                for (int k = 0, l = v.Count; k < l; k++)
                {
                    var h = v[k];
                    //
                    // max note (highest) -> top overflow
                    // 
                    var maxNoteY = GetScoreY(GetNoteLine(h.MaxNote));
                    if (h.Direction == BeamDirection.Up)
                    {
                        maxNoteY -= GetStemSize(h.MaxDuration);
                    }

                    if (maxNoteY < top)
                    {
                        RegisterOverflowTop(Math.Abs(maxNoteY));
                    }

                    //
                    // min note (lowest) -> bottom overflow
                    //
                    var minNoteY = GetScoreY(GetNoteLine(h.MinNote));
                    if (h.Direction == BeamDirection.Down)
                    {
                        minNoteY += GetStemSize(h.MaxDuration);
                    }

                    if (minNoteY > bottom)
                    {
                        RegisterOverflowBottom(Math.Abs(minNoteY) - bottom);
                    }
                }
            }
        }
Exemple #6
0
        public void BuildHelpers(Track[] tracks, int barIndex)
        {
            for (int i = 0; i < tracks.Length; i++)
            {
                var t = tracks[i];
                FastDictionary<int, BarHelpers> h;
                if (!Helpers.ContainsKey(t.Index))
                {
                    h = new FastDictionary<int, BarHelpers>();
                    Helpers[t.Index] = h;
                }
                else
                {
                    h = Helpers[t.Index];
                }

                if (!h.ContainsKey(barIndex))
                {
                    h[barIndex] = new BarHelpers(t.Bars[barIndex]);
                }
            }
        }
        public void BuildHelpers(Track[] tracks, int barIndex)
        {
            for (int i = 0; i < tracks.Length; i++)
            {
                var t = tracks[i];
                FastList<FastDictionary<int, BarHelpers>> h;
                if (!Helpers.ContainsKey(t.Index))
                {
                    h = new FastList<FastDictionary<int, BarHelpers>>();
                    for (int s = 0; s < t.Staves.Count; s++)
                    {
                        h.Add(new FastDictionary<int, BarHelpers>());
                    }
                    Helpers[t.Index] = h;
                }
                else
                {
                    h = Helpers[t.Index];
                }

                for (int s = 0; s < t.Staves.Count; s++)
                {
                    if (!h[s].ContainsKey(barIndex))
                    {
                        h[s][barIndex] = new BarHelpers(t.Staves[s].Bars[barIndex]);
                    }
                }
            }
        }