示例#1
0
        public DSFiltersPanel()
        {
            InitializeComponent();

            // Add the additional filter categories to the DSFilterPanel and sync the filters
            dsFilterTreeView1.AddCategory(new DMOAudioCaptureEffectsCategory());
            dsFilterTreeView1.AddCategory(new DMOAudioEffectsCategory());
            dsFilterTreeView1.AddCategory(new DMOVideoEffectsCategory());
            dsFilterTreeView1.AddCategory(new EncAPIEncodersCategory());
            dsFilterTreeView1.AddCategory(new EncAPIMultiplexersCategory());

            dsFilterTreeView1.DoubleClick += new EventHandler(dsFilterTreeView1_DoubleClick);
            // uncomment to allow DirectX Transform Categories
            // (they don't work very well outside of a DES graph)

            /*
             * dsFilterTreeView1.AddCategory(new VideoEffects1Category());
             * dsFilterTreeView1.AddCategory(new VideoEffects2Category());
             * dsFilterTreeView1.AddCategory(new AudioEffects1Category());
             * dsFilterTreeView1.AddCategory(new AudioEffects2Category());
             */

            dsFilterTreeView1.SyncFilters();

            // set the textbox to the last entry in the Singleton
            SearchItemsSingleton sitems = SearchItemsSingleton.Instance;

            if (sitems.Items.Count != 0)
            {
                _findFilterTextBox.Text = sitems.Items[sitems.Items.Count - 1];
                _findFilterTextBox.SelectAll();
            }
        }
示例#2
0
        private void _findFilterTextBox_DropDown(object sender, EventArgs e)
        {
            // repopulate entries from the singleton
            SearchItemsSingleton sitems = SearchItemsSingleton.Instance;

            _findFilterTextBox.Items.Clear();
            _findFilterTextBox.Items.AddRange(sitems.Items.ToArray());
        }
示例#3
0
        public DSFilterTreeViewNode FindFilter(string searchText)
        {
            // store the search text in the Singleton
            SearchItemsSingleton sitems = SearchItemsSingleton.Instance;

            if (!sitems.Items.Contains(searchText))
            {
                sitems.Items.Add(searchText);
            }

            searchText = searchText.ToLower();

            int startparent = 0;
            int startchild  = 0;

            if (dsFilterTreeView1.SelectedNode != null)
            {
                if (dsFilterTreeView1.SelectedNode is DSFilterTreeViewNode)
                {
                    startparent = dsFilterTreeView1.SelectedNode.Parent.Index;
                    startchild  = dsFilterTreeView1.SelectedNode.Index;
                }
                else
                {
                    startparent = dsFilterTreeView1.SelectedNode.Index;
                    startchild  = 0;
                }
            }

            // search from selected to end
            DSFilterTreeViewNode found = FindFilterRange(searchText, startparent, startchild + 1, dsFilterTreeView1.Nodes.Count - 1, dsFilterTreeView1.Nodes[dsFilterTreeView1.Nodes.Count - 1].Nodes.Count - 1);

            if (found == null)
            {
                if (startparent != 0 && startchild != 0)
                {
                    // search from top to selected
                    found = FindFilterRange(searchText, 0, 0, startparent, startchild);
                }
            }

            // if a node was found, select it and expand it
            if (found != null)
            {
                dsFilterTreeView1.Select();
                found.Parent.Expand();
                dsFilterTreeView1.SelectedNode = found;
            }

            return(found);
        }