public static ChordModifier GetModifier(GuitarChord chord, ChordModifierType type)
        {
            ChordModifier ret = null;

            switch (type)
            {
            case ChordModifierType.ChordStrumHigh:
            case ChordModifierType.ChordStrumMed:
            case ChordModifierType.ChordStrumLow:
                if (Utility.GetStrumData1(chord.Difficulty).IsNotNull())
                {
                    ret = new GuitarChordStrum(chord, type);
                }
                break;

            case ChordModifierType.Hammeron:
                if (Utility.GetHammeronData1(chord.Difficulty).IsNotNull())
                {
                    ret = new GuitarHammeron(chord);
                }
                break;

            case ChordModifierType.Slide:
            case ChordModifierType.SlideReverse:
                if (Utility.GetSlideData1(chord.Difficulty).IsNotNull())
                {
                    ret = new GuitarSlide(chord, type == ChordModifierType.SlideReverse);
                }
                break;
            }
            return(ret);
        }
        public static GuitarChordStrum CreateStrum(GuitarChord chord, ChordStrum strum)
        {
            GuitarChordStrum ret = null;

            if (!chord.HasStrumMode(strum) && Utility.GetStrumData1(chord.Difficulty).IsNotNull())
            {
                ret       = new GuitarChordStrum(chord, strum.GetModifierType());
                ret.IsNew = true;
                ret.CreateEvents();
            }
            return(ret);
        }
Esempio n. 3
0
        public void AddStrum(ChordStrum strum, bool createEvents)
        {
            if (strum != ChordStrum.Normal && !HasStrum)
            {
                if (strum.HasFlag(ChordStrum.High))
                {
                    var gs = new GuitarChordStrum(this, ChordModifierType.ChordStrumHigh);

                    gs.IsNew = true;

                    Modifiers.Add(gs);

                    if (createEvents)
                    {
                        gs.CreateEvents();
                    }
                }
                if (strum.HasFlag(ChordStrum.Mid))
                {
                    var gs = new GuitarChordStrum(this, ChordModifierType.ChordStrumMed);

                    gs.IsNew = true;

                    Modifiers.Add(gs);

                    if (createEvents)
                    {
                        gs.CreateEvents();
                    }
                }
                if (strum.HasFlag(ChordStrum.Low))
                {
                    var gs = new GuitarChordStrum(this, ChordModifierType.ChordStrumLow);

                    gs.IsNew = true;

                    Modifiers.Add(gs);

                    if (createEvents)
                    {
                        gs.CreateEvents();
                    }
                }
            }
        }
        public static ChordModifier CreateModifier(GuitarChord chord, ChordModifierType type)
        {
            ChordModifier ret = null;

            switch (type)
            {
            case ChordModifierType.ChordStrumLow:
            {
                ret = GuitarChordStrum.CreateStrum(chord, ChordStrum.Low);
            }
            break;

            case ChordModifierType.ChordStrumMed:
            {
                ret = GuitarChordStrum.CreateStrum(chord, ChordStrum.Mid);
            }
            break;

            case ChordModifierType.ChordStrumHigh:
            {
                ret = GuitarChordStrum.CreateStrum(chord, ChordStrum.High);
            }
            break;

            case ChordModifierType.Hammeron:
            {
                ret = GuitarHammeron.CreateHammeron(chord);
            }
            break;

            case ChordModifierType.Slide:
            {
                ret = GuitarSlide.CreateSlide(chord, false);
            }
            break;

            case ChordModifierType.SlideReverse:
            {
                ret = GuitarSlide.CreateSlide(chord, true);
            }
            break;
            }

            return(ret);
        }