Effect-Glyphs implementing this public interface get notified as they are expanded over multiple beats.
상속: Glyph
예제 #1
0
        private void AlignGlyph(EffectBarGlyphSizing sizing, int beatIndex, int voiceIndex, EffectGlyph prevGlyph)
        {
            EffectGlyph g = _effectGlyphs[voiceIndex][beatIndex];
            Glyph pos;
            var container = GetBeatContainer(voiceIndex, beatIndex);
            switch (sizing)
            {
                case EffectBarGlyphSizing.SinglePreBeatOnly:
                    pos = container.PreNotes;
                    g.X = pos.X + container.X;
                    g.Width = pos.Width;
                    break;

                case EffectBarGlyphSizing.SinglePreBeatToOnBeat:
                    pos = container.PreNotes;
                    g.X = pos.X + container.X;
                    pos = container.OnNotes;
                    g.Width = (pos.X + container.X + pos.Width) - g.X;
                    break;

                case EffectBarGlyphSizing.SinglePreBeatToPostBeat:
                    pos = container.PreNotes;
                    g.X = pos.X + container.X;
                    pos = container.PostNotes;
                    g.Width = (pos.X + container.X + pos.Width) - g.X;
                    break;

                case EffectBarGlyphSizing.SingleOnBeatOnly:
                    pos = container.OnNotes;
                    g.X = pos.X + container.X;
                    g.Width = pos.Width;
                    break;

                case EffectBarGlyphSizing.SingleOnBeatToPostBeat:
                    pos = container.OnNotes;
                    g.X = pos.X + container.X;
                    pos = container.PostNotes;
                    g.Width = (pos.X + container.X + pos.Width) - g.X;
                    break;

                case EffectBarGlyphSizing.SinglePostBeatOnly:
                    pos = container.PostNotes;
                    g.X = pos.X + container.X;
                    g.Width = pos.Width;
                    break;

                case EffectBarGlyphSizing.GroupedPreBeatOnly:
                    if (g != prevGlyph) { AlignGlyph(EffectBarGlyphSizing.SinglePreBeatOnly, beatIndex, voiceIndex, prevGlyph); }
                    else
                    {
                        pos = container.PreNotes;
                        var posR = (EffectBarRenderer)pos.Renderer;
                        var gR = (EffectBarRenderer)g.Renderer;
                        g.Width = (posR.X + posR.BeatGlyphsStart + container.X + pos.X + pos.Width) - (gR.X + gR.BeatGlyphsStart + g.X);
                        g.ExpandTo(container.Beat);
                    }
                    break;

                case EffectBarGlyphSizing.GroupedPreBeatToOnBeat:
                    if (g != prevGlyph) { AlignGlyph(EffectBarGlyphSizing.SinglePreBeatToOnBeat, beatIndex, voiceIndex, prevGlyph); }
                    else
                    {
                        pos = container.OnNotes;
                        var posR = (EffectBarRenderer)pos.Renderer;
                        var gR = (EffectBarRenderer)g.Renderer;
                        g.Width = (posR.X + posR.BeatGlyphsStart + container.X + pos.X + pos.Width) - (gR.X + gR.BeatGlyphsStart + g.X);
                        g.ExpandTo(container.Beat);
                    }
                    break;

                case EffectBarGlyphSizing.GroupedPreBeatToPostBeat:
                    if (g != prevGlyph) { AlignGlyph(EffectBarGlyphSizing.SinglePreBeatToPostBeat, beatIndex, voiceIndex, prevGlyph); }
                    else
                    {
                        pos = container.PostNotes;
                        var posR = (EffectBarRenderer)pos.Renderer;
                        var gR = (EffectBarRenderer)g.Renderer;
                        g.Width = (posR.X + posR.BeatGlyphsStart + container.X + pos.X + pos.Width) - (gR.X + gR.BeatGlyphsStart + g.X);
                        g.ExpandTo(container.Beat);
                    }
                    break;

                case EffectBarGlyphSizing.GroupedOnBeatOnly:
                    if (g != prevGlyph) { AlignGlyph(EffectBarGlyphSizing.SingleOnBeatOnly, beatIndex, voiceIndex, prevGlyph); }
                    else
                    {
                        pos = container.OnNotes;
                        var posR = (EffectBarRenderer)pos.Renderer;
                        var gR = (EffectBarRenderer)g.Renderer;
                        g.Width = (posR.X + posR.BeatGlyphsStart + container.X + pos.X + pos.Width) - (gR.X + gR.BeatGlyphsStart + g.X);
                        g.ExpandTo(container.Beat);
                    }
                    break;

                case EffectBarGlyphSizing.GroupedOnBeatToPostBeat:
                    if (g != prevGlyph) { AlignGlyph(EffectBarGlyphSizing.SingleOnBeatToPostBeat, beatIndex, voiceIndex, prevGlyph); }
                    else
                    {
                        pos = container.PostNotes;
                        var posR = (EffectBarRenderer)pos.Renderer;
                        var gR = (EffectBarRenderer)g.Renderer;
                        g.Width = (posR.X + posR.BeatGlyphsStart + container.X + pos.X + pos.Width) - (gR.X + gR.BeatGlyphsStart + g.X);
                        g.ExpandTo(container.Beat);
                    }
                    break;

                case EffectBarGlyphSizing.GroupedPostBeatOnly:
                    if (g != prevGlyph) { AlignGlyph(EffectBarGlyphSizing.GroupedPostBeatOnly, beatIndex, voiceIndex, prevGlyph); }
                    else
                    {
                        pos = container.PostNotes;
                        var posR = (EffectBarRenderer)pos.Renderer;
                        var gR = (EffectBarRenderer)g.Renderer;
                        g.Width = (posR.X + posR.BeatGlyphsStart + container.X + pos.X + pos.Width) - (gR.X + gR.BeatGlyphsStart + g.X);
                        g.ExpandTo(container.Beat);
                    }
                    break;
            }
        }
예제 #2
0
 public void AddNoteGlyph(EffectGlyph noteGlyph, Note note, int noteLine)
 {
     base.Add(noteGlyph, noteLine);
     _noteGlyphLookup[note.Id] = noteGlyph;
     _notes.Add(note);
 }