summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj2
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.Designer.cs36
-rw-r--r--win/CS/HandBrakeWPF/Properties/Resources.resx12
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs6
-rw-r--r--win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs11
-rw-r--r--win/CS/HandBrakeWPF/Services/Interfaces/ISystemService.cs16
-rw-r--r--win/CS/HandBrakeWPF/Services/Queue/QueueService.cs2
-rw-r--r--win/CS/HandBrakeWPF/Services/SystemService.cs143
-rw-r--r--win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs3
-rw-r--r--win/CS/HandBrakeWPF/UserSettingConstants.cs3
-rw-r--r--win/CS/HandBrakeWPF/Utilities/Win32.cs43
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs30
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs4
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/defaultsettings.xml8
15 files changed, 308 insertions, 13 deletions
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index 232e4f3d9..11f9682df 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -218,6 +218,7 @@
<Compile Include="Services\Encode\Model\Models\Video\VideoProfile.cs" />
<Compile Include="Services\Encode\Model\Models\Video\VideoTune.cs" />
<Compile Include="Services\Interfaces\INotifyIconService.cs" />
+ <Compile Include="Services\Interfaces\ISystemService.cs" />
<Compile Include="Services\Logging\EventArgs\LogEventArgs.cs" />
<Compile Include="Services\Logging\Interfaces\ILog.cs" />
<Compile Include="Services\Logging\LogService.cs" />
@@ -253,6 +254,7 @@
<Compile Include="Services\Scan\Model\Subtitle.cs" />
<Compile Include="Services\Scan\Model\Title.cs" />
<Compile Include="Services\NotifyIconService.cs" />
+ <Compile Include="Services\SystemService.cs" />
<Compile Include="Services\UserSettingService.cs" />
<Compile Include="Startup\StartupOptions.cs" />
<Compile Include="Utilities\AppcastReader.cs" />
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
index 892c484be..9ad37148d 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
+++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs
@@ -5192,6 +5192,42 @@ namespace HandBrakeWPF.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to AC Mains power detected. Resuming encode... ({0} %).
+ /// </summary>
+ public static string SystemService_ACMains {
+ get {
+ return ResourceManager.GetString("SystemService_ACMains", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to System Battery Critical! ({0} %).
+ /// </summary>
+ public static string SystemService_CriticalBattery {
+ get {
+ return ResourceManager.GetString("SystemService_CriticalBattery", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to System Battery Low! ({0} %). Your encode has been paused to protect the system. System sleep is set to allowed!.
+ /// </summary>
+ public static string SystemService_LowBatteryLog {
+ get {
+ return ResourceManager.GetString("SystemService_LowBatteryLog", resourceCulture);
+ }
+ }
+
+ /// <summary>
+ /// Looks up a localized string similar to Remaining drive storage has dropped below {0} GB on the destination drive. Pausing encode....
+ /// </summary>
+ public static string SystemService_LowDiskSpaceLog {
+ get {
+ return ResourceManager.GetString("SystemService_LowDiskSpaceLog", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to {1}%, Pass {2} of {3}
///Remaining Time: {4}.
/// </summary>
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx
index c850971d0..e707d01e7 100644
--- a/win/CS/HandBrakeWPF/Properties/Resources.resx
+++ b/win/CS/HandBrakeWPF/Properties/Resources.resx
@@ -2020,4 +2020,16 @@ Where supported, any user presets will have been imported.</value>
<data name="Options_LowDiskspaceSizeGB" xml:space="preserve">
<value>GB</value>
</data>
+ <data name="SystemService_ACMains" xml:space="preserve">
+ <value>AC Mains power detected. Resuming encode... ({0} %)</value>
+ </data>
+ <data name="SystemService_CriticalBattery" xml:space="preserve">
+ <value>System Battery Critical! ({0} %)</value>
+ </data>
+ <data name="SystemService_LowBatteryLog" xml:space="preserve">
+ <value>System Battery Low! ({0} %). Your encode has been paused to protect the system. System sleep is set to allowed!</value>
+ </data>
+ <data name="SystemService_LowDiskSpaceLog" xml:space="preserve">
+ <value>Remaining drive storage has dropped below {0} GB on the destination drive. Pausing encode...</value>
+ </data>
</root> \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs b/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs
index 489f46925..871f31615 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/Interfaces/IEncode.cs
@@ -94,5 +94,11 @@ namespace HandBrakeWPF.Services.Encode.Interfaces
/// Kill the process
/// </summary>
void Stop();
+
+
+ /// <summary>
+ /// Get a copy of the Active job
+ /// </summary>
+ EncodeTask GetActiveJob();
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
index 3b9e01280..f3ff75fcc 100644
--- a/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
+++ b/win/CS/HandBrakeWPF/Services/Encode/LibEncode.cs
@@ -169,6 +169,17 @@ namespace HandBrakeWPF.Services.Encode
}
}
+ public EncodeTask GetActiveJob()
+ {
+ if (this.currentTask != null)
+ {
+ EncodeTask task = new EncodeTask(this.currentTask); // Decouple our current copy.
+ return task;
+ }
+
+ return null;
+ }
+
#region HandBrakeInstance Event Handlers.
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Services/Interfaces/ISystemService.cs b/win/CS/HandBrakeWPF/Services/Interfaces/ISystemService.cs
new file mode 100644
index 000000000..79461a8ec
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Services/Interfaces/ISystemService.cs
@@ -0,0 +1,16 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ISystemService.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Services.Interfaces
+{
+ public interface ISystemService
+ {
+ void Start();
+ }
+} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
index 3d8af90b3..90c9d7ded 100644
--- a/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
+++ b/win/CS/HandBrakeWPF/Services/Queue/QueueService.cs
@@ -485,7 +485,7 @@ namespace HandBrakeWPF.Services.Queue
QueueTask job = this.GetNextJobForProcessing();
if (job != null)
{
- if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PauseOnLowDiskspace) && !DriveUtilities.HasMinimumDiskSpace(job.Task.Destination, this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseOnLowDiskspaceLevel)))
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PauseOnLowDiskspace) && !DriveUtilities.HasMinimumDiskSpace(job.Task.Destination, this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseQueueOnLowDiskspaceLevel)))
{
LogService.GetLogger().LogMessage(Resources.PauseOnLowDiskspace, LogMessageType.ScanOrEncode, LogLevel.Info);
job.Status = QueueItemStatus.Waiting;
diff --git a/win/CS/HandBrakeWPF/Services/SystemService.cs b/win/CS/HandBrakeWPF/Services/SystemService.cs
new file mode 100644
index 000000000..4bbc89f94
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Services/SystemService.cs
@@ -0,0 +1,143 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SystemService.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Monitor the system health for common problems that will directly impact encodes.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Services
+{
+ using System;
+ using System.Runtime.CompilerServices;
+ using System.Timers;
+
+ using HandBrakeWPF.Properties;
+ using HandBrakeWPF.Services.Encode.Interfaces;
+ using HandBrakeWPF.Services.Encode.Model;
+ using HandBrakeWPF.Services.Interfaces;
+ using HandBrakeWPF.Services.Logging;
+ using HandBrakeWPF.Services.Logging.Interfaces;
+ using HandBrakeWPF.Services.Logging.Model;
+ using HandBrakeWPF.Utilities;
+
+ using Ookii.Dialogs.Wpf;
+
+ public class SystemService : ISystemService
+ {
+ private readonly IUserSettingService userSettingService;
+ private readonly IEncode encodeService;
+ private readonly ILog log = LogService.GetLogger();
+ private Timer pollTimer;
+
+ private bool criticalStateHit = false;
+ private bool lowStateHit = false;
+ private bool lowPowerPause = false;
+ private bool storageLowPause = false;
+
+ public SystemService(IUserSettingService userSettingService, IEncode encodeService)
+ {
+ this.userSettingService = userSettingService;
+ this.encodeService = encodeService;
+ }
+
+ public void Start()
+ {
+ if (this.pollTimer == null)
+ {
+ this.pollTimer = new Timer();
+ this.pollTimer.Interval = 10000; // Check every 10 seconds.
+ this.pollTimer.Elapsed += (o, e) =>
+ {
+ this.CheckSystem();
+ };
+
+ this.pollTimer.Start();
+ }
+ }
+
+ private void CheckSystem()
+ {
+ this.PowerCheck();
+ this.StorageCheck();
+ }
+
+ private void StorageCheck()
+ {
+ string directory = this.encodeService.GetActiveJob()?.Destination;
+ if (!string.IsNullOrEmpty(directory) && this.encodeService.IsEncoding)
+ {
+ long lowLevel = this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseEncodeOnLowDiskspaceLevel);
+ if (!this.storageLowPause && this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PauseOnLowDiskspace) && !DriveUtilities.HasMinimumDiskSpace(directory, lowLevel))
+ {
+ LogService.GetLogger().LogMessage(
+ string.Format(
+ Resources.SystemService_LowDiskSpaceLog,
+ lowLevel / 1000 / 1000 / 1000),
+ LogMessageType.Application,
+ LogLevel.Info);
+ this.encodeService.Pause();
+ this.storageLowPause = true;
+ }
+ }
+ }
+
+ private void PowerCheck()
+ {
+ Win32.PowerState state = Win32.PowerState.GetPowerState();
+
+ if (state == null || state.BatteryFlag == Win32.BatteryFlag.NoSystemBattery || state.BatteryFlag == Win32.BatteryFlag.Unknown)
+ {
+ return; // Only run if we have a battery.
+ }
+
+ if (state.ACLineStatus == Win32.ACLineStatus.Offline && state.BatteryFlag == Win32.BatteryFlag.Low && !this.lowStateHit)
+ {
+ if (this.encodeService.IsEncoding && !this.encodeService.IsPasued)
+ {
+ this.lowPowerPause = true;
+ this.encodeService.Pause();
+ }
+
+ Win32.AllowSleep();
+
+ this.ServiceLogMessage(string.Format(Resources.SystemService_LowBatteryLog, state.BatteryLifePercent));
+ this.lowStateHit = true;
+ }
+
+ if (state.ACLineStatus == Win32.ACLineStatus.Offline && state.BatteryFlag == Win32.BatteryFlag.Critical && !this.criticalStateHit)
+ {
+ if (this.encodeService.IsEncoding && !this.encodeService.IsPasued)
+ {
+ this.lowPowerPause = true;
+ this.encodeService.Pause(); // In case we missed the low state!
+ }
+
+ Win32.AllowSleep();
+
+ this.ServiceLogMessage(string.Format(Resources.SystemService_CriticalBattery, state.BatteryLifePercent));
+ this.criticalStateHit = true;
+ }
+
+ // Reset the flags when we start charging.
+ if (state.ACLineStatus == Win32.ACLineStatus.Online && state.BatteryFlag >= Win32.BatteryFlag.Low)
+ {
+ if (this.lowPowerPause && this.encodeService.IsPasued)
+ {
+ this.encodeService.Resume();
+ this.ServiceLogMessage(string.Format(Resources.SystemService_ACMains, state.BatteryLifePercent));
+ }
+
+ this.lowPowerPause = false;
+ this.criticalStateHit = false;
+ this.lowStateHit = false;
+ }
+ }
+
+ private void ServiceLogMessage(string message)
+ {
+ this.log.LogMessage(string.Format("{0}# {1}{0}", Environment.NewLine, message), LogMessageType.Application, LogLevel.Info);
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
index 4f1f6c159..69be73360 100644
--- a/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
+++ b/win/CS/HandBrakeWPF/Startup/AppBootstrapper.cs
@@ -79,7 +79,8 @@ namespace HandBrakeWPF.Startup
this.container.Singleton<ICountdownAlertViewModel, CountdownAlertViewModel>();
this.container.Singleton<IMiniViewModel, MiniViewModel>();
this.container.Singleton<IStaticPreviewViewModel, StaticPreviewViewModel>();
-
+ this.container.Singleton<ISystemService, SystemService>();
+
// Tab Components
this.container.Singleton<IAudioViewModel, AudioViewModel>();
this.container.Singleton<IPictureSettingsViewModel, PictureSettingsViewModel>();
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs
index 1f6ed72db..c5c9d5ad7 100644
--- a/win/CS/HandBrakeWPF/UserSettingConstants.cs
+++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs
@@ -36,7 +36,8 @@ namespace HandBrakeWPF
public const string SendFileToArgs = "SendFileToArgs";
public const string PreventSleep = "PreventSleep";
public const string PauseOnLowDiskspace = "PauseOnLowDiskspace";
- public const string PauseOnLowDiskspaceLevel = "LowDiskSpaceWarningLevelInBytes";
+ public const string PauseQueueOnLowDiskspaceLevel = "LowDiskSpaceWarningLevelInBytes";
+ public const string PauseEncodeOnLowDiskspaceLevel = "LowDiskSpaceEncodePauseLevelInBytes";
public const string RemovePunctuation = "RemovePunctuation";
public const string ShowPresetPanel = "ShowPresetPanelOption";
public const string ResetWhenDoneAction = "ResetWhenDoneAction";
diff --git a/win/CS/HandBrakeWPF/Utilities/Win32.cs b/win/CS/HandBrakeWPF/Utilities/Win32.cs
index 12154331a..f999e7628 100644
--- a/win/CS/HandBrakeWPF/Utilities/Win32.cs
+++ b/win/CS/HandBrakeWPF/Utilities/Win32.cs
@@ -195,5 +195,48 @@ namespace HandBrakeWPF.Utilities
{
executor = marshaller;
}
+
+ [StructLayout(LayoutKind.Sequential)]
+ public class PowerState
+ {
+ public ACLineStatus ACLineStatus;
+ public BatteryFlag BatteryFlag;
+ public Byte BatteryLifePercent;
+ public Byte SystemStatusFlag;
+ public Int32 BatteryLifeTime;
+ public Int32 BatteryFullLifeTime;
+
+ public static PowerState GetPowerState()
+ {
+ PowerState state = new PowerState();
+ if (GetSystemPowerStatusRef(state))
+ {
+ return state;
+ }
+
+ return null;
+ }
+
+ [DllImport("Kernel32", EntryPoint = "GetSystemPowerStatus")]
+ private static extern bool GetSystemPowerStatusRef(PowerState sps);
+ }
+
+ public enum ACLineStatus : byte
+ {
+ Offline = 0,
+ Online = 1,
+ Unknown = 255
+ }
+
+ public enum BatteryFlag : byte
+ {
+ High = 1,
+ Low = 2,
+ Critical = 4,
+ Charging = 8,
+ NoSystemBattery = 128,
+ Unknown = 255
+ }
}
}
+
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index c1cd1aafb..731a2e090 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -110,12 +110,26 @@ namespace HandBrakeWPF.ViewModels
/// The viewmodel for HandBrakes main window.
/// </summary>
/// <remarks>whenDoneService must be a serivce here!</remarks>
- public MainViewModel(IUserSettingService userSettingService, IScan scanService, IPresetService presetService,
- IErrorService errorService, IUpdateService updateService,
- IPrePostActionService whenDoneService, IWindowManager windowManager, IPictureSettingsViewModel pictureSettingsViewModel, IVideoViewModel videoViewModel, ISummaryViewModel summaryViewModel,
- IFiltersViewModel filtersViewModel, IAudioViewModel audioViewModel, ISubtitlesViewModel subtitlesViewModel,
- IChaptersViewModel chaptersViewModel, IStaticPreviewViewModel staticPreviewViewModel,
- IQueueViewModel queueViewModel, IMetaDataViewModel metaDataViewModel, INotifyIconService notifyIconService)
+ public MainViewModel(
+ IUserSettingService userSettingService,
+ IScan scanService,
+ IPresetService presetService,
+ IErrorService errorService,
+ IUpdateService updateService,
+ IPrePostActionService whenDoneService,
+ IWindowManager windowManager,
+ IPictureSettingsViewModel pictureSettingsViewModel,
+ IVideoViewModel videoViewModel,
+ ISummaryViewModel summaryViewModel,
+ IFiltersViewModel filtersViewModel,
+ IAudioViewModel audioViewModel,
+ ISubtitlesViewModel subtitlesViewModel,
+ IChaptersViewModel chaptersViewModel,
+ IStaticPreviewViewModel staticPreviewViewModel,
+ IQueueViewModel queueViewModel,
+ IMetaDataViewModel metaDataViewModel,
+ INotifyIconService notifyIconService,
+ ISystemService systemService)
: base(userSettingService)
{
this.scanService = scanService;
@@ -184,6 +198,8 @@ namespace HandBrakeWPF.ViewModels
// Setup Commands
this.QueueCommand = new QueueCommands(this.QueueViewModel);
+ // Monitor the system.
+ systemService.Start();
}
#region View Model Properties
@@ -1377,7 +1393,7 @@ namespace HandBrakeWPF.ViewModels
if (!DriveUtilities.HasMinimumDiskSpace(
this.Destination,
- this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseOnLowDiskspaceLevel)))
+ this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseQueueOnLowDiskspaceLevel)))
{
return new AddQueueError(Resources.Main_LowDiskspace, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 4375e2a08..b8d9b89f2 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -1582,7 +1582,7 @@ namespace HandBrakeWPF.ViewModels
this.PreventSleep = userSettingService.GetUserSetting<bool>(UserSettingConstants.PreventSleep);
this.PauseOnLowDiskspace = userSettingService.GetUserSetting<bool>(UserSettingConstants.PauseOnLowDiskspace);
- this.PauseOnLowDiskspaceLevel = this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseOnLowDiskspaceLevel);
+ this.PauseOnLowDiskspaceLevel = this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseQueueOnLowDiskspaceLevel);
// Log Verbosity Level
this.logVerbosityOptions.Clear();
@@ -1723,7 +1723,7 @@ namespace HandBrakeWPF.ViewModels
this.userSettingService.SetUserSetting(UserSettingConstants.ProcessPriority, this.SelectedPriority);
this.userSettingService.SetUserSetting(UserSettingConstants.PreventSleep, this.PreventSleep);
this.userSettingService.SetUserSetting(UserSettingConstants.PauseOnLowDiskspace, this.PauseOnLowDiskspace);
- this.userSettingService.SetUserSetting(UserSettingConstants.PauseOnLowDiskspaceLevel, this.PauseOnLowDiskspaceLevel);
+ this.userSettingService.SetUserSetting(UserSettingConstants.PauseQueueOnLowDiskspaceLevel, this.PauseOnLowDiskspaceLevel);
this.userSettingService.SetUserSetting(UserSettingConstants.Verbosity, this.SelectedVerbosity);
this.userSettingService.SetUserSetting(UserSettingConstants.SaveLogWithVideo, this.CopyLogToEncodeDirectory);
this.userSettingService.SetUserSetting(UserSettingConstants.SaveLogToCopyDirectory, this.CopyLogToSepcficedLocation);
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 362f10ec6..f82ec9621 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -487,7 +487,7 @@ namespace HandBrakeWPF.ViewModels
var firstOrDefault = this.QueueTasks.FirstOrDefault(s => s.Status == QueueItemStatus.Waiting);
if (firstOrDefault != null && !DriveUtilities.HasMinimumDiskSpace(firstOrDefault.Task.Destination,
- this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseOnLowDiskspaceLevel)))
+ this.userSettingService.GetUserSetting<long>(UserSettingConstants.PauseQueueOnLowDiskspaceLevel)))
{
this.errorService.ShowMessageBox(Resources.Main_LowDiskspace, Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
return;
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml
index 91ecbb494..08ef76557 100644
--- a/win/CS/HandBrakeWPF/defaultsettings.xml
+++ b/win/CS/HandBrakeWPF/defaultsettings.xml
@@ -410,6 +410,14 @@
</item>
<item>
<key>
+ <string>LowDiskSpaceEncodePauseLevelInBytes</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:long" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">2000000000</anyType>
+ </value>
+ </item>
+ <item>
+ <key>
<string>ForcePresetReset</string>
</key>
<value>