AddStave() public method

public AddStave ( AlphaTab.Model.Track track, Staff staff ) : void
track AlphaTab.Model.Track
staff Staff
return void
Esempio n. 1
0
        protected StaveGroup CreateEmptyStaveGroup()
        {
            var group = new StaveGroup();
            group.Layout = this;

            var isFirstTrack = true;
            for (var i = 0; i < Renderer.Tracks.Length; i++)
            {
                var track = Renderer.Tracks[i];
                for (var j = 0; j < Renderer.Settings.Staves.Count; j++)
                {
                    var s = Renderer.Settings.Staves[j];
                    if (Environment.StaveFactories.ContainsKey(s.Id))
                    {
                        var factory = Environment.StaveFactories[s.Id](this);
                        if (factory.CanCreate(track) && (isFirstTrack || !factory.HideOnMultiTrack))
                        {
                            group.AddStave(track, new Stave(s.Id, factory, s.AdditionalSettings));
                        }
                    }
                }
                isFirstTrack = false;
            }
            return group;
        }
Esempio n. 2
0
        protected StaveGroup CreateEmptyStaveGroup()
        {
            var group = new StaveGroup();
            group.Layout = this;

            var isFirstTrack = true;
            for (var trackIndex = 0; trackIndex < Renderer.Tracks.Length; trackIndex++)
            {
                var track = Renderer.Tracks[trackIndex];
                for (int staveIndex = 0; staveIndex < track.Staves.Count; staveIndex++)
                {
                    for (var renderStaveIndex = 0; renderStaveIndex < Renderer.Settings.Staves.Count; renderStaveIndex++)
                    {
                        var s = Renderer.Settings.Staves[renderStaveIndex];
                        if (Environment.StaveFactories.ContainsKey(s.Id))
                        {
                            var factory = Environment.StaveFactories[s.Id](this);
                            if (factory.CanCreate(track) && (isFirstTrack || !factory.HideOnMultiTrack) && (staveIndex == 0 || !factory.HideOnMultiTrack))
                            {
                                group.AddStave(track, new Staff(track.Staves[staveIndex], s.Id, factory, s.AdditionalSettings));
                            }
                        }
                    }
                }
                isFirstTrack = false;
            }
            return group;
        }