public static GetAuxillaryProjFile ( string projFilename, string filename ) : string | ||
projFilename | string | |
filename | string | |
Результат | string |
public static void AddUndoableAction_insertClipAtMarkerPosition(this IVidkaOpContext context, VidkaClipVideoAbstract newClip) { var proj = context.Proj; var uiObjects = context.UiObjects; int insertIndex = 0; long frameOffset = 0; var oldMarkerPos = context.UiObjects.CurrentMarkerFrame; var targetIndex = proj.GetVideoClipIndexAtFrame_forceOnLastClip(oldMarkerPos, out frameOffset); VidkaClipVideoAbstract targetClip = null; if (targetIndex != -1) { insertIndex = targetIndex; targetClip = proj.ClipsVideo[targetIndex]; if (frameOffset - targetClip.FrameStartNoEase >= targetClip.LengthFrameCalc / 2) // which half of the clip is the marker on? { insertIndex = targetIndex + 1; } } context.AddUndableAction_andFireRedo(new UndoableAction { Redo = () => { proj.ClipsVideo.Insert(insertIndex, newClip); uiObjects.SetActiveVideo(newClip, proj); var newMarkerPos = proj.GetVideoClipAbsFramePositionLeft(newClip); uiObjects.SetCurrentMarkerFrame(newMarkerPos); if (newClip is VidkaClipTextSimple) { newClip.FileName = VidkaIO.GetAuxillaryProjFile(context.CurFileName, VidkaIO.MakeUniqueFilename_AuxSimpleText()); VidkaIO.RebuildAuxillaryFile_SimpleText((VidkaClipTextSimple)newClip, proj, context.MetaGenerator); } }, Undo = () => { proj.ClipsVideo.Remove(newClip); uiObjects.SetCurrentMarkerFrame(oldMarkerPos); if (targetClip != null) { uiObjects.SetActiveVideo(targetClip, proj); } }, }); }