diff --git a/butterflow-ui/App.xaml b/butterflow-ui/App.xaml
index 94062ab..97d5d62 100644
--- a/butterflow-ui/App.xaml
+++ b/butterflow-ui/App.xaml
@@ -4,6 +4,10 @@
xmlns:local="clr-namespace:butterflow_ui"
StartupUri="MainWindow.xaml">
-
+
+
+
+
+
diff --git a/butterflow-ui/ButterflowOption.cs b/butterflow-ui/ButterflowOption.cs
new file mode 100644
index 0000000..ca9109b
--- /dev/null
+++ b/butterflow-ui/ButterflowOption.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace butterflow_ui
+{
+ public class ButterflowOption : ContentControl
+ {
+ #region Properties
+
+ public string LabelValue { get; set; }
+
+ #endregion
+
+ #region Dependency Properties
+
+ public static DependencyProperty LabelValueProperty = DependencyProperty.Register("LabelValue", typeof(string), typeof(ButterflowOption));
+
+ #endregion
+
+ public ButterflowOption()
+ {
+ //
+ }
+ }
+}
diff --git a/butterflow-ui/ButterflowOption.xaml b/butterflow-ui/ButterflowOption.xaml
deleted file mode 100644
index 0708388..0000000
--- a/butterflow-ui/ButterflowOption.xaml
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/butterflow-ui/ButterflowOption.xaml.cs b/butterflow-ui/ButterflowOption.xaml.cs
deleted file mode 100644
index 8d90c10..0000000
--- a/butterflow-ui/ButterflowOption.xaml.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace butterflow_ui
-{
- ///
- /// Interaction logic for ButterflowOption.xaml
- ///
- public partial class ButterflowOption : UserControl
- {
- #region Properties
-
- public string LabelValue
- {
- get
- {
- return (string)GetValue(LabelValueProperty);
- }
- set
- {
- SetValue(LabelValueProperty, value);
- }
- }
-
- #endregion
-
- #region Dependency Properties
-
- public static DependencyProperty LabelValueProperty = DependencyProperty.Register("LabelProperty", typeof(string), typeof(ButterflowOption));
-
- #endregion
-
- public ButterflowOption()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/butterflow-ui/Controls.xaml b/butterflow-ui/Controls.xaml
new file mode 100644
index 0000000..27ac339
--- /dev/null
+++ b/butterflow-ui/Controls.xaml
@@ -0,0 +1,22 @@
+
+
+
+
\ No newline at end of file
diff --git a/butterflow-ui/MainWindow.xaml b/butterflow-ui/MainWindow.xaml
index 5df20c9..2f4feb0 100644
--- a/butterflow-ui/MainWindow.xaml
+++ b/butterflow-ui/MainWindow.xaml
@@ -68,7 +68,7 @@
-
+
@@ -85,10 +85,10 @@
-
+
-
+
diff --git a/butterflow-ui/MainWindow.xaml.cs b/butterflow-ui/MainWindow.xaml.cs
index 1b1fbc4..1238680 100644
--- a/butterflow-ui/MainWindow.xaml.cs
+++ b/butterflow-ui/MainWindow.xaml.cs
@@ -23,35 +23,24 @@ namespace butterflow_ui
{
#region Properties
- public string PlaybackRate
- {
- get
- {
- return (string)GetValue(PlaybackRateProperty);
- }
- set
- {
- SetValue(PlaybackRateProperty, value);
- }
- }
-
- #endregion
-
- #region Dependency Properties
-
- public static DependencyProperty PlaybackRateProperty = DependencyProperty.Register("PlaybackRateProperty", typeof(string), typeof(MainWindow));
+ public OptionsConfiguration OptionsConfiguration { get; set; } = new OptionsConfiguration();
#endregion
+ /// Default constructor.
public MainWindow()
{
InitializeComponent();
}
+ /// Event handler. Called by btnFilePicker for click events.
+ /// Source of the event.
+ /// Routed event information.
private void btnFilePicker_Click(object sender, RoutedEventArgs e)
{
var ofd = new OpenFileDialog();
ofd.Filter = "Supported Video Files|*.mp4;*.mkv";
+
var result = ofd.ShowDialog(this);
if (result.HasValue && result.Value)
diff --git a/butterflow-ui/OptionsConfiguration.cs b/butterflow-ui/OptionsConfiguration.cs
new file mode 100644
index 0000000..d9531f9
--- /dev/null
+++ b/butterflow-ui/OptionsConfiguration.cs
@@ -0,0 +1,107 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using csmic;
+
+namespace butterflow_ui
+{
+
+ /// (Serializable) the options configuration.
+ [Serializable]
+ public class OptionsConfiguration : INotifyPropertyChanged
+ {
+ #region Members
+
+ /// Occurs when a property value changes.
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private InputInterpreter interpreter = new InputInterpreter();
+
+ private string playbackRate;
+ private bool keepAudio;
+ private int width;
+ private int height;
+
+ #endregion
+
+ #region Properties
+
+ /// Gets or sets the playback rate.
+ /// The playback rate.
+ public string PlaybackRate
+ {
+ get
+ {
+ return this.playbackRate;
+ }
+ set
+ {
+ this.playbackRate = value;
+ OnPropertyChanged("PlaybackRate");
+ }
+ }
+
+ /// Gets or sets a value indicating whether the keep audio.
+ /// True if keep audio, false if not.
+ public bool KeepAudio
+ {
+ get
+ {
+ return this.keepAudio;
+ }
+ set
+ {
+ this.keepAudio = value;
+ OnPropertyChanged("KeepAudio");
+ }
+ }
+
+ /// Gets or sets the width.
+ /// The width.
+ public string Width
+ {
+ get
+ {
+ return this.width.ToString();
+ }
+ set
+ {
+ interpreter.Interpret(value);
+ this.width = interpreter.Int;
+ OnPropertyChanged("Width");
+ }
+ }
+
+ /// Gets or sets the height.
+ /// The height.
+ public string Height
+ {
+ get
+ {
+ return this.height.ToString();
+ }
+ set
+ {
+ interpreter.Interpret(value);
+ this.height = interpreter.Int;
+ OnPropertyChanged("Height");
+ }
+ }
+
+ #endregion
+
+ #region Methods
+
+ /// Executes the property changed action.
+ /// The name.
+ protected void OnPropertyChanged(string name)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
+ }
+
+ #endregion
+ }
+}
diff --git a/butterflow-ui/butterflow-ui.csproj b/butterflow-ui/butterflow-ui.csproj
index 111d329..ac71ec0 100644
--- a/butterflow-ui/butterflow-ui.csproj
+++ b/butterflow-ui/butterflow-ui.csproj
@@ -34,6 +34,9 @@
4
+
+ packages\csmic.1.1.4\lib\net40\csmic.dll
+
@@ -54,7 +57,7 @@
MSBuild:Compile
Designer
-
+
Designer
MSBuild:Compile
@@ -66,9 +69,7 @@
App.xaml
Code
-
- ButterflowOption.xaml
-
+
True
True
@@ -80,6 +81,7 @@
+
Code
@@ -101,6 +103,7 @@
ResXFileCodeGenerator
Resources.Designer.cs
+
SettingsSingleFileGenerator
Settings.Designer.cs
diff --git a/butterflow-ui/packages.config b/butterflow-ui/packages.config
new file mode 100644
index 0000000..111741e
--- /dev/null
+++ b/butterflow-ui/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file