private async Task LoadScore()
        {
            _isRenderInProgress = true;
            var trackIndex = 0;

            if (!_isScoreLoaded)
            {
                _isScoreLoaded = true;
                _score         = await GetTestScore();

                //_score = await GetPopularScore();
            }

            if (_score != null)
            {
                var track = _score.Tracks[trackIndex];

                // render score with svg engine and desired rendering width
                var settings = new AlphaTab.Settings();
                settings.Core.Engine   = "skia";
                settings.Display.Scale = 1;

                var renderer = new AlphaTab.Rendering.ScoreRenderer(settings)
                {
                    Width = 970// this.Bounds.Width
                };


                var totalWidth  = 0;
                var totalHeight = 0;

                renderer.PartialRenderFinished.On(r => {
                    partialImages.Add((SKImage)r.RenderResult);
                });
                renderer.RenderFinished.On(r =>
                {
                    totalWidth  = (int)r.TotalWidth;
                    totalHeight = (int)r.TotalHeight;

                    this.Height         = totalHeight;
                    this.Width          = totalWidth;
                    _isRenderInProgress = false;
                });
                renderer.RenderScore(_score, new double[] { track.Index });
            }
        }
Beispiel #2
0
        private async Task LoadTablature(string url, int itemIndex)
        {
            try
            {
                _score = await new ScoreServiceManager().LoadScoreFromUrl(url);
            }
            catch (Exception)
            {
                await DisplayAlert("Check connection", "Tablature score could not be loaded", "OK", "Cancel");

                return;
            }

            if (_score != null)
            {
                var track = _score.Tracks[itemIndex];

                /*TablatureControl.Tracks = new[] {
                 *  track
                 * };*/
            }
        }
Beispiel #3
0
 private string NameFromScore(AlphaTab.Model.Score score)
 {
     return(score.Artist + " - " + score.Title);
 }