public static void Instance(MediaEncoderBusiness business, MediaEncoderDeshakerSegmentSettings settings) { DeshakerAdvancedWindow NewForm = new DeshakerAdvancedWindow(); NewForm.business = business; NewForm.encodeSettings = settings; NewForm.ShowDialog(); }
private void StartFrameAddButton_Click(object sender, RoutedEventArgs e) { if (!bindingSettings.Segments.Where(b => b.FrameStart == StartFrameTextBoxValue).Any()) { bindingSegmentSettings = bindingSegmentSettings.Clone(); bindingSegmentSettings.FrameStart = StartFrameTextBoxValue; bindingSettings.Segments.Add(bindingSegmentSettings); StartFramesList.SelectedValue = StartFrameTextBoxValue; } }
private void Window_Loaded(object sender, RoutedEventArgs e) { Dictionary <DeshakerScales, string> ScaleList = new Dictionary <DeshakerScales, string>(); ScaleList.Add(DeshakerScales.Full, "Full (most precise)"); ScaleList.Add(DeshakerScales.Half, "Half"); ScaleList.Add(DeshakerScales.Quarter, "Quarter (fastest)"); ScaleCombo.ItemsSource = ScaleList; Dictionary <DeshakerUsePixels, string> UsePixelsList = new Dictionary <DeshakerUsePixels, string>(); UsePixelsList.Add(DeshakerUsePixels.All, "All (most robust)"); UsePixelsList.Add(DeshakerUsePixels.Every4, "Every 4th"); UsePixelsList.Add(DeshakerUsePixels.Every9, "Every 9th"); UsePixelsList.Add(DeshakerUsePixels.Every16, "Every 16th (fastest)"); UsePixelsCombo.ItemsSource = UsePixelsList; // We'll edit a copy so that we can detect changes and cancel changes bindingSettings = encodeSettings.Clone(); this.DataContext = bindingSettings; }
private void Window_Loaded(object sender, RoutedEventArgs e) { Dictionary <EdgeCompensationMethods, string> EdgeList = new Dictionary <EdgeCompensationMethods, string>(); EdgeList.Add(EdgeCompensationMethods.None, "None (large borders)"); EdgeList.Add(EdgeCompensationMethods.AdaptiveZoomAverage, "Adaptive zoom average (some borders)"); EdgeList.Add(EdgeCompensationMethods.AdaptiveZoomFull, "Adaptive zoom full (no borders)"); EdgeList.Add(EdgeCompensationMethods.FixedZoom, "Fixed zoom (no borders)"); EdgeList.Add(EdgeCompensationMethods.AdaptiveZoomAverageFixedZoom, "Adaptive zoom average + fixed zoom (no borders)"); EdgeCompensationCombo.ItemsSource = EdgeList; // We'll edit a copy so that we can detect changes and cancel changes bindingSettings = encodeSettings.DeshakerSettings.Clone(); bindingSegmentSettings = bindingSettings.Segments[0]; Pass1Grid.DataContext = bindingSegmentSettings; // Pass 2 will always be bound to the first item Pass2Grid.DataContext = bindingSettings; StartFramesList.ItemsSource = bindingSettings.Segments; StartFramesList.DisplayMemberPath = "FrameStart"; StartFramesList.SelectedValuePath = "FrameStart"; StartFramesList.SelectedValue = 0; }
private void StartFramesList_SelectionChanged(object sender, SelectionChangedEventArgs e) { bindingSegmentSettings = (MediaEncoderDeshakerSegmentSettings)StartFramesList.SelectedItem; Pass1Grid.DataContext = bindingSegmentSettings; StartFrameTextBox.Text = bindingSegmentSettings.FrameStart.ToString(); }