public override void Execute() { ManagedAudioMedia after = mHasAudioAfterDeleted ? mNode.SplitAudio(mSplitTimeEnd) : null; mNode.SplitAudio(mSplitTimeBegin); if (after != null) { mNode.MergeAudioWith(after); } View.Selection = mSelectionAfter; }
/// <summary> /// Merge the selected phrase with the following phrase. /// </summary> //public MergeAudio(ProjectView.ProjectView view): // this(view, (PhraseNode)view.Selection.Node.ParentAs<ObiNode>().PhraseChild(view.Selection.Node.Index + 1)) {} /// <summary> /// Merge two nodes; the "next" one is removed after merging. /// </summary> public static void Merge(ProjectView.ProjectView view, PhraseNode node, PhraseNode next, bool updateSelection) { if (next.IsRooted) { next.Detach(); } node.MergeAudioWith(next.Audio); if (updateSelection) { view.SelectedBlockNode = node; } view.UpdateBlocksLabelInStrip(node.AncestorAs <SectionNode>()); }