void UpdateEntryUi() { SuspendLayout(); if (entry != null) { labelSourceName.Text = $"Name: {entry.Name}"; labelSourceDisplayName.Text = $"DisplayName: {entry.DisplayName}"; buttonConfig.Enabled = true; bool hasDialogue = FilterGraphTools.HasPropertyPages(entry.Filter); buttonConfig.Enabled = hasDialogue; } else { ClearSourceUI(); } if (audioEntry != null) { labelAudioName.Text = $"Name: {audioEntry.Name}"; labelAudioDisplayName.Text = $"DisplayName: {audioEntry.DisplayName}"; buttonAudioConfig.Enabled = true; } else { ClearAudioUI(); } ResumeLayout(); }
private void OnRButtonDown(Point eLocation) { Filter filter = graph.FilterInPoint(mousepos); if (filter != null) { Pin pin = filter.PinInPoint(mousepos); if (pin != null) { movingStart = mousepos; connectingPin = pin; } else //filter right click { rightClickedFilter = filter; ContextMenu menu = new ContextMenu(); if (FilterGraphTools.HasPropertyPages(filter.BaseFilter)) menu.MenuItems.Add("Property page", ShowPropertyPage); IAMVfwCompressDialogs vfw = filter.BaseFilter as IAMVfwCompressDialogs; if (vfw != null) { if (vfw.ShowDialog(VfwCompressDialogs.QueryConfig, Handle) == 0) menu.MenuItems.Add("VfW compressor: Config", VfWConfig); if (vfw.ShowDialog(VfwCompressDialogs.QueryAbout, Handle) == 0) menu.MenuItems.Add("VfW compressor: About", VfWAbout); } if ((filter.BaseFilter as ISampleGrabber) != null) { menu.MenuItems.Add("Set media type", SetSGMediaType); menu.MenuItems.Add("Watch grabbed samples", WatchSampleGrabber); } menu.MenuItems.Add("Scan interfaces", ScanInterfaces); if (filter.filterProps.DisplayName.Length > 0) { menu.MenuItems.Add("Add to favorites", AddToFavorites); menu.MenuItems.Add("Find this filter in the list", FindFilterInList); } if ((filter.BaseFilter as IPersistStream) != null) { menu.MenuItems.Add("Save state to C++ code", SaveFilterStateToCode); menu.MenuItems.Add("Save state to C# code", SaveFilterStateToCodeCS); } menu.Show(this, eLocation); } } else //out of filter right click { ContextMenu menu = new ContextMenu(); menu.MenuItems.Add("Render file...", RenderFile); menu.MenuItems.Add("Add source filter...", AddSourceFilter); menu.MenuItems.Add("Load graph...", LoadGraph); if (savedFileName != null) menu.MenuItems.Add("Save graph", SaveGraph); menu.MenuItems.Add("Save graph as...", SaveGraphAs); menu.MenuItems.Add("See event log...", ShowEventLog); menu.MenuItems.Add("Arrange filters", delegate { graph.LayoutFilters(); graph.RecalcPaths(); Invalidate(); }); menu.MenuItems.Add("Refresh graph", delegate { graph.ReloadGraph(); Invalidate(); }); menu.Show(this, eLocation); } }