Esempio n. 1
0
 public TreeNodePlaybackHandler(TreeNode node, Channel audioCh, bool contAfterNode, UrakawaPlaybackAudioDevice playDev)
 {
     mCurrentTreeNode       = node;
     mAudioChannel          = audioCh;
     mContinueAfterTreeNode = contAfterNode;
     mPlaybacAudiokDevice   = playDev;
     mPlaybacAudiokDevice.AudioMediaDataPlayEnded += new EventHandler <EndedEventArgs>(PlaybacAudiokDevice_AudioMediaDataPlayEnded);
     mTreeNodeNavigator = new urakawa.navigation.TypeFilterNavigator <TreeNode>();
     resetElapsedTime();
 }
Esempio n. 2
0
 public void Dispose()
 {
     if (mPlaybacAudiokDevice != null)
     {
         mPlaybacAudiokDevice.AudioMediaDataPlayEnded -= new EventHandler <EndedEventArgs>(PlaybacAudiokDevice_AudioMediaDataPlayEnded);
     }
     mPlaybacAudiokDevice = null;
     mTreeNodeNavigator   = null;
     mCurrentTreeNode     = null;
     mAudioChannel        = null;
 }
Esempio n. 3
0
        public void Init()
        {
            string filepath = Directory.GetCurrentDirectory();

            Uri fileUri = new Uri(filepath);

            fileUri  = new Uri(fileUri, mDefaultFile);
            mProject = new Project();
            mProject.OpenXuk(fileUri);


            navigator = new urakawa.navigation.TypeFilterNavigator <ExampleCustomTreeNode>();
            TreeNode root = mProject.Presentations.Get(0).RootNode;

            node1 = navigator.GetNext(root);
            Assert.IsNotNull(node1, "Node 1 not found");
            Assert.AreEqual(node1.Label, "1", "Label of node 1 is not '1'");
            node1_1 = navigator.GetNext(node1);
            Assert.IsNotNull(node1_1, "Node 1.1 not found");
            Assert.AreEqual(node1_1.Label, "1.1", "Label of node 1.1 is not '1.1'");
            node1_2 = navigator.GetNext(node1_1);
            Assert.IsNotNull(node1_2, "Node 1.2 not found");
            Assert.AreEqual(node1_2.Label, "1.2", "Label of node 1.2 is not '1.2'");
            node1_2_1 = navigator.GetNext(node1_2);
            Assert.IsNotNull(node1_2_1, "Node 1.2.1 not found");
            Assert.AreEqual(node1_2_1.Label, "1.2.1", "Label of node 1.2.1 is not '1.2.1'");
            node1_2_2 = navigator.GetNext(node1_2_1);
            Assert.IsNotNull(node1_2_2, "Node 1.2.2 not found");
            Assert.AreEqual(node1_2_2.Label, "1.2.2", "Label of node 1.2.2 is not '1.2.2'");
            node2 = navigator.GetNext(node1_2_2);
            Assert.IsNotNull(node2, "Node 2 not found");
            Assert.AreEqual(node2.Label, "2", "Label of node 2 is not '2'");
            node3 = navigator.GetNext(node2);
            Assert.IsNotNull(node3, "Node 3 not found");
            Assert.AreEqual(node3.Label, "3", "Label of node 3 is not '3'");
            node3_1 = navigator.GetNext(node3);
            Assert.IsNotNull(node3_1, "Node 3.1 not found");
            Assert.AreEqual(node3_1.Label, "3.1", "Label of node 3.1 is not '3.1'");
            node3_2 = navigator.GetNext(node3_1);
            Assert.IsNotNull(node3_2, "Node 3.2 not found");
            Assert.AreEqual(node3_2.Label, "3.2", "Label of node 3.2 is not '3.2'");
            node3_3 = navigator.GetNext(node3_2);
            Assert.IsNotNull(node3_3, "Node 3.3 not found");
            Assert.AreEqual(node3_3.Label, "3.3", "Label of node 3.3 is not '3.3'");
            node4 = navigator.GetNext(node3_3);
            Assert.IsNotNull(node4, "Node 4 not found");
            Assert.AreEqual(node4.Label, "4", "Label of node 4 is not '4'");
            node4_1 = navigator.GetNext(node4);
            Assert.IsNotNull(node4_1, "Node 4.1 not found");
            Assert.AreEqual(node4_1.Label, "4.1", "Label of node 4.1 is not '4.1'");
            node4_2 = navigator.GetNext(node4_1);
            Assert.IsNotNull(node4_2, "Node 4.2 not found");
            Assert.AreEqual(node4_2.Label, "4.2", "Label of node 4.2 is not '4.2'");
        }
Esempio n. 4
0
        public void TestTypeFilterNavigator()
        {
            urakawa.navigation.TypeFilterNavigator <ExampleCustomTreeNode> navigator
                = new urakawa.navigation.TypeFilterNavigator <ExampleCustomTreeNode>();
            TreeNode root = mProject.Presentations.Get(0).RootNode;
            ExampleCustomTreeNode nod1 = navigator.GetNext(root);

            Assert.IsNotNull(nod1, "Node 1 not found");
            Assert.AreEqual(nod1.Label, "1", "Label of node 1 is not '1'");
            ExampleCustomTreeNode nod1_1 = navigator.GetNext(nod1);

            Assert.IsNotNull(nod1_1, "Node 1.1 not found");
            Assert.AreEqual(nod1_1.Label, "1.1", "Label of node 1.1 is not '1.1'");
        }