From 70fee546acaf4db3efb690ac4aaa09e0f4cb65e8 Mon Sep 17 00:00:00 2001 From: sr55 Date: Fri, 15 Apr 2011 20:01:00 +0000 Subject: WinGui: - Add "Send to" option. This will pass the encoded output file name of each completed job on the queue to a 3rd party application with optional arguments passed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3928 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Properties/Settings.Designer.cs | 50 +++++++++++++++++++++- .../Properties/Settings.settings | 12 ++++++ .../Services/QueueProcessor.cs | 17 ++++++++ .../UserSettingConstants.cs | 15 +++++++ win/CS/HandBrake.ApplicationServices/app.config | 12 ++++++ 5 files changed, 105 insertions(+), 1 deletion(-) (limited to 'win/CS/HandBrake.ApplicationServices') diff --git a/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs b/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs index 228bdbe14..f478b91cb 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs +++ b/win/CS/HandBrake.ApplicationServices/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.1 +// Runtime Version:4.0.30319.225 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -226,5 +226,53 @@ namespace HandBrake.ApplicationServices.Properties { this["HandBrakeExeHash"] = value; } } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string Setting { + get { + return ((string)(this["Setting"])); + } + set { + this["Setting"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SendFileTo { + get { + return ((string)(this["SendFileTo"])); + } + set { + this["SendFileTo"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("")] + public string SendFileToArgs { + get { + return ((string)(this["SendFileToArgs"])); + } + set { + this["SendFileToArgs"] = value; + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool SendFile { + get { + return ((bool)(this["SendFile"])); + } + set { + this["SendFile"] = value; + } + } } } diff --git a/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings b/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings index 66c42127e..a33570627 100644 --- a/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings +++ b/win/CS/HandBrake.ApplicationServices/Properties/Settings.settings @@ -53,5 +53,17 @@ + + + + + + + + + + + False + \ No newline at end of file diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index 6f3bf2c1a..ef95b6388 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -203,6 +203,9 @@ namespace HandBrake.ApplicationServices.Services MessageBox.Show(e.Exception + e.ErrorInformation); } + // Post-Processing + SendToApplication(this.QueueManager.LastProcessedJob.Destination); + // Handling Log Data this.EncodeService.ProcessLogs(this.QueueManager.LastProcessedJob.Destination); @@ -241,6 +244,20 @@ namespace HandBrake.ApplicationServices.Services } } + /// + /// Send a file to a 3rd party application after encoding has completed. + /// + /// The file path + private static void SendToApplication(string file) + { + if (Properties.Settings.Default.SendFile && !string.IsNullOrEmpty(Properties.Settings.Default.SendFileTo)) + { + string args = string.Format("{0} \"{1}\"", Properties.Settings.Default.SendFileToArgs, file); + ProcessStartInfo vlc = new ProcessStartInfo(Properties.Settings.Default.SendFileTo, args); + Process.Start(vlc); + } + } + /// /// Perform an action after an encode. e.g a shutdown, standby, restart etc. /// diff --git a/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs b/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs index ba61a8255..c79f7e5e8 100644 --- a/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs +++ b/win/CS/HandBrake.ApplicationServices/UserSettingConstants.cs @@ -95,5 +95,20 @@ namespace HandBrake.ApplicationServices /// Disable Libdvdnav /// public const string DisableLibDvdNav = "DisableLibDvdNav"; + + /// + /// Send file enabled. + /// + public const string SendFile = "SendFile"; + + /// + /// Send file to application path + /// + public const string SendFileTo = "SendFileTo"; + + /// + /// Send file to arguments + /// + public const string SendFileToArgs = "SendFileToArgs"; } } diff --git a/win/CS/HandBrake.ApplicationServices/app.config b/win/CS/HandBrake.ApplicationServices/app.config index d47fd40c8..1146cd5ce 100644 --- a/win/CS/HandBrake.ApplicationServices/app.config +++ b/win/CS/HandBrake.ApplicationServices/app.config @@ -63,6 +63,18 @@ + + + + + + + + + + + False + -- cgit v1.2.3