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