public GuitarNote CloneToMemory(GuitarMessageList owner)
        {
            GuitarNote ret = null;

            if (owner != null)
            {
                ret = GetNote(owner, Difficulty, this.TickPair, NoteString, NoteFretDown, IsTapNote, IsArpeggioNote, IsXNote);
            }
            else if (IsPro)
            {
                ret = GetNotePro(owner, Difficulty, this.TickPair, NoteString, NoteFretDown, IsTapNote, IsArpeggioNote, IsXNote);
            }
            else
            {
                ret = GetNote5(owner, Difficulty, this.TickPair, NoteString, NoteFretDown, IsTapNote, IsArpeggioNote, IsXNote);
            }
            if (ret != null)
            {
                if (owner != null)
                {
                    if (IsPro == false && owner.IsPro)
                    {
                        ret.Data2 = 100;
                    }
                }
            }
            return(ret);
        }
Esempio n. 2
0
        public static GuitarChord GetChord(GuitarMessageList owner,
                                           GuitarDifficulty difficulty,
                                           TickPair ticks,
                                           GuitarChordConfig config)
        {
            GuitarChord ret = null;

            var lowE = Utility.GetStringLowE(difficulty);

            var notes = new List <GuitarNote>();

            for (int x = 0; x < config.Frets.Length; x++)
            {
                var fret    = config.Frets[x];
                var channel = config.Channels[x];

                if (!fret.IsNull() && fret >= 0 && fret <= 23)
                {
                    var note = GuitarNote.GetNote(owner,
                                                  difficulty, ticks, x, fret,
                                                  channel == Utility.ChannelTap,
                                                  channel == Utility.ChannelArpeggio,
                                                  channel == Utility.ChannelX);

                    if (note != null && note.NoteFretDown.IsNotNull() && note.NoteString.IsNotNull())
                    {
                        notes.Add(note);
                    }
                    else
                    {
                    }
                }
            }

            if (notes.Any())
            {
                ret             = new GuitarChord(owner, ticks, difficulty, notes);
                ret.chordConfig = config.Clone();

                if (ret != null)
                {
                    if (config.IsSlide || config.IsSlideReverse)
                    {
                        ret.AddSlide(config.IsSlideReverse, false);
                    }

                    if (config.IsHammeron)
                    {
                        ret.AddHammeron(false);
                    }

                    ret.AddStrum(config.StrumMode, false);
                }
            }

            return(ret);
        }
        public static GuitarNote GetNotePro(GuitarMessageList owner, GuitarDifficulty diff,
                                            TickPair ticks, int noteString, int noteFret, bool isTap, bool isArpeggio, bool isX)
        {
            var ret = new GuitarNote(owner, ticks);

            ret.Data1        = Utility.GetNoteData1(noteString, diff, true);
            ret.NoteFretDown = noteFret;

            if (isX)
            {
                ret.Channel = Utility.ChannelX;
            }
            else if (isArpeggio)
            {
                ret.Channel = Utility.ChannelArpeggio;
            }
            else if (isTap)
            {
                ret.Channel = Utility.ChannelTap;
            }

            return(ret);
        }
Esempio n. 4
0
        public void RemoveNote(GuitarNote note)
        {
            note.DeleteAll();

            Notes.Remove(note);
        }
 private int GetScreenPointForString(PastePointParam param, GuitarNote note)
 {
     int noteY = TopLineOffset + LineSpacing *
         (5 - (param.MousePos.Y - param.Offset.Y + note.NoteString - param.MinNoteString)) -
         NoteHeight / 2;
     return noteY;
 }
        private static void DrawCopyChord(Graphics g, int alpha, GuitarNote note, int noteX, int noteY, Rectangle rect)
        {
            using (var p = new Pen(Color.FromArgb(alpha, Utility.noteBGBrushSel.Color)))
            {
                g.DrawRectangle(p, rect);
            }

            Color bgColor = Utility.noteBGBrush.Color;
            if (note.Channel == Utility.ChannelX)
            {
                bgColor = Utility.noteXBrush.Color;
            }
            else if (note.Channel == Utility.ChannelTap)
            {
                bgColor = Utility.noteTapBrush.Color;
            }
            using (var sb = new SolidBrush(Color.FromArgb(alpha, bgColor)))
            {
                g.FillRectangle(sb, rect);
            }

            using (var rectPen = new Pen(Color.FromArgb(alpha, Utility.noteBoundPen.Color)))
            {
                g.DrawRectangle(rectPen, rect);
            }

            using (var selPen = new Pen(Color.FromArgb(alpha, Utility.selectedPen.Color)))
            {
                g.DrawRectangle(selPen, rect);
            }

            using (var fb = new SolidBrush(Color.FromArgb(alpha, Utility.fretBrush.Color)))
            {

                var noteTxt = note.NoteFretDown.ToString();
                if (note.IsXNote && Utility.XNoteText.Trim().IsNotEmpty())
                {
                    noteTxt = Utility.XNoteText.Trim();
                    noteX += Utility.XNoteTextXOffset;
                    noteY += Utility.XNoteTextYOffset;
                }
                else
                {
                    noteX += Utility.NoteTextXOffset;
                    noteY += Utility.NoteTextYOffset;
                }

                g.DrawString(noteTxt,
                    Utility.fretFont,
                    fb,
                    noteX,
                    noteY - (int)(Utility.fontHeight / 4.0 + Utility.NoteTextYOffset));
            }
        }
 public int GetNoteMinYOffset(GuitarNote n)
 {
     return TopLineOffset + LineSpacing * (5 - n.NoteString) - NoteHeight / 2;
 }
        public static GuitarNote GetNotePro(GuitarMessageList owner, GuitarDifficulty diff,
            TickPair ticks, int noteString, int noteFret, bool isTap, bool isArpeggio, bool isX)
        {
            var ret = new GuitarNote(owner, ticks);
            ret.Data1 = Utility.GetNoteData1(noteString, diff, true);
            ret.NoteFretDown = noteFret;

            if (isX)
            {
                ret.Channel = Utility.ChannelX;
            }
            else if (isArpeggio)
            {
                ret.Channel = Utility.ChannelArpeggio;
            }
            else if (isTap)
            {
                ret.Channel = Utility.ChannelTap;
            }

            return ret;
        }