From ec5e493e4f9d3d5bfde041ec63e620cb5c597bc4 Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Sun, 1 Jul 2018 17:02:50 -0500 Subject: [PATCH] Media Play/Pause/Stop buttons added --- butterflow-ui/ButterflowWrapper.cs | 50 +++++++++++++ butterflow-ui/Icons.xaml | 81 +++++++++++++++++++++ butterflow-ui/MainWindow.xaml | 64 +++++++++++++++-- butterflow-ui/MainWindow.xaml.cs | 81 +++++++++++++++++++-- butterflow-ui/OptionsConfiguration.cs | 100 ++++++++++++++++++++++++-- butterflow-ui/butterflow-ui.csproj | 4 ++ 6 files changed, 367 insertions(+), 13 deletions(-) create mode 100644 butterflow-ui/ButterflowWrapper.cs diff --git a/butterflow-ui/ButterflowWrapper.cs b/butterflow-ui/ButterflowWrapper.cs new file mode 100644 index 0000000..818ec71 --- /dev/null +++ b/butterflow-ui/ButterflowWrapper.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace butterflow_ui +{ + public class ButterflowWrapper + { + #region Members + + /// Full pathname of the butterflow executable file. + private Lazy executablePath = new Lazy(() => Path.Combine(Assembly.GetExecutingAssembly().Location, "ThirdPartyCompiled", "butterflow.exe")); + + #endregion + + #region Methods + + /// Runs butterflow with the given . + /// The options configuration. + public void Run(OptionsConfiguration optionsConfiguration) + { + string arguments = optionsConfiguration.ToButterflowArguments(); + + Run(arguments); + } + + public void Probe(string videoFile) + { + string arguments = string.Format("-prb \"{0}\"", videoFile); + } + + /// Runs butterflow with the given . + /// Options for controlling the operation. + private void Run(string arguments) + { + var processStartInfo = new ProcessStartInfo(executablePath.Value, arguments); + + processStartInfo.CreateNoWindow = true; + processStartInfo.UseShellExecute = false; + processStartInfo.RedirectStandardOutput = true; + } + + #endregion + } +} diff --git a/butterflow-ui/Icons.xaml b/butterflow-ui/Icons.xaml index 2126e1c..bd141f6 100644 --- a/butterflow-ui/Icons.xaml +++ b/butterflow-ui/Icons.xaml @@ -31,4 +31,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/butterflow-ui/MainWindow.xaml b/butterflow-ui/MainWindow.xaml index 4c00cce..df8c327 100644 --- a/butterflow-ui/MainWindow.xaml +++ b/butterflow-ui/MainWindow.xaml @@ -11,9 +11,21 @@ - - - + + + + + + + + + + + + + + + @@ -56,7 +68,7 @@