Пример #1
0
        // Paste a node in or after another node.
        protected virtual urakawa.command.Command PasteCommandNode(ProjectView.ProjectView view, bool allowAutoSpecialRoleAssign)   //@AssociateNode
        {
            Commands.Node.Paste paste = new Commands.Node.Paste(view);
            paste.AllowRoleChangeAccordingToSurroundingSpecialNodes = allowAutoSpecialRoleAssign;   //@AssociateNode
            CompositeCommand p = view.Presentation.CreateCompositeCommand(paste.ShortDescription);

            p.ChildCommands.Insert(p.ChildCommands.Count, paste);
            if (paste.DeleteSelectedBlock)
            {
                Commands.Node.Delete delete = new Commands.Node.Delete(view, view.Selection.Node);
                delete.UpdateSelection = false;
                p.ChildCommands.Insert(p.ChildCommands.Count, delete);
            }
            // If the node to paste is a heading phrase, revert to a plain phrase.
            // We consider that being a heading is more of a section things (copying sections conserve the heading.)
            if (paste.Copy is PhraseNode && ((PhraseNode)paste.Copy).Role_ == EmptyNode.Role.Heading)
            {
                Commands.Node.AssignRole behead =
                    new Commands.Node.AssignRole(view, (EmptyNode)paste.Copy, EmptyNode.Role.Plain);
                behead.UpdateSelection = false;
                p.ChildCommands.Insert(p.ChildCommands.Count, behead);
            }
            if (paste.Copy.Used && !paste.CopyParent.Used)
            {
                view.AppendMakeUnused(p, paste.Copy);
            }
            return(p);
        }
Пример #2
0
 public MetadataView()
 {
     InitializeComponent();
     mView                 = null;
     mSelection            = null;
     mBaseFontSize         = Font.SizeInPoints;
     m_IsImportingMetadata = false;
     initializeMetadataDictionary();
     m_BtnContextMenu.Location = new Point((mUpdateButton.Right + 10), mUpdateButton.Location.Y);
 }
Пример #3
0
        private NodeSelection mSelection;  // actual selection context


        /// <summary>
        /// Create an empty TOC view.
        /// </summary>
        public TOCView()
        {
            InitializeComponent();
            mBaseFontSize = Font.SizeInPoints;
            mSelection    = null;
            mProjectView  = null;
            this.Context_MergeWithNextMenuItem.Click      += new System.EventHandler(this.Context_MergeWithNextMenuItem_Click);
            this.Context_MultipleOperationsMenuItem.Click += new EventHandler(Context_MultipleOperationsMenuItem_Click);
            this.Context_AddEmptyPagesMenuItem.Click      += new EventHandler(Context_AddEmptyPagesMenuItem_Click);
            this.Context_AddBlankPhraseMenuItem.Click     += new EventHandler(Context_AddBlankPhraseMenuItem_Click);
        }
Пример #4
0
 public FindInText()
 {
     m_ContentView     = null;
     mOriginalPosition = 0;
     mNumberSearched   = 0;
     mProjectView      = null;
     mFoundFirst       = false;
     InitializeComponent();
     mBaseFontSize   = Font.SizeInPoints;
     mTimer          = new Timer();
     mTimer.Interval = 7000;
     mTimer.Tick    += new EventHandler(mTimer_Tick);
     m_SectionsList  = null;              //@singleSection
     m_SectionActiveInContentView = null; //@singleSection
 }
Пример #5
0
        // Create a new phrase node with the audio from the clipboard
        // and merge the selected node with this one.
        protected virtual urakawa.command.Command PasteCommandAudio(ProjectView.ProjectView view)
        {
            AudioClipboard c = (AudioClipboard)view.Clipboard;

            //urakawa.media.data.audio.ManagedAudioMedia media = ((PhraseNode)view.Clipboard.Node).Audio.copy(
            urakawa.media.data.audio.ManagedAudioMedia media = view.Presentation.MediaFactory.CreateManagedAudioMedia();

            WavAudioMediaData wavData = ((WavAudioMediaData)((PhraseNode)view.Clipboard.Node).Audio.AudioMediaData).Copy(
                new Time(Convert.ToInt64(c.AudioRange.SelectionBeginTime * Time.TIME_UNIT)),
                new Time(Convert.ToInt64(c.AudioRange.SelectionEndTime * Time.TIME_UNIT)));//sdk2

            media.AudioMediaData = wavData;

            CompositeCommand p = view.Presentation.CreateCompositeCommand(Localizer.Message("paste_audio"));

            if (Node is EmptyNode)
            {
                if (view.TransportBar.CurrentState == Obi.ProjectView.TransportBar.State.Paused)
                {
                    Command pasteCommand = new Commands.Audio.Paste(view, view.TransportBar.SplitBeginTime);
                    p.ChildCommands.Insert(p.ChildCommands.Count, pasteCommand);
                }
                else
                {
                    PhraseNode phrase = view.Presentation.CreatePhraseNode(media);
                    p.ChildCommands.Insert(p.ChildCommands.Count, new Commands.Node.AddNode(view, phrase, ParentForNewNode(phrase), IndexForNewNode(phrase)));
                    p.ChildCommands.Insert(p.ChildCommands.Count, Commands.Node.MergeAudio.GetMergeCommand(view, (EmptyNode)Node, phrase));
                    if (Node is PhraseNode)
                    {
                        p.ChildCommands.Insert(p.ChildCommands.Count, new Commands.UpdateSelection(view, new AudioSelection((PhraseNode)Node, Control, new AudioRange(Node.Duration, Node.Duration + phrase.Duration))));
                    }
                    else if (Node is EmptyNode)
                    {
                        p.ChildCommands.Insert(p.ChildCommands.Count, new Commands.UpdateSelection(view, new NodeSelection(phrase, Control)));
                    }
                }
            }
            else
            {
                PhraseNode phrase = view.Presentation.CreatePhraseNode(media);
                p.ChildCommands.Insert(p.ChildCommands.Count, new Commands.Node.AddNode(view, phrase, ParentForNewNode(phrase), IndexForNewNode(phrase)));
            }
            return(p);
        }
Пример #6
0
 /// <summary>
 /// Renumber this node and all following pages of the same kind starting from this number.
 /// </summary>
 public override CompositeCommand RenumberCommand(ProjectView.ProjectView view, PageNumber from)
 {
     if (mRole == Role.Page && mPageNumber.Kind == from.Kind)
     {
         CompositeCommand k = base.RenumberCommand(view, from.NextPageNumber());
         if (k == null)
         {
             k = Presentation.CommandFactory.CreateCompositeCommand();
             k.ShortDescription = string.Format(Localizer.Message("renumber_pages"),
                                                Localizer.Message(string.Format("{0}_pages", from.Kind.ToString())));
         }
         k.ChildCommands.Insert(k.ChildCommands.Count, new Commands.Node.SetPageNumber(view, this, from));
         return(k);
     }
     else
     {
         return(base.RenumberCommand(view, from));
     }
 }
Пример #7
0
        public Toolbar_EditAudio(ContentView contentView, Strip strip, EmptyNode node, ProjectView mProjectView)
            : this()
        {
            m_ContentView = contentView;
            m_Strip       = strip;
            m_Node        = node;
            m_ProjectView = mProjectView;
            m_ProjectView.SelectionChanged += new EventHandler(ProjectViewSelectionChanged);

            this.toolStrip1.MouseDown += new MouseEventHandler(Toolbar_EditAudio_MouseDown);
            this.toolStrip1.MouseUp   += new MouseEventHandler(Toolbar_EditAudio_MouseUp);
            this.toolStrip1.MouseMove += new MouseEventHandler(Toolbar_EditAudio_MouseMove);

            this.toolStrip1.MinimumSize = this.Size;
            this.toolStrip1.MaximumSize = this.Size;
            this.toolStrip1.Size        = this.Size;

            EditAudioPanelToolTipInit();

            if (m_ProjectView.ObiForm.Settings.ObiFont != this.Font.Name) //@fontconfig
            {
                SetFont();                                                //@fontconfig
            }
        }
Пример #8
0
 /// <summary>
 /// Create the paste command for pasting whatever is in the clipboard in the current selection.
 /// </summary>
 public virtual urakawa.command.Command PasteCommand(ProjectView.ProjectView view, bool allowAutoSpecialRole)   //@AssociateNode
 {
     return(view.Clipboard is AudioClipboard?PasteCommandAudio(view) : PasteCommandNode(view, allowAutoSpecialRole));
 }
Пример #9
0
        /// <summary>
        /// Get a command to renumber this node and all following nodes from this number.
        /// </summary>
        public virtual CompositeCommand RenumberCommand(ProjectView.ProjectView view, PageNumber from)
        {
            ObiNode n = FollowingNode;

            return(n == null ? null : n.RenumberCommand(view, from));
        }