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; } } }
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); } }