Пример #1
0
        public void Init(TreeNodeAndStreamSelection selection, TreeNode currentTreeNode)
        {
            if (selection == null)
            {
                throw new ArgumentNullException("selection");
            }
            if (selection.m_TreeNode == null)
            {
                throw new ArgumentNullException("selection.m_TreeNode");
            }
            if (currentTreeNode == null)
            {
                throw new ArgumentNullException("currentTreeNode");
            }

            //TreeNode = selection.m_TreeNode;

            CurrentTreeNode = currentTreeNode;
            SelectionData   = selection;

            //DebugFix.Assert(m_SelectionData.m_TreeNode == TreeNode);

            ShortDescription = "Delete audio portion";
            LongDescription  = "Delete a portion of audio for a given treenode";

            ManagedAudioMedia manMedia = m_SelectionData.m_TreeNode.GetManagedAudioMedia();

            if (manMedia == null)
            {
                throw new NullReferenceException("m_SelectionData.m_TreeNode.GetManagedAudioMedia()");
            }
            OriginalManagedAudioMedia = manMedia.Copy();
            m_UsedMediaData.Add(OriginalManagedAudioMedia.AudioMediaData);

#if DEBUG
            DebugFix.Assert(manMedia.Duration.IsEqualTo(OriginalManagedAudioMedia.Duration));
#endif //DEBUG

            ChannelsProperty chProp = m_SelectionData.m_TreeNode.GetChannelsProperty();
            foreach (Channel ch in chProp.UsedChannels)
            {
                if (manMedia == chProp.GetMedia(ch))
                {
                    ChannelOfOriginalMedia = ch;
                    break;
                }
            }
            DebugFix.Assert(ChannelOfOriginalMedia != null);
            DebugFix.Assert(ChannelOfOriginalMedia is AudioChannel);
        }
Пример #2
0
        public TreeNodeAudioStreamDeleteCommand CreateTreeNodeAudioStreamDeleteCommand(TreeNodeAndStreamSelection selection, TreeNode currentTreeNode)
        {
            TreeNodeAudioStreamDeleteCommand command = Create <TreeNodeAudioStreamDeleteCommand>();

            command.Init(selection, currentTreeNode);
            return(command);
        }