コード例 #1
0
        private void ParamWindow_TrackPaint(object sender, VocalUtau.DirectUI.DrawUtils.ParamAreaDrawUtils utils)
        {
            if (!_HandleEvents)
            {
                return;
            }
            if (DynDragingStatus == PitchView.PitchDragingType.EarseArea)
            {
                utils.FillSelect(DynStP1.Tick, DynTmpP0.Tick, Color.DarkSalmon);
            }

            utils.FillDynLine(getShownPitchLine(), DynBase, (100 * Zoom), Color.Green, AntiBordTick);

            switch (DynDragingStatus)
            {
            case PitchView.PitchDragingType.DrawLine: utils.DrawDynLine(ControlMathUtils.CalcLineSilk(DynStP1, DynTmpP0), DynBase, (100 * Zoom), Color.LightPink, 2);  break;

            case PitchView.PitchDragingType.DrawGraphJ: utils.DrawDynLine(ControlMathUtils.CalcGraphJ(DynStP1, DynTmpP0), DynBase, (100 * Zoom), Color.LightPink, 2); break;

            case PitchView.PitchDragingType.DrawGraphR: utils.DrawDynLine(ControlMathUtils.CalcGraphR(DynStP1, DynTmpP0), DynBase, (100 * Zoom), Color.LightPink, 2); break;

            case PitchView.PitchDragingType.DrawGraphS: utils.DrawDynLine(ControlMathUtils.CalcGraphS(DynStP1, DynTmpP0), DynBase, (100 * 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), (100 * Zoom).ToString() + " %", 10, FontStyle.Bold);
            utils.DrawString(new Point(5, utils.ClipRectangle.Height / 2 - 8), Color.FromArgb(80, 255, 255, 255), (50 * Zoom).ToString() + " %", 10, FontStyle.Bold);
            utils.DrawString(new Point(5, utils.ClipRectangle.Height - 15), Color.FromArgb(80, 255, 255, 255), "0 %", 10, FontStyle.Bold);

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

            switch (_DynToolsStatus)
            {
            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;
            }
        }
コード例 #2
0
        void ParamWindow_ParamAreaMouseUp(object sender, ParamMouseEventArgs e)
        {
            if (!_HandleEvents)
            {
                return;
            }
            if (DynDragingStatus == PitchView.PitchDragingType.None)
            {
                return;
            }
            TickControlObject DynEdP2 = new TickControlObject(e.Tick, e.TallPercent * 100 * Zoom - DynBase);

            switch (DynDragingStatus)
            {
            case PitchView.PitchDragingType.DrawLine: replaceControlLine(ControlMathUtils.CalcLineSilk(DynStP1, DynEdP2)); break;

            case PitchView.PitchDragingType.DrawGraphJ: replaceControlLine(ControlMathUtils.CalcGraphJ(DynStP1, DynEdP2)); break;

            case PitchView.PitchDragingType.DrawGraphR: replaceControlLine(ControlMathUtils.CalcGraphR(DynStP1, DynEdP2)); break;

            case PitchView.PitchDragingType.DrawGraphS: replaceControlLine(ControlMathUtils.CalcGraphS(DynStP1, DynEdP2)); break;

            case PitchView.PitchDragingType.EarseArea: earseControlLine(DynStP1, DynEdP2); break;
            }
            PitchView.PitchDragingType EDStatus = DynDragingStatus;
            DynDragingStatus = PitchView.PitchDragingType.None;
            DynStP1          = null;
            DynTmpP0         = null;
            if (DynActionEnd != null)
            {
                DynActionEnd(EDStatus);
            }
            if (_DynToolsStatus == PitchView.PitchDragingType.None)
            {
                ParamWindow.ParentForm.Cursor = Cursors.Arrow;
            }
            else
            {
                ParamWindow.ParentForm.Cursor = Cursors.Cross;
            }
        }