示例#1
0
文件: MergeAudio.cs 项目: daisy/obi
        /// <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>());
        }
示例#2
0
文件: SplitAudio.cs 项目: daisy/obi
 // Perform a split given a time and a node with no audio, optionally updating the selection in the view afterward.
 public static void Split(ProjectView.ProjectView view, PhraseNode node, PhraseNode nodeAfter, Time splitTime,
                          bool updateSelection, bool allowSpecialRoleMarkForSurrounding)
 {
     nodeAfter.Audio = node.SplitAudio(splitTime);
     node.InsertAfterSelf(nodeAfter);
     if (allowSpecialRoleMarkForSurrounding)
     {
         AssignRole.AssignRoleToEmptyNodeSurroundedByCustomRoles(nodeAfter);
     }
     if (updateSelection)
     {
         view.SelectedBlockNode = nodeAfter;
     }
     view.UpdateBlocksLabelInStrip(node.AncestorAs <SectionNode>());
 }
 public override void Execute()
 {
     mNode.AncestorAs <SectionNode>().UnsetHeading(mNode);
 }