protected override VizCmd CmdHorzRel(VizCmd vizCmd) { var cmd = base.CmdHorzRel(vizCmd); timemark = Global.Instance.Song.NormalizedTimeMark(StartPoint.X); return(cmd); }
protected virtual VizCmd CmdPaste(VizCmd vizCmd) { Global.Instance.Song.Vizs.Remove(vizCmd.viz); //vizCmd.viz = this; //vizCmd.obj = JsonConvert.SerializeObject(this); //Global.Song.Selected.Remove(viz); vizCmd.cmd = Cmd.Insert; return(vizCmd); }
protected virtual VizCmd CmdCopy(VizCmd vizCmd) { //Viz viz = (Viz)JsonConvert.DeserializeObject((string)(vizCmd.obj), typeof(Lyric)); Viz viz = vizCmd.viz; viz.ResetPoints(Global.Instance.Song); Global.Instance.Song.Vizs.Add(viz); vizCmd.cmd = Cmd.Delete; return(vizCmd); }
//public bool CmdLogAndDo(int cmd) //{ // return CmdDo(cmd); //} #region Command helpers protected virtual VizCmd CmdHorzRel(VizCmd vizCmd) { int offset = (int)vizCmd.obj; StartPoint.X += offset; EndPoint.X += offset; vizCmd.obj = -offset; return(vizCmd); }
public virtual VizCmd XeqCmd(VizCmd vizCmd) { switch (vizCmd.cmd) { case Cmd.HorzRel: return(CmdHorzRel(vizCmd)); case Cmd.Insert: return(CmdInsert(vizCmd)); case Cmd.Delete: return(CmdDelete(vizCmd)); case Cmd.Copy: return(CmdCopy(vizCmd)); case Cmd.Paste: return(CmdPaste(vizCmd)); } return(null); }
protected override VizCmd CmdHorzRel(VizCmd vizCmd) => base.CmdHorzRel(vizCmd);