From 7fde16539fef00fdbc2d450078cd608d28b78fdc Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Sun, 24 Jun 2018 03:29:34 -0500 Subject: [PATCH] Fleshing out bindings and values --- butterflow-ui/MainWindow.xaml | 36 +++++++++++++-------------- butterflow-ui/MainWindow.xaml.cs | 16 ++++++++++++ butterflow-ui/OptionsConfiguration.cs | 16 ++++++++++++ 3 files changed, 50 insertions(+), 18 deletions(-) diff --git a/butterflow-ui/MainWindow.xaml b/butterflow-ui/MainWindow.xaml index 2f4feb0..77111ad 100644 --- a/butterflow-ui/MainWindow.xaml +++ b/butterflow-ui/MainWindow.xaml @@ -46,26 +46,26 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -73,10 +73,10 @@ - + - + @@ -85,10 +85,10 @@ - + - + diff --git a/butterflow-ui/MainWindow.xaml.cs b/butterflow-ui/MainWindow.xaml.cs index 1238680..972e4b8 100644 --- a/butterflow-ui/MainWindow.xaml.cs +++ b/butterflow-ui/MainWindow.xaml.cs @@ -23,6 +23,8 @@ namespace butterflow_ui { #region Properties + /// Gets or sets the butyterflow options configuration. + /// The options configuration. public OptionsConfiguration OptionsConfiguration { get; set; } = new OptionsConfiguration(); #endregion @@ -49,5 +51,19 @@ namespace butterflow_ui mediaPreview.Source = new Uri(ofd.FileName); } } + + /// Event handler. Called by PlaybackRate radio buttons for checked events. + /// Source of the event. + /// Routed event information. + private void PlaybackRateRadioButton_Checked(object sender, RoutedEventArgs e) + { + var typedSender = (RadioButton)sender; + + if(typedSender != null) + { + var tag = typedSender.Tag.ToString(); + this.OptionsConfiguration.PlaybackRate = tag; + } + } } } diff --git a/butterflow-ui/OptionsConfiguration.cs b/butterflow-ui/OptionsConfiguration.cs index d9531f9..ff14b80 100644 --- a/butterflow-ui/OptionsConfiguration.cs +++ b/butterflow-ui/OptionsConfiguration.cs @@ -24,6 +24,7 @@ namespace butterflow_ui private bool keepAudio; private int width; private int height; + private bool losslessQuality; #endregion @@ -91,6 +92,21 @@ namespace butterflow_ui } } + /// Gets or sets a value indicating whether the result is rendered in lossless quality. + /// True if lossless quality is selected, false if not. + public bool LosslessQuality + { + get + { + return this.losslessQuality; + } + set + { + this.losslessQuality = value; + OnPropertyChanged("LosslessQuality"); + } + } + #endregion #region Methods