diff options
author | sr55 <[email protected]> | 2011-04-15 20:01:00 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-04-15 20:01:00 +0000 |
commit | 70fee546acaf4db3efb690ac4aaa09e0f4cb65e8 (patch) | |
tree | 3f53a1b58bbe70ca017f487313b847c8f248bc80 /win/CS/HandBrake.ApplicationServices | |
parent | 463b2127304a4701fcfff7f499d4dfc31828075c (diff) |
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
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices')
5 files changed, 105 insertions, 1 deletions
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 @@ //------------------------------------------------------------------------------
// <auto-generated>
// 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 @@ <Setting Name="HandBrakeExeHash" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
+ <Setting Name="Setting" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="SendFileTo" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="SendFileToArgs" Type="System.String" Scope="User">
+ <Value Profile="(Default)" />
+ </Setting>
+ <Setting Name="SendFile" Type="System.Boolean" Scope="User">
+ <Value Profile="(Default)">False</Value>
+ </Setting>
</Settings>
</SettingsFile>
\ 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);
@@ -242,6 +245,20 @@ namespace HandBrake.ApplicationServices.Services }
/// <summary>
+ /// Send a file to a 3rd party application after encoding has completed.
+ /// </summary>
+ /// <param name="file"> The file path</param>
+ 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);
+ }
+ }
+
+ /// <summary>
/// Perform an action after an encode. e.g a shutdown, standby, restart etc.
/// </summary>
private static void Finish()
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
/// </summary>
public const string DisableLibDvdNav = "DisableLibDvdNav";
+
+ /// <summary>
+ /// Send file enabled.
+ /// </summary>
+ public const string SendFile = "SendFile";
+
+ /// <summary>
+ /// Send file to application path
+ /// </summary>
+ public const string SendFileTo = "SendFileTo";
+
+ /// <summary>
+ /// Send file to arguments
+ /// </summary>
+ 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 @@ <setting name="HandBrakeExeHash" serializeAs="String">
<value />
</setting>
+ <setting name="Setting" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="SendFileTo" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="SendFileToArgs" serializeAs="String">
+ <value />
+ </setting>
+ <setting name="SendFile" serializeAs="String">
+ <value>False</value>
+ </setting>
</HandBrake.ApplicationServices.Properties.Settings>
</userSettings>
</configuration>
|