diff options
Diffstat (limited to 'win/C#/HandBrake.ApplicationServices')
8 files changed, 74 insertions, 216 deletions
diff --git a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj index bc6c04db0..e6f54b9e8 100644 --- a/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj +++ b/win/C#/HandBrake.ApplicationServices/HandBrake.ApplicationServices.csproj @@ -100,11 +100,6 @@ <DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
- <Compile Include="Properties\Settings.Designer.cs">
- <AutoGen>True</AutoGen>
- <DesignTimeSharedInput>True</DesignTimeSharedInput>
- <DependentUpon>Settings.settings</DependentUpon>
- </Compile>
<Compile Include="Services\Encode.cs" />
<Compile Include="Services\Interfaces\IEncode.cs" />
<Compile Include="Services\Interfaces\IQueue.cs" />
@@ -114,10 +109,6 @@ </ItemGroup>
<ItemGroup>
<None Include="app.config" />
- <None Include="Properties\Settings.settings">
- <Generator>SettingsSingleFileGenerator</Generator>
- <LastGenOutput>Settings.Designer.cs</LastGenOutput>
- </None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="frmExceptionWindow.resx">
diff --git a/win/C#/HandBrake.ApplicationServices/Init.cs b/win/C#/HandBrake.ApplicationServices/Init.cs index d279a0b11..e8f2e18af 100644 --- a/win/C#/HandBrake.ApplicationServices/Init.cs +++ b/win/C#/HandBrake.ApplicationServices/Init.cs @@ -58,18 +58,16 @@ namespace HandBrake.ApplicationServices {
InstanceId = instanceId;
HandBrakeGuiVersionString = versionString;
- Properties.Settings.Default.CompletionOption = completionOption;
- Properties.Settings.Default.disableDvdNav = disableDvdNav;
- Properties.Settings.Default.growlEncode = growlEncode;
- Properties.Settings.Default.growlQueue = growlQueue;
- Properties.Settings.Default.processPriority = processPriority;
- Properties.Settings.Default.saveLogPath = saveLogPath;
- Properties.Settings.Default.saveLogToSpecifiedPath = saveLogToSpecifiedPath;
- Properties.Settings.Default.saveLogWithVideo = saveLogWithVideo;
- Properties.Settings.Default.showCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
- Properties.Settings.Default.preventSleep = preventSleep;
-
- Properties.Settings.Default.Save();
+ CompletionOption = completionOption;
+ DisableDvdNav = disableDvdNav;
+ GrowlEncode = growlEncode;
+ GrowlQueue = growlQueue;
+ ProcessPriority = processPriority;
+ SaveLogPath = saveLogPath;
+ SaveLogToSpecifiedPath = saveLogToSpecifiedPath;
+ SaveLogWithVideo = saveLogWithVideo;
+ ShowCliForInGuiEncodeStatus = showCliForInGuiEncodeStatus;
+ PreventSleep = preventSleep;
}
/// <summary>
@@ -92,5 +90,56 @@ namespace HandBrake.ApplicationServices /// The Applicaiton that uses this DLL can pass in it's version string.
/// </summary>
public static string HandBrakeGuiVersionString;
+
+ /// <summary>
+ /// What to do when the encode completes.
+ /// </summary>
+ public static string CompletionOption;
+
+ /// <summary>
+ /// Disable LibDvdNav
+ /// </summary>
+ public static bool DisableDvdNav;
+
+ /// <summary>
+ /// Growl when an encode has finished.
+ /// </summary>
+ public static bool GrowlEncode;
+
+ /// <summary>
+ /// Growl when a queue has finished.
+ /// </summary>
+ public static bool GrowlQueue;
+
+ /// <summary>
+ /// The Process Priority for HandBrakeCLI
+ /// </summary>
+ public static string ProcessPriority;
+
+ /// <summary>
+ /// Path to save log files to.
+ /// </summary>
+ public static string SaveLogPath;
+
+ /// <summary>
+ /// Copy log files to the SaveLogPath
+ /// </summary>
+ public static bool SaveLogToSpecifiedPath;
+
+ /// <summary>
+ /// Save a copy of the log files with the video
+ /// </summary>
+ public static bool SaveLogWithVideo;
+
+ /// <summary>
+ /// Show the CLI window when encoding.
+ /// </summary>
+ public static bool ShowCliForInGuiEncodeStatus;
+
+ /// <summary>
+ /// Prevent system sleep
+ /// </summary>
+ public static bool PreventSleep;
+
}
}
diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs index d402ac909..488014304 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs @@ -136,7 +136,7 @@ namespace HandBrake.ApplicationServices.Parsing if (m.Success)
thisTitle.SourceName = path.Replace("+ stream:", string.Empty).Trim();
- if (!Properties.Settings.Default.disableDvdNav)
+ if (!Init.DisableDvdNav)
{
// Get the Angles for the title.
m = Regex.Match(output.ReadLine(), @" \+ angle\(s\) ([0-9])");
diff --git a/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs b/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs deleted file mode 100644 index 42083c571..000000000 --- a/win/C#/HandBrake.ApplicationServices/Properties/Settings.Designer.cs +++ /dev/null @@ -1,146 +0,0 @@ -//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated by a tool.
-// Runtime Version:2.0.50727.4927
-//
-// Changes to this file may cause incorrect behavior and will be lost if
-// the code is regenerated.
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Properties {
-
-
- [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
- internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
-
- private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
-
- public static Settings Default {
- get {
- return defaultInstance;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool disableDvdNav {
- get {
- return ((bool)(this["disableDvdNav"]));
- }
- set {
- this["disableDvdNav"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool saveLogWithVideo {
- get {
- return ((bool)(this["saveLogWithVideo"]));
- }
- set {
- this["saveLogWithVideo"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string saveLogPath {
- get {
- return ((string)(this["saveLogPath"]));
- }
- set {
- this["saveLogPath"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool saveLogToSpecifiedPath {
- get {
- return ((bool)(this["saveLogToSpecifiedPath"]));
- }
- set {
- this["saveLogToSpecifiedPath"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool growlQueue {
- get {
- return ((bool)(this["growlQueue"]));
- }
- set {
- this["growlQueue"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string CompletionOption {
- get {
- return ((string)(this["CompletionOption"]));
- }
- set {
- this["CompletionOption"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("")]
- public string processPriority {
- get {
- return ((string)(this["processPriority"]));
- }
- set {
- this["processPriority"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool showCliForInGuiEncodeStatus {
- get {
- return ((bool)(this["showCliForInGuiEncodeStatus"]));
- }
- set {
- this["showCliForInGuiEncodeStatus"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool growlEncode {
- get {
- return ((bool)(this["growlEncode"]));
- }
- set {
- this["growlEncode"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
- public bool preventSleep {
- get {
- return ((bool)(this["preventSleep"]));
- }
- set {
- this["preventSleep"] = value;
- }
- }
- }
-}
diff --git a/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings b/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings deleted file mode 100644 index 581684d2d..000000000 --- a/win/C#/HandBrake.ApplicationServices/Properties/Settings.settings +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="HandBrake.ApplicationServices.Properties" GeneratedClassName="Settings">
- <Profiles />
- <Settings>
- <Setting Name="disableDvdNav" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="saveLogWithVideo" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="saveLogPath" Type="System.String" Scope="User">
- <Value Profile="(Default)" />
- </Setting>
- <Setting Name="saveLogToSpecifiedPath" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="growlQueue" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="CompletionOption" Type="System.String" Scope="User">
- <Value Profile="(Default)" />
- </Setting>
- <Setting Name="processPriority" Type="System.String" Scope="User">
- <Value Profile="(Default)" />
- </Setting>
- <Setting Name="showCliForInGuiEncodeStatus" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="growlEncode" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- <Setting Name="preventSleep" Type="System.Boolean" Scope="User">
- <Value Profile="(Default)">False</Value>
- </Setting>
- </Settings>
-</SettingsFile>
\ No newline at end of file diff --git a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs index c21d83722..87b0e0027 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Encode.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Encode.cs @@ -152,7 +152,7 @@ namespace HandBrake.ApplicationServices.Services if (enableLogging)
SetupLogging(encJob);
- if (Settings.Default.preventSleep)
+ if (Init.PreventSleep)
{
Win32.PreventSleep();
}
@@ -163,7 +163,7 @@ namespace HandBrake.ApplicationServices.Services RedirectStandardOutput = true,
RedirectStandardError = enableLogging ? true : false,
UseShellExecute = false,
- CreateNoWindow = !Settings.Default.showCliForInGuiEncodeStatus ? true : false
+ CreateNoWindow = !Init.ShowCliForInGuiEncodeStatus ? true : false
};
this.HbProcess = Process.Start(cliStart);
@@ -185,7 +185,7 @@ namespace HandBrake.ApplicationServices.Services }
// Set the Process Priority
- switch (Settings.Default.processPriority)
+ switch (Init.ProcessPriority)
{
case "Realtime":
this.HbProcess.PriorityClass = ProcessPriorityClass.RealTime;
@@ -288,13 +288,13 @@ namespace HandBrake.ApplicationServices.Services File.Copy(tempLogFile, Path.Combine(logDir, encodeLogFile));
// Save a copy of the log file in the same location as the enocde.
- if (Settings.Default.saveLogWithVideo)
+ if (Init.SaveLogWithVideo)
File.Copy(tempLogFile, Path.Combine(encodeDestinationPath, encodeLogFile));
// Save a copy of the log file to a user specified location
- if (Directory.Exists(Settings.Default.saveLogPath))
- if (Settings.Default.saveLogPath != String.Empty && Settings.Default.saveLogToSpecifiedPath)
- File.Copy(tempLogFile, Path.Combine(Settings.Default.saveLogPath, encodeLogFile));
+ if (Directory.Exists(Init.SaveLogPath))
+ if (Init.SaveLogPath != String.Empty && Init.SaveLogToSpecifiedPath)
+ File.Copy(tempLogFile, Path.Combine(Init.SaveLogPath, encodeLogFile));
}
catch (Exception exc)
{
@@ -325,7 +325,7 @@ namespace HandBrake.ApplicationServices.Services windowsSeven.SetTaskBarProgressToNoProgress();
}
- if (Properties.Settings.Default.preventSleep)
+ if (Init.PreventSleep)
{
Win32.AllowSleep();
}
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs index 7ba1d9d31..59c084f1c 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Queue.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Queue.cs @@ -403,7 +403,7 @@ namespace HandBrake.ApplicationServices.Services HbProcess.Dispose();
// Growl
- if (Properties.Settings.Default.growlEncode)
+ if (Init.GrowlEncode)
GrowlCommunicator.Notify("Encode Completed",
"Put down that cocktail...\nyour Handbrake encode is done.");
@@ -427,11 +427,11 @@ namespace HandBrake.ApplicationServices.Services private void Finish()
{
// Growl
- if (Settings.Default.growlQueue)
+ if (Init.GrowlQueue)
GrowlCommunicator.Notify("Queue Completed", "Put down that cocktail...\nyour Handbrake queue is done.");
// Do something whent he encode ends.
- switch (Settings.Default.CompletionOption)
+ switch (Init.CompletionOption)
{
case "Shutdown":
Process.Start("Shutdown", "-s -t 60");
diff --git a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs index 04c35e36f..da8d34f7c 100644 --- a/win/C#/HandBrake.ApplicationServices/Services/Scan.cs +++ b/win/C#/HandBrake.ApplicationServices/Services/Scan.cs @@ -161,7 +161,7 @@ namespace HandBrake.ApplicationServices.Services File.Delete(dvdInfoPath);
string extraArguments = string.Empty;
- if (Properties.Settings.Default.disableDvdNav)
+ if (Init.DisableDvdNav)
extraArguments = " --no-dvdnav";
if (title > 0)
|