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 @@