예제 #1
0
        public void RefreshTrainer(GuitarTrainerType type)
        {
            try
            {
                ListBox list = null;
                RefreshTextEvents();

                if (type == GuitarTrainerType.ProGuitar)
                {
                    list = listProGuitarTrainers;
                }
                else if (type == GuitarTrainerType.ProBass)
                {
                    list = listProBassTrainers;
                }

                if (list != null)
                {
                    list.BeginUpdate();

                    list.Items.Clear();
                    if (EditorPro.IsLoaded)
                    {
                        foreach (var trainer in ProGuitarTrack.Messages.Trainers.Where(t => t.TrainerType == type).ToList())
                        {
                            list.Items.Add(trainer);
                        }
                    }
                    list.EndUpdate();
                }
            }
            catch { }

            EditorPro.Invalidate();
        }
        public GuitarTrainer(GuitarMessageList owner, TickPair ticks, GuitarTrainerType type, GuitarTextEvent start, GuitarTextEvent end, GuitarTextEvent norm)
            : base(owner, ticks, GuitarMessageType.GuitarTrainer)
        {
            this.TrainerType = type;

            Start = start;
            End = end;
            Norm = norm;

            this.TrainerIndex = ParseTrainerIndex();

            this.Loopable = norm != null;

            SetTicks(ticks);
        }
예제 #3
0
        public GuitarTrainer(GuitarMessageList owner, TickPair ticks, GuitarTrainerType type, GuitarTextEvent start, GuitarTextEvent end, GuitarTextEvent norm)
            : base(owner, ticks, GuitarMessageType.GuitarTrainer)
        {
            this.TrainerType = type;

            Start = start;
            End   = end;
            Norm  = norm;

            this.TrainerIndex = ParseTrainerIndex();

            this.Loopable = norm != null;

            SetTicks(ticks);
        }
        public GuitarTrainer(GuitarMessageList owner, TickPair ticks, GuitarTrainerType type, bool loopable, int index = Int32.MinValue)
            : base(owner, ticks, GuitarMessageType.GuitarTrainer)
        {
            this.TrainerType = type;
            this.TrainerIndex = index.IsNull() ? (owner.Trainers.Where(x => x.TrainerType == type).Count() + 1) : index;
            this.Loopable = loopable;

            Start = new GuitarTextEvent(owner, ticks.Down, GetStartText(TrainerType, TrainerIndex));
            End = new GuitarTextEvent(owner, ticks.Up, GetEndText(TrainerType, TrainerIndex));

            if (Loopable)
            {
                Norm = new GuitarTextEvent(owner, GetNormTick(ticks), GetNormText(TrainerType, TrainerIndex, Loopable));
            }

            SetTicks(ticks);
        }
예제 #5
0
        public GuitarTrainer(GuitarMessageList owner, TickPair ticks, GuitarTrainerType type, bool loopable, int index = Int32.MinValue)
            : base(owner, ticks, GuitarMessageType.GuitarTrainer)
        {
            this.TrainerType  = type;
            this.TrainerIndex = index.IsNull() ? (owner.Trainers.Where(x => x.TrainerType == type).Count() + 1) : index;
            this.Loopable     = loopable;

            Start = new GuitarTextEvent(owner, ticks.Down, GetStartText(TrainerType, TrainerIndex));
            End   = new GuitarTextEvent(owner, ticks.Up, GetEndText(TrainerType, TrainerIndex));

            if (Loopable)
            {
                Norm = new GuitarTextEvent(owner, GetNormTick(ticks), GetNormText(TrainerType, TrainerIndex, Loopable));
            }

            SetTicks(ticks);
        }
예제 #6
0
 public static string GetEndText(GuitarTrainerType type, int index)
 {
     if (type == GuitarTrainerType.ProGuitar)
     {
         return(Utility.TextEventBeginTag +
                Utility.SongTrainerEndPGText + " " +
                Utility.SongTrainerPGText + index.ToStringEx() +
                Utility.TextEventEndTag);
     }
     else if (type == GuitarTrainerType.ProBass)
     {
         return(Utility.TextEventBeginTag +
                Utility.SongTrainerEndPBText + " " +
                Utility.SongTrainerPBText + index.ToStringEx() +
                Utility.TextEventEndTag);
     }
     return(string.Empty);
 }
예제 #7
0
 public GuitarTrainer GetTrainerByIndex(GuitarTrainerType type, int index)
 {
     return(Messages.Trainers.Where(x => x.TrainerType == type && x.TrainerIndex == index).FirstOrDefault());
 }
 public GuitarTrainer GetTrainerByIndex(GuitarTrainerType type, int index)
 {
     return Messages.Trainers.Where(x => x.TrainerType == type && x.TrainerIndex == index).FirstOrDefault();
 }
 public static string GetStartText(GuitarTrainerType type, int index)
 {
     if (type == GuitarTrainerType.ProGuitar)
     {
         return Utility.TextEventBeginTag +
             Utility.SongTrainerBeginPGText + " " +
             Utility.SongTrainerPGText + index.ToStringEx() +
             Utility.TextEventEndTag;
     }
     else if (type == GuitarTrainerType.ProBass)
     {
         return Utility.TextEventBeginTag +
            Utility.SongTrainerBeginPBText + " " +
            Utility.SongTrainerPBText + index.ToStringEx() +
            Utility.TextEventEndTag;
     }
     else
     {
         return string.Empty;
     }
 }
 public static string GetNormText(GuitarTrainerType type, int index, bool loopable)
 {
     if (loopable)
     {
         if (type == GuitarTrainerType.ProGuitar)
         {
             return Utility.TextEventBeginTag +
                Utility.SongTrainerNormPGText + " " +
                Utility.SongTrainerPGText + index.ToStringEx() +
                Utility.TextEventEndTag;
         }
         else if (type == GuitarTrainerType.ProBass)
         {
             return Utility.TextEventBeginTag +
                Utility.SongTrainerNormPBText + " " +
                Utility.SongTrainerPBText + index.ToStringEx() +
                Utility.TextEventEndTag;
         }
     }
     return string.Empty;
 }
        public void RefreshTrainer(GuitarTrainerType type)
        {
            try
            {

                ListBox list = null;
                RefreshTextEvents();

                if (type == GuitarTrainerType.ProGuitar)
                {
                    list = listProGuitarTrainers;
                }
                else if (type == GuitarTrainerType.ProBass)
                {
                    list = listProBassTrainers;
                }

                if (list != null)
                {
                    list.BeginUpdate();

                    list.Items.Clear();
                    if (EditorPro.IsLoaded)
                    {
                        foreach (var trainer in ProGuitarTrack.Messages.Trainers.Where(t=> t.TrainerType == type).ToList())
                        {
                            list.Items.Add(trainer);
                        }
                    }
                    list.EndUpdate();
                }
            }
            catch { }

            EditorPro.Invalidate();
        }
        public void CreateTrainer(GuitarMessageList list, GuitarTrainerType type, TickPair ticks, bool loopable)
        {
            try
            {

                var gt = new GuitarTrainer(list, ticks, type, loopable);
                gt.IsNew = true;
                gt.CreateEvents();

                EditorPro.SetCreationStateIdle();
                EditorPro.SetSelectionStateIdle();
                RefreshTextEvents();
                RefreshTrainers();
            }
            catch { }
        }