private void ParamWindow_TrackPaint(object sender, VocalUtau.DirectUI.DrawUtils.ParamAreaDrawUtils utils)
        {
            if (!_HandleEvents)
            {
                return;
            }
            if (PitchDragingStatus == PitchView.PitchDragingType.EarseArea)
            {
                utils.FillSelect(PitchStP1.Tick, PitchTmpP0.Tick, Color.DarkSalmon);
            }

            utils.FillPitchLine(getShownPitchLine(), (0.5 * Zoom), Color.Green, AntiBordTick);

            switch (PitchDragingStatus)
            {
            case PitchView.PitchDragingType.DrawLine: utils.DrawPitchLine(PitchMathUtils.CalcLineSilk(PitchStP1, PitchTmpP0), (0.5 * Zoom), Color.LightPink, 2); break;

            case PitchView.PitchDragingType.DrawGraphJ: utils.DrawPitchLine(PitchMathUtils.CalcGraphJ(PitchStP1, PitchTmpP0), (0.5 * Zoom), Color.LightPink, 2); break;

            case PitchView.PitchDragingType.DrawGraphR: utils.DrawPitchLine(PitchMathUtils.CalcGraphR(PitchStP1, PitchTmpP0), (0.5 * Zoom), Color.LightPink, 2); break;

            case PitchView.PitchDragingType.DrawGraphS: utils.DrawPitchLine(PitchMathUtils.CalcGraphS(PitchStP1, PitchTmpP0), (0.5 * Zoom), Color.LightPink, 2); break;
            }

            uint SplitCount = 2 * Zoom;

            if (SplitCount > 2)
            {
                for (int i = 1; i < SplitCount; i++)
                {
                    double Pcent = (double)i / (double)SplitCount;
                    utils.DrawYLine(Pcent, Color.FromArgb(91, 91, 91));
                }
            }
            utils.DrawString(new Point(5, 0), Color.FromArgb(80, 255, 255, 255), (0.5 * Zoom).ToString() + " Semitone ", 10, FontStyle.Bold);
            utils.DrawString(new Point(5, utils.ClipRectangle.Height / 2 - 8), Color.FromArgb(80, 255, 255, 255), "0 Semitone", 10, FontStyle.Bold);
            utils.DrawString(new Point(5, utils.ClipRectangle.Height - 15), Color.FromArgb(80, 255, 255, 255), (-0.5 * Zoom).ToString() + " Semitone", 10, FontStyle.Bold);

            utils.DrawString(new Point(utils.ClipRectangle.Width - 150, 0), Color.FromArgb(80, 255, 255, 255), "PIT", 50, FontStyle.Bold);


            switch (_PitchToolsStatus)
            {
            case PitchView.PitchDragingType.DrawLine: utils.DrawString(new Point(utils.ClipRectangle.Width - 160, 65), Color.FromArgb(80, 255, 255, 255), "Draw Line", 25, FontStyle.Bold); break;

            case PitchView.PitchDragingType.DrawGraphJ: utils.DrawString(new Point(utils.ClipRectangle.Width - 130, 65), Color.FromArgb(80, 255, 255, 255), "Draw J", 25, FontStyle.Bold); break;

            case PitchView.PitchDragingType.DrawGraphR: utils.DrawString(new Point(utils.ClipRectangle.Width - 130, 65), Color.FromArgb(80, 255, 255, 255), "Draw R", 25, FontStyle.Bold); break;

            case PitchView.PitchDragingType.DrawGraphS: utils.DrawString(new Point(utils.ClipRectangle.Width - 130, 65), Color.FromArgb(80, 255, 255, 255), "Draw S", 25, FontStyle.Bold); break;

            case PitchView.PitchDragingType.EarseArea: utils.DrawString(new Point(utils.ClipRectangle.Width - 130, 65), Color.FromArgb(80, 255, 255, 255), "Earse", 25, FontStyle.Bold); break;
            }
        }
        private void PianoWindow_TrackPaint(object sender, VocalUtau.DirectUI.DrawUtils.TrackDrawUtils utils)
        {
            List <PitchObject>[] PitchArray = getPitchObjLists();
            foreach (List <PitchObject> PitchObjList in PitchArray)
            {
                utils.DrawPitchLine(PitchObjList, Color.Red);
            }

            /*
             * List<PitchObject> PitchObjList=getShownPitchLine();
             * utils.DrawPitchLine(PitchObjList, Color.Red);
             */
            switch (PitchDragingStatus)
            {
            case PitchDragingType.DrawLine: utils.DrawPitchLine(PitchMathUtils.CalcLineSilk(PitchStP1, PitchTmpP0), Color.DarkCyan); break;

            case PitchDragingType.DrawGraphJ: utils.DrawPitchLine(PitchMathUtils.CalcGraphJ(PitchStP1, PitchTmpP0), Color.DarkCyan); break;

            case PitchDragingType.DrawGraphR: utils.DrawPitchLine(PitchMathUtils.CalcGraphR(PitchStP1, PitchTmpP0), Color.DarkCyan); break;

            case PitchDragingType.DrawGraphS: utils.DrawPitchLine(PitchMathUtils.CalcGraphS(PitchStP1, PitchTmpP0), Color.DarkCyan); break;

            case PitchDragingType.EarseArea:
                if (PitchStP1 != null && PitchTmpP0 != null)
                {
                    PitchView.BlockDia PitchDia = new PitchView.BlockDia();
                    PitchDia.setStartPoint(PitchStP1.Tick, PitchStP1.PitchValue.NoteNumber);
                    PitchDia.setEndPoint(PitchTmpP0.Tick, PitchTmpP0.PitchValue.NoteNumber);
                    utils.DrawDia(PitchDia.TickStart, PitchDia.TickEnd, PitchDia.TopNoteNum, PitchDia.BottomNoteNum);
                }
                break;
            }
            if (_HandleEvents)
            {
                switch (_PitchToolsStatus)
                {
                case PitchView.PitchDragingType.DrawLine: utils.DrawString(new Point(utils.ClipRectangle.Width - 210, 35), Color.FromArgb(60, 0, 0, 0), "Pitch Draw Line", 25, FontStyle.Bold); break;

                case PitchView.PitchDragingType.DrawGraphJ: utils.DrawString(new Point(utils.ClipRectangle.Width - 170, 35), Color.FromArgb(60, 0, 0, 0), "Pitch Draw J", 25, FontStyle.Bold); break;

                case PitchView.PitchDragingType.DrawGraphR: utils.DrawString(new Point(utils.ClipRectangle.Width - 170, 35), Color.FromArgb(60, 0, 0, 0), "Pitch Draw R", 25, FontStyle.Bold); break;

                case PitchView.PitchDragingType.DrawGraphS: utils.DrawString(new Point(utils.ClipRectangle.Width - 170, 35), Color.FromArgb(60, 0, 0, 0), "Pitch Draw S", 25, FontStyle.Bold); break;

                case PitchView.PitchDragingType.EarseArea: utils.DrawString(new Point(utils.ClipRectangle.Width - 160, 35), Color.FromArgb(60, 0, 0, 0), "Pitch Earse", 25, FontStyle.Bold); break;
                }
            }
        }
        void ParamWindow_ParamAreaMouseUp(object sender, ParamMouseEventArgs e)
        {
            if (!_HandleEvents)
            {
                return;
            }
            if (PitchDragingStatus == PitchView.PitchDragingType.None)
            {
                return;
            }
            PitchObject PitchEdP2 = new PitchObject(e.Tick, e.MidPercent * 0.5 * Zoom);

            switch (PitchDragingStatus)
            {
            case PitchView.PitchDragingType.DrawLine: replacePitchLine(PitchMathUtils.CalcLineSilk(PitchStP1, PitchEdP2)); break;

            case PitchView.PitchDragingType.DrawGraphJ: replacePitchLine(PitchMathUtils.CalcGraphJ(PitchStP1, PitchEdP2)); break;

            case PitchView.PitchDragingType.DrawGraphR: replacePitchLine(PitchMathUtils.CalcGraphR(PitchStP1, PitchEdP2)); break;

            case PitchView.PitchDragingType.DrawGraphS: replacePitchLine(PitchMathUtils.CalcGraphS(PitchStP1, PitchEdP2)); break;

            case PitchView.PitchDragingType.EarseArea: earsePitchLine(PitchStP1, PitchEdP2, _EarseModeV2); break;
            }
            PitchView.PitchDragingType EDStatus = PitchDragingStatus;
            PitchDragingStatus = PitchView.PitchDragingType.None;
            PitchStP1          = null;
            PitchTmpP0         = null;
            if (PitchActionEnd != null)
            {
                PitchActionEnd(EDStatus);
            }
            if (_PitchToolsStatus == PitchView.PitchDragingType.None)
            {
                ParamWindow.ParentForm.Cursor = Cursors.Arrow;
            }
            else
            {
                ParamWindow.ParentForm.Cursor = Cursors.Cross;
            }
        }
        private void PianoWindow_TrackMouseUp(object sender, VocalUtau.DirectUI.PianoMouseEventArgs e)
        {
            if (!_HandleEvents)
            {
                return;
            }
            if (PitchDragingStatus == PitchDragingType.None)
            {
                return;
            }
            PitchObject PitchEdP2 = new PitchObject(e.Tick, e.PitchValue.PitchValue);

            switch (PitchDragingStatus)
            {
            case PitchDragingType.DrawLine: PartsObject.PitchCompiler.ReplaceRealPitchLine(PitchMathUtils.CalcLineSilk(PitchStP1, PitchEdP2)); break;

            case PitchDragingType.DrawGraphJ: PartsObject.PitchCompiler.ReplaceRealPitchLine(PitchMathUtils.CalcGraphJ(PitchStP1, PitchEdP2)); break;

            case PitchDragingType.DrawGraphR: PartsObject.PitchCompiler.ReplaceRealPitchLine(PitchMathUtils.CalcGraphR(PitchStP1, PitchEdP2)); break;

            case PitchDragingType.DrawGraphS: PartsObject.PitchCompiler.ReplaceRealPitchLine(PitchMathUtils.CalcGraphS(PitchStP1, PitchEdP2)); break;

            case PitchDragingType.EarseArea:
                if (PitchStP1 != null && PitchTmpP0 != null)
                {
                    PitchView.BlockDia PitchDia = new PitchView.BlockDia();
                    PitchDia.setStartPoint(PitchStP1.Tick, PitchStP1.PitchValue.NoteNumber);
                    PitchDia.setEndPoint(PitchTmpP0.Tick, PitchTmpP0.PitchValue.NoteNumber);
                    earsePitchLine(PitchDia, _EarseModeV2);
                }
                break;
            }
            PitchDragingType EDStatus = PitchDragingStatus;

            PitchDragingStatus = PitchDragingType.None;
            PitchStP1          = null;
            PitchTmpP0         = null;
            if (PitchActionEnd != null)
            {
                PitchActionEnd(EDStatus);
            }
        }