<commit_before>﻿/*
 * This file is part of alphaTab.
 * Copyright © 2018, <NAME> and Contributors, All rights reserved.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or at your option any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */
using AlphaTab.Model;
using AlphaTab.Rendering.Glyphs;

namespace AlphaTab.Rendering.Effects
{
    class MarkerEffectInfo : IEffectBarRendererInfo
    {
        public string EffectId { get { return "marker"; } }
        public bool HideOnMultiTrack { get { return true; } }
        public bool CanShareBand { get { return true; } }
        public EffectBarGlyphSizing SizingMode { get { return EffectBarGlyphSizing.SinglePreBeat; } }

        public bool ShouldCreateGlyph(Settings settings, Beat beat)
        {
            return beat.Voice.Bar.Staff.Index == 0 && beat.Voice.Index == 0 && beat.Index == 0 && beat.Voice.Bar.MasterBar.IsSectionStart;
        }
       
        public EffectGlyph CreateNewGlyph(BarRendererBase renderer, Beat beat)
        {
            return new TextGlyph(0, 0, beat.Voice.Bar.MasterBar.Section.Text, renderer.Resources.MarkerFont);
        }

        public bool CanExpand(Beat @from, Beat to)
        {
            return true;
        }
    }
}<commit_msg>Added rendering of section marker<commit_after>﻿/*
 * This file is part of alphaTab.
 * Copyright © 2018, <NAME> and Contributors, All rights reserved.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3.0 of the License, or at your option any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library.
 */
using AlphaTab.Model;
using AlphaTab.Rendering.Glyphs;

namespace AlphaTab.Rendering.Effects
{
    class MarkerEffectInfo : IEffectBarRendererInfo
    {
        public string EffectId { get { return "marker"; } }
        public bool HideOnMultiTrack { get { return true; } }
        public bool CanShareBand { get { return true; } }
        public EffectBarGlyphSizing SizingMode { get { return EffectBarGlyphSizing.SinglePreBeat; } }

        public bool ShouldCreateGlyph(Settings settings, Beat beat)
        {
            return beat.Voice.Bar.Staff.Index == 0 && beat.Voice.Index == 0 && beat.Index == 0 && beat.Voice.Bar.MasterBar.IsSectionStart;
        }
       
        public EffectGlyph CreateNewGlyph(BarRendererBase renderer, Beat beat)
        {
            return new TextGlyph(0, 0, 
                string.IsNullOrEmpty(beat.Voice.Bar.MasterBar.Section.Marker) 
                    ? beat.Voice.Bar.MasterBar.Section.Text
                    : "[" + beat.Voice.Bar.MasterBar.Section.Marker + "] " + beat.Voice.Bar.MasterBar.Section.Text, renderer.Resources.MarkerFont);
        }

        public bool CanExpand(Beat @from, Beat to)
        {
            return true;
        }
    }
}
{'fraction_non_alphanumeric': 0.07741762657380123, 'fraction_numerical': 0.005893383337798017, 'mean_word_length': 2.8024439918533606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1687574', 'n_tokens_mistral': 1020, 'n_tokens_neox': 969, 'n_words': 369}