diff options
Diffstat (limited to 'win/CS')
47 files changed, 162 insertions, 167 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs index f803887d1..de0f0b2bc 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeInstance.cs @@ -216,6 +216,9 @@ namespace HandBrake.ApplicationServices.Interop /// <param name="titleIndex">
/// The title index to scan (1-based, 0 for all titles).
/// </param>
+ /// <param name="clEnabled">
+ /// OpenCL enabled.
+ /// </param>
public void StartScan(string path, int previewCount, TimeSpan minDuration, int titleIndex, bool clEnabled = false)
{
this.previewCount = previewCount;
@@ -516,9 +519,6 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// Checks the status of the ongoing encode.
/// </summary>
- /// <summary>
- /// Checks the status of the ongoing encode.
- /// </summary>
[HandleProcessCorruptedStateExceptions]
private void PollEncodeProgress()
{
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs index b77c2b9a6..343280031 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/HandBrakeLanguagesHelper.cs @@ -18,7 +18,7 @@ namespace HandBrake.ApplicationServices.Interop /// <summary>
/// Contains utilities for converting language codes.
/// </summary>
- public static class Languages
+ public static class HandBrakeLanguagesHelper
{
/// <summary>
/// The list of all languages.
diff --git a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs index d840d5d7f..c193527eb 100644 --- a/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs +++ b/win/CS/HandBrake.ApplicationServices/Interop/Json/Encode/MetaData.cs @@ -1,5 +1,5 @@ // --------------------------------------------------------------------------------------------------------------------
-// <copyright file="MetaData.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="Metadata.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>
diff --git a/win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs b/win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs index 6290004c8..f8b2eb69f 100644 --- a/win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs +++ b/win/CS/HandBrake.ApplicationServices/Model/HBConfiguration.cs @@ -57,7 +57,7 @@ namespace HandBrake.ApplicationServices.Model /// <summary>
/// Gets or sets a value indicating whether save log with video.
/// </summary>
- public bool SaveLogWithVideo{ get; set; }
+ public bool SaveLogWithVideo { get; set; }
/// <summary>
/// Gets or sets the save log copy directory.
diff --git a/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs b/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs index 95a1ec515..ef869570a 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/Logging/LogService.cs @@ -33,7 +33,7 @@ namespace HandBrake.ApplicationServices.Services.Logging // Make this class Thread Safe. private static ILog loggerInstance; private readonly object lockObject = new object(); - private readonly object FileWriterLock = new object(); + private readonly object fileWriterLock = new object(); private readonly StringBuilder logBuilder = new StringBuilder(); private LogLevel currentLogLevel = LogLevel.Error; @@ -198,7 +198,7 @@ namespace HandBrake.ApplicationServices.Services.Logging this.isDiskLoggingEnabled = true; this.deleteLogFirst = deleteCurrentLogFirst; - lock (this.FileWriterLock) + lock (this.fileWriterLock) { this.fileWriter = new StreamWriter(logFile) { AutoFlush = true }; } @@ -209,7 +209,7 @@ namespace HandBrake.ApplicationServices.Services.Logging if (this.fileWriter != null) { - lock (this.FileWriterLock) + lock (this.fileWriterLock) { this.fileWriter.Flush(); this.fileWriter.Close(); @@ -252,7 +252,7 @@ namespace HandBrake.ApplicationServices.Services.Logging try { - lock (this.FileWriterLock) + lock (this.fileWriterLock) { if (this.fileWriter != null) { @@ -299,7 +299,7 @@ namespace HandBrake.ApplicationServices.Services.Logging try { - lock (this.FileWriterLock) + lock (this.fileWriterLock) { if (this.fileWriter != null && this.fileWriter.BaseStream.CanWrite) { @@ -335,7 +335,7 @@ namespace HandBrake.ApplicationServices.Services.Logging { try { - lock (this.FileWriterLock) + lock (this.fileWriterLock) { if (this.fileWriter != null) { diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs index 73971ff08..85f4e3902 100644 --- a/win/CS/HandBrakeWPF/App.xaml.cs +++ b/win/CS/HandBrakeWPF/App.xaml.cs @@ -46,8 +46,8 @@ namespace HandBrakeWPF /// </param>
protected override void OnStartup(StartupEventArgs e)
{
- OperatingSystem OS = Environment.OSVersion;
- if ((OS.Platform == PlatformID.Win32NT) && (OS.Version.Major == 5 && OS.Version.Minor <= 1))
+ OperatingSystem os = Environment.OSVersion;
+ if ((os.Platform == PlatformID.Win32NT) && (os.Version.Major == 5 && os.Version.Minor <= 1))
{
MessageBox.Show("Windows XP and earlier are no longer supported. Version 0.9.9 was the last version to support these versions. ", "Notice", MessageBoxButton.OK, MessageBoxImage.Warning);
Application.Current.Shutdown();
diff --git a/win/CS/HandBrakeWPF/AttachedProperties/MenuItemExtensions.cs b/win/CS/HandBrakeWPF/AttachedProperties/MenuItemExtensions.cs index e08cf59c6..4654d7ba2 100644 --- a/win/CS/HandBrakeWPF/AttachedProperties/MenuItemExtensions.cs +++ b/win/CS/HandBrakeWPF/AttachedProperties/MenuItemExtensions.cs @@ -9,7 +9,6 @@ namespace HandBrakeWPF.AttachedProperties
{
- using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
@@ -28,12 +27,12 @@ namespace HandBrakeWPF.AttachedProperties "GroupName",
typeof(string),
typeof(MenuItemExtensions),
- new PropertyMetadata(String.Empty, OnGroupNameChanged));
+ new PropertyMetadata(string.Empty, OnGroupNameChanged));
/// <summary>
/// The element to group names.
/// </summary>
- public static Dictionary<MenuItem, String> ElementToGroupNames = new Dictionary<MenuItem, String>();
+ public static Dictionary<MenuItem, string> ElementToGroupNames = new Dictionary<MenuItem, string>();
#endregion
diff --git a/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs b/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs index 06c566991..3a50c36e3 100644 --- a/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs +++ b/win/CS/HandBrakeWPF/Commands/ProcessShortcutCommand.cs @@ -91,7 +91,7 @@ namespace HandBrakeWPF.Commands }
// Scan a Folder (Ctrl+Shift+O)
- if (gesture.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && gesture.Key == Key.O)
+ if (gesture.Modifiers == (ModifierKeys.Control | ModifierKeys.Shift) && gesture.Key == Key.O)
{
mainViewModel.FolderScan();
}
diff --git a/win/CS/HandBrakeWPF/Controls/Loading.xaml.cs b/win/CS/HandBrakeWPF/Controls/Loading.xaml.cs index 102788492..5f1a83533 100644 --- a/win/CS/HandBrakeWPF/Controls/Loading.xaml.cs +++ b/win/CS/HandBrakeWPF/Controls/Loading.xaml.cs @@ -9,10 +9,10 @@ namespace HandBrakeWPF.Controls
{
- using System.Windows.Threading;
using System;
using System.Windows;
using System.Windows.Controls;
+ using System.Windows.Threading;
/// <summary>
/// Interaction logic for Loading.xaml
diff --git a/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs b/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs index 5003068d1..adf17eb46 100644 --- a/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs +++ b/win/CS/HandBrakeWPF/Controls/SplitButton/SplitMenuButton.cs @@ -179,7 +179,7 @@ namespace HandBrakeWPF.Controls.SplitButton throw new ArgumentNullException("e");
}
- if (Key.Down == e.Key || Key.Up == e.Key)
+ if (e.Key == Key.Down || e.Key == Key.Up)
{
this.Dispatcher.BeginInvoke((Action)this.OpenButtonMenu);
}
@@ -286,7 +286,7 @@ namespace HandBrakeWPF.Controls.SplitButton this.contextMenu.HorizontalOffset = desiredOffset.X - currentOffset.X;
this.contextMenu.VerticalOffset = desiredOffset.Y - currentOffset.Y;
- if (FlowDirection.RightToLeft == this.FlowDirection)
+ if (this.FlowDirection == FlowDirection.RightToLeft)
{
this.contextMenu.HorizontalOffset *= -1;
}
diff --git a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs index 64e279517..02dabfe50 100644 --- a/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs +++ b/win/CS/HandBrakeWPF/Controls/StatusPanel.xaml.cs @@ -149,13 +149,13 @@ namespace HandBrakeWPF.Controls }
/// <summary>
- ///
+ /// Gets a value indicating whether is action 2 button visible.
/// </summary>
public bool IsActionButton2Visibile
{
get
{
- return true; //SecondaryAction != null;
+ return true; // SecondaryAction != null;
}
}
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs index b40f61071..7f70288ce 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioEncoderConverter.cs @@ -118,7 +118,7 @@ namespace HandBrakeWPF.Converters.Audio string name = value as string;
if (!string.IsNullOrEmpty(name))
{
- return new object[] { EnumHelper<AudioEncoder>.GetValue(name)};
+ return new object[] { EnumHelper<AudioEncoder>.GetValue(name) };
}
return null;
diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs index e1a371743..0ef315fba 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownConverter.cs @@ -9,10 +9,9 @@ namespace HandBrakeWPF.Converters.Audio { + using System; using System.Globalization; using System.Windows.Data; - using System; - using HandBrake.ApplicationServices.Interop; using HandBrake.ApplicationServices.Interop.Model.Encoding; diff --git a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs index 432fdaaf7..df108d961 100644 --- a/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Audio/AudioMixdownListConverter.cs @@ -9,14 +9,12 @@ namespace HandBrakeWPF.Converters.Audio { - using System.Globalization; - using System.Windows.Data; using System; using System.ComponentModel; - + using System.Globalization; + using System.Windows.Data; using HandBrake.ApplicationServices.Interop; using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrakeWPF.Services.Encode.Model.Models; using HandBrakeWPF.Utilities; diff --git a/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs b/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs index a01b3bf67..5273a3210 100644 --- a/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/BooleanConverter.cs @@ -9,9 +9,9 @@ namespace HandBrakeWPF.Converters
{
+ using System;
using System.Globalization;
using System.Windows.Data;
- using System;
/// <summary>
/// Boolean to Visibility Converter
@@ -41,7 +41,7 @@ namespace HandBrakeWPF.Converters // Paramater is a boolean which inverts the output.
var param = System.Convert.ToBoolean(parameter, CultureInfo.InvariantCulture);
- if (value is Boolean)
+ if (value is bool)
{
return param ? !(bool)value : value;
}
diff --git a/win/CS/HandBrakeWPF/Converters/BooleanToHiddenVisibilityConverter.cs b/win/CS/HandBrakeWPF/Converters/BooleanToHiddenVisibilityConverter.cs index c6a66e1f6..d60ab33c3 100644 --- a/win/CS/HandBrakeWPF/Converters/BooleanToHiddenVisibilityConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/BooleanToHiddenVisibilityConverter.cs @@ -9,10 +9,10 @@ namespace HandBrakeWPF.Converters
{
+ using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
- using System;
/// <summary>
/// Boolean to Visibility Converter (Hidden, not Collasped)
@@ -47,7 +47,7 @@ namespace HandBrakeWPF.Converters return Visibility.Hidden;
}
- if (value is Boolean)
+ if (value is bool)
{
if (param)
{
diff --git a/win/CS/HandBrakeWPF/Converters/BooleanToVisibilityConverter.cs b/win/CS/HandBrakeWPF/Converters/BooleanToVisibilityConverter.cs index 31da7ed74..6c9d7fd12 100644 --- a/win/CS/HandBrakeWPF/Converters/BooleanToVisibilityConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/BooleanToVisibilityConverter.cs @@ -9,10 +9,10 @@ namespace HandBrakeWPF.Converters
{
+ using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
- using System;
/// <summary>
/// Boolean to Visibility Converter
@@ -47,7 +47,7 @@ namespace HandBrakeWPF.Converters return Visibility.Collapsed;
}
- if (value is Boolean)
+ if (value is bool)
{
if (param)
{
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs index b803e1126..91c30311a 100644 --- a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs @@ -9,17 +9,14 @@ namespace HandBrakeWPF.Converters
{
+ using System;
using System.Collections.Generic;
using System.Globalization;
using System.Windows.Data;
- using System;
-
- using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
-
+ using HandBrake.ApplicationServices.Model;
using HandBrakeWPF.Services.Queue.Model;
using HandBrakeWPF.Utilities;
-
using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat;
using PresetPictureSettingsMode = HandBrakeWPF.Model.Picture.PresetPictureSettingsMode;
diff --git a/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs b/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs index 62012be3d..098d9e952 100644 --- a/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/PresetsMenuConverter.cs @@ -45,7 +45,7 @@ namespace HandBrakeWPF.Converters { if (groupedMenu.ContainsKey(item.Category)) { - MenuItem newMeuItem = new MenuItem { Header = item.Name, Tag = item, Command = new PresetMenuSelectCommand(item)}; + MenuItem newMeuItem = new MenuItem { Header = item.Name, Tag = item, Command = new PresetMenuSelectCommand(item) }; if (item.IsDefault) { newMeuItem.FontStyle = FontStyles.Italic; diff --git a/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs b/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs index 9af228b0e..7b7cbc220 100644 --- a/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs +++ b/win/CS/HandBrakeWPF/Converters/Queue/PictureSettingsDescConveter.cs @@ -9,12 +9,10 @@ namespace HandBrakeWPF.Converters.Queue { + using System; using System.Globalization; using System.Windows.Data; - using System; - using HandBrake.ApplicationServices.Interop.Model.Encoding; - using HandBrakeWPF.Services.Encode.Model; /// <summary> diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs index 16559f8d0..d0e7cf556 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/VideoEncoderConverter.cs @@ -16,7 +16,6 @@ namespace HandBrakeWPF.Converters.Video using System.Windows.Data;
using HandBrake.ApplicationServices.Interop;
- using HandBrake.ApplicationServices.Utilities;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrakeWPF.Utilities;
@@ -121,7 +120,7 @@ namespace HandBrakeWPF.Converters.Video string name = value as string;
if (!string.IsNullOrEmpty(name))
{
- return new object[] { EnumHelper<VideoEncoder>.GetValue(name)};
+ return new object[] { EnumHelper<VideoEncoder>.GetValue(name) };
}
return null;
diff --git a/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs b/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs index 01265f228..4a6c036c4 100644 --- a/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs +++ b/win/CS/HandBrakeWPF/Converters/Video/VideoOptionsTooltipConverter.cs @@ -13,7 +13,6 @@ namespace HandBrakeWPF.Converters.Video using System.Globalization;
using System.Windows.Data;
- using HandBrake.ApplicationServices.Utilities;
using HandBrake.ApplicationServices.Interop.Model.Encoding;
using HandBrakeWPF.Utilities;
diff --git a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs index 47a852a0c..3465cfadf 100644 --- a/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/AutoNameHelper.cs @@ -58,7 +58,7 @@ namespace HandBrakeWPF.Helpers {
// Get the Source Name and remove any invalid characters
string sourceName = Path.GetInvalidFileNameChars().Aggregate(sourceOrLabelName, (current, character) => current.Replace(character.ToString(), string.Empty));
- // string sanitisedPresetName = presetName != null ? Path.GetInvalidFileNameChars().Aggregate(presetName.Name, (current, character) => current.Replace(character.ToString(), string.Empty)) : string.Empty;
+ // string sanitisedPresetName = presetName != null ? Path.GetInvalidFileNameChars().Aggregate(presetName.Name, (current, character) => current.Replace(character.ToString(), string.Empty)) : string.Empty;
// Remove Underscores
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.AutoNameRemoveUnderscore))
@@ -99,7 +99,7 @@ namespace HandBrakeWPF.Helpers .Replace(Constants.Chapters, combinedChapterTag)
.Replace(Constants.Date, DateTime.Now.Date.ToShortDateString().Replace('/', '-'))
.Replace(Constants.Time, DateTime.Now.ToString("HH:mm"));
- // .Replace(Constants.Preset, sanitisedPresetName);
+ // .Replace(Constants.Preset, sanitisedPresetName);
if (task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality)
{
@@ -108,12 +108,16 @@ namespace HandBrakeWPF.Helpers }
else
{
- destinationFilename = destinationFilename.Replace(Constants.Bitrate, task.VideoBitrate.ToString());
+ destinationFilename = destinationFilename.Replace(
+ Constants.Bitrate,
+ task.VideoBitrate.ToString());
destinationFilename = destinationFilename.Replace(Constants.Quality, string.Empty);
}
}
else
+ {
destinationFilename = sourceName + "_T" + dvdTitle + "_C" + combinedChapterTag;
+ }
/*
* File Extension
@@ -134,7 +138,9 @@ namespace HandBrakeWPF.Helpers }
}
else if (task.OutputFormat == OutputFormat.Mkv)
+ {
destinationFilename += ".mkv";
+ }
/*
* File Destination Path
@@ -177,11 +183,15 @@ namespace HandBrakeWPF.Helpers {
autoNamePath = Path.Combine(userSettingService.GetUserSetting<string>(UserSettingConstants.AutoNamePath), destinationFilename);
}
- else // ...otherwise, output to the source directory
+ else
+ {
+ // ...otherwise, output to the source directory
autoNamePath = null;
+ }
}
- else // Otherwise, use the path that is already there.
+ else
{
+ // Otherwise, use the path that is already there.
// Use the path and change the file extension to match the previous destination
autoNamePath = Path.Combine(Path.GetDirectoryName(task.Destination), destinationFilename);
}
diff --git a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs index 40c73251a..93b85e6e4 100644 --- a/win/CS/HandBrakeWPF/Helpers/PictureSize.cs +++ b/win/CS/HandBrakeWPF/Helpers/PictureSize.cs @@ -186,7 +186,7 @@ namespace HandBrakeWPF.Helpers maxHeight = job.MaxHeight,
mode = (int)job.AnamorphicMode,
modulus = job.Modulus.HasValue ? job.Modulus.Value : 16,
- geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW }}
+ geometry = new hb_geometry_s { height = job.Height, width = job.Width, par = job.AnamorphicMode != Anamorphic.Custom ? new hb_rational_t { den = title.ParH, num = title.ParW } : new hb_rational_t { den = job.ParH, num = job.ParW } }
};
hb_geometry_s sourceGeometry = new hb_geometry_s
diff --git a/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs b/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs index 91a4ee1d8..e3f4dfb59 100644 --- a/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs +++ b/win/CS/HandBrakeWPF/Helpers/TimeSpanHelper.cs @@ -9,8 +9,8 @@ namespace HandBrakeWPF.Helpers { - using System.Globalization; using System; + using System.Globalization; /// <summary> /// Helper functions for handling <see cref="TimeSpan"/> structures diff --git a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs index d5350439a..78c20d52c 100644 --- a/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs +++ b/win/CS/HandBrakeWPF/Model/Audio/AudioBehaviourTrack.cs @@ -12,16 +12,13 @@ namespace HandBrakeWPF.Model.Audio using System.Collections.Generic; using System.Globalization; using System.Linq; - using HandBrake.ApplicationServices.Interop; using HandBrake.ApplicationServices.Interop.Model; using HandBrake.ApplicationServices.Interop.Model.Encoding; - + using Newtonsoft.Json; using Services.Encode.Model.Models; using Utilities; - using Newtonsoft.Json; - /// <summary> /// Model of a HandBrake Audio Track and it's associated behaviours. /// </summary> diff --git a/win/CS/HandBrakeWPF/Services/ErrorService.cs b/win/CS/HandBrakeWPF/Services/ErrorService.cs index 3228ab363..21c04cd58 100644 --- a/win/CS/HandBrakeWPF/Services/ErrorService.cs +++ b/win/CS/HandBrakeWPF/Services/ErrorService.cs @@ -11,8 +11,8 @@ namespace HandBrakeWPF.Services {
using System;
using System.Windows;
- using Interfaces;
using Caliburn.Micro;
+ using Interfaces;
using ViewModels.Interfaces;
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs index 9afdafd9a..59307e5ed 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Factories/JsonPresetFactory.cs @@ -602,7 +602,6 @@ namespace HandBrakeWPF.Services.Presets.Factories ? "decomb"
: export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? "yadif" : "off";
-
preset.PictureDeinterlacePreset = export.Task.DeinterlaceFilter == DeinterlaceFilter.Decomb
? EnumHelper<Decomb>.GetShortName(export.Task.Decomb)
: export.Task.DeinterlaceFilter == DeinterlaceFilter.Yadif ? EnumHelper<Deinterlace>.GetShortName(export.Task.Deinterlace) : string.Empty;
@@ -621,7 +620,6 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.PictureDenoiseTune = EnumHelper<DenoiseTune>.GetShortName(export.Task.DenoiseTune);
preset.PictureDetelecine = EnumHelper<Detelecine>.GetShortName(export.Task.Detelecine);
preset.PictureDetelecineCustom = export.Task.CustomDetelecine;
-
// Video
preset.VideoEncoder = EnumHelper<VideoEncoder>.GetShortName(export.Task.VideoEncoder);
@@ -631,7 +629,7 @@ namespace HandBrakeWPF.Services.Presets.Factories preset.VideoLevel = export.Task.VideoLevel != null ? export.Task.VideoLevel.ShortName : null;
preset.VideoOptionExtra = export.Task.ExtraAdvancedArguments;
preset.VideoPreset = export.Task.VideoPreset != null ? export.Task.VideoPreset.ShortName : null;
- preset.VideoProfile = export.Task.VideoProfile != null ? export.Task.VideoProfile.ShortName : null;
+ preset.VideoProfile = export.Task.VideoProfile != null ? export.Task.VideoProfile.ShortName : null;
preset.VideoQSVAsyncDepth = 4; // Defaulted to 4 for now.
preset.VideoQSVDecode = !config.DisableQuickSyncDecoding;
preset.VideoQualitySlider = export.Task.Quality.HasValue ? export.Task.Quality.Value : 0;
diff --git a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs index 04e2395ea..8b6aee917 100644 --- a/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs +++ b/win/CS/HandBrakeWPF/Services/Presets/Model/Preset.cs @@ -24,7 +24,7 @@ namespace HandBrakeWPF.Services.Presets.Model /// https://github.com/Caliburn-Micro/Caliburn.Micro/issues/89
/// https://github.com/Caliburn-Micro/Caliburn.Micro/issues/96
/// </remarks>
- public class Preset : PropertyChangedBase // Delibery not
+ public class Preset : PropertyChangedBase // Delibery not
{
#region Constants and Fields
diff --git a/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs b/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs index 5b2250f64..64d2e6ec9 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/QueueProcessor.cs @@ -266,7 +266,7 @@ namespace HandBrakeWPF.Services.Queue {
foreach (QueueTask job in this.queue)
{
- if (String.Equals(
+ if (string.Equals(
job.Task.Destination,
destination.Replace("\\\\", "\\"),
StringComparison.OrdinalIgnoreCase)
diff --git a/win/CS/HandBrakeWPF/Services/UpdateService.cs b/win/CS/HandBrakeWPF/Services/UpdateService.cs index 6a8885a07..362df2e33 100644 --- a/win/CS/HandBrakeWPF/Services/UpdateService.cs +++ b/win/CS/HandBrakeWPF/Services/UpdateService.cs @@ -15,15 +15,11 @@ namespace HandBrakeWPF.Services using System.Net;
using System.Reflection;
using System.Security.Cryptography;
- using System.Text;
using System.Threading;
-
- using HandBrake.ApplicationServices.Utilities;
using HandBrake.ApplicationServices.Interop;
-
+ using HandBrake.ApplicationServices.Utilities;
using HandBrakeWPF.Model;
using HandBrakeWPF.Services.Interfaces;
-
using AppcastReader = HandBrakeWPF.Utilities.AppcastReader;
/// <summary>
@@ -110,7 +106,7 @@ namespace HandBrakeWPF.Services var currentBuild = HandBrakeUtils.Build;
// Fetch the Appcast from our server.
- HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AllowAutoRedirect = false; // We will never do this.
WebResponse response = request.GetResponse();
@@ -196,7 +192,7 @@ namespace HandBrakeWPF.Services while ((bytesSize = responceStream.Read(downBuffer, 0, downBuffer.Length)) > 0)
{
localStream.Write(downBuffer, 0, bytesSize);
- progress(new DownloadStatus { BytesRead = localStream.Length, TotalBytes = fileSize});
+ progress(new DownloadStatus { BytesRead = localStream.Length, TotalBytes = fileSize });
}
responceStream.Close();
diff --git a/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs b/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs index df7f2a1a3..7a58721b3 100644 --- a/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs +++ b/win/CS/HandBrakeWPF/Utilities/DirectoryUtilities.cs @@ -71,7 +71,7 @@ namespace HandBrakeWPF.Utilities if (!Directory.Exists(dirPath)) { MessageBoxResult result = errorService.ShowMessageBox(string.Format(Resources.DirectoryUtils_CreateFolderMsg, dirPath), Resources.DirectoryUtils_CreateFolder, MessageBoxButton.YesNo, MessageBoxImage.Question); - if (MessageBoxResult.Yes == result) + if (result == MessageBoxResult.Yes) { Directory.CreateDirectory(dirPath); } diff --git a/win/CS/HandBrakeWPF/Utilities/ExtensionMethods.cs b/win/CS/HandBrakeWPF/Utilities/ExtensionMethods.cs index f25b8be8e..1379f432a 100644 --- a/win/CS/HandBrakeWPF/Utilities/ExtensionMethods.cs +++ b/win/CS/HandBrakeWPF/Utilities/ExtensionMethods.cs @@ -37,7 +37,9 @@ namespace HandBrakeWPF.Utilities memberExpression = (MemberExpression)unaryExpression.Operand; } else + { memberExpression = (MemberExpression)lambda.Body; + } return memberExpression.Member; } diff --git a/win/CS/HandBrakeWPF/Utilities/GeneralUtilities.cs b/win/CS/HandBrakeWPF/Utilities/GeneralUtilities.cs index 18583acd8..2492de888 100644 --- a/win/CS/HandBrakeWPF/Utilities/GeneralUtilities.cs +++ b/win/CS/HandBrakeWPF/Utilities/GeneralUtilities.cs @@ -107,15 +107,15 @@ namespace HandBrakeWPF.Utilities gpuBuilder.Append("GPU Information is unavailable"); } - logHeader.AppendLine(String.Format("HandBrake {0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion())); - logHeader.AppendLine(String.Format("OS: {0} - {1}", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64bit" : "32bit")); - logHeader.AppendLine(String.Format("CPU: {0}", SystemInfo.GetCpuCount)); - logHeader.AppendLine(String.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory)); - logHeader.AppendLine(String.Format("GPU Information:{0}{1}", Environment.NewLine, gpuBuilder.ToString().TrimEnd())); - logHeader.AppendLine(String.Format("Screen: {0}x{1}", SystemInfo.ScreenBounds.Bounds.Width, SystemInfo.ScreenBounds.Bounds.Height)); - logHeader.AppendLine(String.Format("Temp Dir: {0}", Path.GetTempPath())); - logHeader.AppendLine(String.Format("Install Dir: {0}", Application.StartupPath)); - logHeader.AppendLine(String.Format("Data Dir: {0}\n", Application.UserAppDataPath)); + logHeader.AppendLine(string.Format("HandBrake {0} - {1}", VersionHelper.GetVersion(), VersionHelper.GetPlatformBitnessVersion())); + logHeader.AppendLine(string.Format("OS: {0} - {1}", Environment.OSVersion, Environment.Is64BitOperatingSystem ? "64bit" : "32bit")); + logHeader.AppendLine(string.Format("CPU: {0}", SystemInfo.GetCpuCount)); + logHeader.AppendLine(string.Format("Ram: {0} MB, ", SystemInfo.TotalPhysicalMemory)); + logHeader.AppendLine(string.Format("GPU Information:{0}{1}", Environment.NewLine, gpuBuilder.ToString().TrimEnd())); + logHeader.AppendLine(string.Format("Screen: {0}x{1}", SystemInfo.ScreenBounds.Bounds.Width, SystemInfo.ScreenBounds.Bounds.Height)); + logHeader.AppendLine(string.Format("Temp Dir: {0}", Path.GetTempPath())); + logHeader.AppendLine(string.Format("Install Dir: {0}", Application.StartupPath)); + logHeader.AppendLine(string.Format("Data Dir: {0}\n", Application.UserAppDataPath)); logHeader.AppendLine("-------------------------------------------"); diff --git a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs index f9e2acee9..13a88ed44 100644 --- a/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs +++ b/win/CS/HandBrakeWPF/Utilities/Input/ChapterImporterTxt.cs @@ -12,9 +12,8 @@ namespace HandBrakeWPF.Utilities.Input { using System; using System.Collections.Generic; - using System.Linq; using System.IO; - + using System.Linq; using HandBrakeWPF.Helpers; /// <summary> diff --git a/win/CS/HandBrakeWPF/Utilities/Portable.cs b/win/CS/HandBrakeWPF/Utilities/Portable.cs index 9b5981675..68eac79e2 100644 --- a/win/CS/HandBrakeWPF/Utilities/Portable.cs +++ b/win/CS/HandBrakeWPF/Utilities/Portable.cs @@ -9,8 +9,8 @@ namespace HandBrakeWPF.Utilities { - using System.Collections.Generic; using System; + using System.Collections.Generic; using System.IO; /// <summary> diff --git a/win/CS/HandBrakeWPF/Utilities/SystemInfo.cs b/win/CS/HandBrakeWPF/Utilities/SystemInfo.cs index 9ed362e32..f344cf3d6 100644 --- a/win/CS/HandBrakeWPF/Utilities/SystemInfo.cs +++ b/win/CS/HandBrakeWPF/Utilities/SystemInfo.cs @@ -80,12 +80,12 @@ namespace HandBrakeWPF.Utilities { string gpu = string.Empty, version = string.Empty; - foreach (PropertyData PC in share.Properties) + foreach (PropertyData pc in share.Properties) { - if (!string.IsNullOrEmpty(PC.Name) && PC.Value != null) + if (!string.IsNullOrEmpty(pc.Name) && pc.Value != null) { - if (PC.Name.Equals("DriverVersion")) version = PC.Value.ToString(); - if (PC.Name.Equals("Name")) gpu = PC.Value.ToString(); + if (pc.Name.Equals("DriverVersion")) version = pc.Value.ToString(); + if (pc.Name.Equals("Name")) gpu = pc.Value.ToString(); } } diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs index 52877f61f..f8974a0c4 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs @@ -86,7 +86,7 @@ namespace HandBrakeWPF.ViewModels this.errorService = errorService;
this.windowManager = windowManager;
this.Title = "Add Preset";
- this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName};
+ this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName };
this.PictureSettingsModes = EnumHelper<PresetPictureSettingsMode>.GetEnumList();
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs index da65e2945..fcd1f22d9 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs @@ -12,9 +12,7 @@ namespace HandBrakeWPF.ViewModels using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
- using System.ComponentModel.DataAnnotations;
using System.IO;
- using System.Text;
using System.Linq;
using System.Windows;
using System.Windows.Forms;
@@ -32,7 +30,6 @@ namespace HandBrakeWPF.ViewModels using ChapterMarker = HandBrakeWPF.Services.Encode.Model.Models.ChapterMarker;
using EncodeTask = HandBrakeWPF.Services.Encode.Model.EncodeTask;
using GeneralApplicationException = HandBrakeWPF.Exceptions.GeneralApplicationException;
- using MessageBox = System.Windows.Forms.MessageBox;
/// <summary>
/// The Chapters View Model
@@ -73,6 +70,7 @@ namespace HandBrakeWPF.ViewModels #endregion
#region Public Properties
+
/// <summary>
/// Gets or sets Task.
/// </summary>
@@ -209,9 +207,11 @@ namespace HandBrakeWPF.ViewModels if (!this.ValidateImportedChapters(importedChapters, out validationErrorMessage))
{
if (!string.IsNullOrEmpty(validationErrorMessage))
+ {
throw new GeneralApplicationException(
Resources.ChaptersViewModel_ValidationFailedWarning,
validationErrorMessage);
+ }
// The user has cancelled the import, so exit
return;
@@ -235,55 +235,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// Validates any imported chapter information against the currently detected chapter information in the
- /// source media. If validation fails then an error message is returned via the out parameter <see cref="validationErrorMessage"/>
- /// </summary>
- /// <param name="importedChapters">The list of imported chapter information</param>
- /// <param name="validationErrorMessage">In case of a validation error this variable will hold
- /// a detailed message that can be presented to the user</param>
- /// <returns>True if there are no errors with imported chapters, false otherwise</returns>
- private bool ValidateImportedChapters(Dictionary<int, Tuple<string, TimeSpan>> importedChapters, out string validationErrorMessage)
- {
- validationErrorMessage = null;
-
- // If the number of chapters don't match, prompt for confirmation
- if (importedChapters.Count != this.Task.ChapterNames.Count)
- {
- if (MessageBoxResult.Yes !=
- this.errorService.ShowMessageBox(
- string.Format(Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchMsg, this.Task.ChapterNames.Count, importedChapters.Count),
- Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchWarning,
- MessageBoxButton.YesNo,
- MessageBoxImage.Question))
- {
- return false;
- }
- }
-
- // If the average discrepancy in timings between chapters is either:
- // a) more than 15 sec for more than 2 chapters
- // (I chose 15sec based on empirical evidence from testing a few DVDs and comparing to chapter-marker files I downloaded)
- // => This check will not be performed for the first and last chapter as they're very likely to differ significantly due to language and region
- // differences (e.g. longer title sequences and different distributor credits)
- var diffs = importedChapters.Zip(this.Task.ChapterNames, (import, source) => source.Duration - import.Value.Item2);
- if (diffs.Count(diff => Math.Abs(diff.TotalSeconds) > 15) > 2)
- {
- if (MessageBoxResult.Yes !=
- this.errorService.ShowMessageBox(
- Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchMsg,
- Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchWarning,
- MessageBoxButton.YesNo,
- MessageBoxImage.Question))
- {
- return false;
- }
- }
-
- // All is well, we should import chapters
- return true;
- }
-
- /// <summary>
/// Setup this window for a new source
/// </summary>
/// <param name="source">
@@ -379,5 +330,58 @@ namespace HandBrakeWPF.ViewModels }
#endregion
+
+ #region Private Methods
+
+ /// <summary>
+ /// Validates any imported chapter information against the currently detected chapter information in the
+ /// source media. If validation fails then an error message is returned via the out parameter <see cref="validationErrorMessage"/>
+ /// </summary>
+ /// <param name="importedChapters">The list of imported chapter information</param>
+ /// <param name="validationErrorMessage">In case of a validation error this variable will hold
+ /// a detailed message that can be presented to the user</param>
+ /// <returns>True if there are no errors with imported chapters, false otherwise</returns>
+ private bool ValidateImportedChapters(Dictionary<int, Tuple<string, TimeSpan>> importedChapters, out string validationErrorMessage)
+ {
+ validationErrorMessage = null;
+
+ // If the number of chapters don't match, prompt for confirmation
+ if (importedChapters.Count != this.Task.ChapterNames.Count)
+ {
+ if (this.errorService.ShowMessageBox(
+ string.Format(Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchMsg, this.Task.ChapterNames.Count, importedChapters.Count),
+ Resources.ChaptersViewModel_ValidateImportedChapters_ChapterCountMismatchWarning,
+ MessageBoxButton.YesNo,
+ MessageBoxImage.Question) !=
+ MessageBoxResult.Yes)
+ {
+ return false;
+ }
+ }
+
+ // If the average discrepancy in timings between chapters is either:
+ // a) more than 15 sec for more than 2 chapters
+ // (I chose 15sec based on empirical evidence from testing a few DVDs and comparing to chapter-marker files I downloaded)
+ // => This check will not be performed for the first and last chapter as they're very likely to differ significantly due to language and region
+ // differences (e.g. longer title sequences and different distributor credits)
+ var diffs = importedChapters.Zip(this.Task.ChapterNames, (import, source) => source.Duration - import.Value.Item2);
+ if (diffs.Count(diff => Math.Abs(diff.TotalSeconds) > 15) > 2)
+ {
+ if (this.errorService.ShowMessageBox(
+ Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchMsg,
+ Resources.ChaptersViewModel_ValidateImportedChapters_ChapterDurationMismatchWarning,
+ MessageBoxButton.YesNo,
+ MessageBoxImage.Question) !=
+ MessageBoxResult.Yes)
+ {
+ return false;
+ }
+ }
+
+ // All is well, we should import chapters
+ return true;
+ }
+
+ #endregion
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 5b671c23d..db7c608ff 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1857,7 +1857,7 @@ namespace HandBrakeWPF.ViewModels Resources.DirectoryUtils_CreateFolder,
MessageBoxButton.YesNo,
MessageBoxImage.Question);
- if (MessageBoxResult.Yes == result)
+ if (result == MessageBoxResult.Yes)
{
Directory.CreateDirectory(directory);
Process.Start(directory);
@@ -2437,7 +2437,7 @@ namespace HandBrakeWPF.ViewModels /// <param name="e">
/// The e.
/// </param>
- void QueueProcessorJobProcessingStarted(object sender, QueueProgressEventArgs e)
+ private void QueueProcessorJobProcessingStarted(object sender, QueueProgressEventArgs e)
{
Execute.OnUIThread(
() =>
@@ -2547,7 +2547,6 @@ namespace HandBrakeWPF.ViewModels this.QueueViewModel.WhenDone(this.userSettingService.GetUserSetting<string>(UserSettingConstants.WhenCompleteAction), false);
break;
}
-
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs index 7f0fed5b6..42b9f4bab 100644 --- a/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/ManagePresetViewModel.cs @@ -48,7 +48,7 @@ namespace HandBrakeWPF.ViewModels this.errorService = errorService; this.windowManager = windowManager; this.Title = "Manage Preset"; - this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName}; + this.Preset = new Preset { IsBuildIn = false, IsDefault = false, Category = PresetService.UserPresetCatgoryName }; } /// <summary> diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index 7322e3060..17154f922 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -494,6 +494,7 @@ namespace HandBrakeWPF.ViewModels #endregion
#region Preview
+
/// <summary>
/// Gets or sets VLCPath.
/// </summary>
@@ -510,6 +511,7 @@ namespace HandBrakeWPF.ViewModels this.NotifyOfPropertyChange("VLCPath");
}
}
+
#endregion
#region System and Logging
@@ -1315,7 +1317,6 @@ namespace HandBrakeWPF.ViewModels // Use dvdnav
this.DisableLibdvdNav = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibDvdNav);
-
}
/// <summary>
@@ -1327,6 +1328,17 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
+ /// The goto tab.
+ /// </summary>
+ /// <param name="tab">
+ /// The tab.
+ /// </param>
+ public void GotoTab(OptionsTab tab)
+ {
+ this.SelectedTab = tab;
+ }
+
+ /// <summary>
/// Save the settings selected
/// </summary>
private void Save()
@@ -1452,17 +1464,6 @@ namespace HandBrakeWPF.ViewModels }
/// <summary>
- /// The goto tab.
- /// </summary>
- /// <param name="tab">
- /// The tab.
- /// </param>
- public void GotoTab(OptionsTab tab)
- {
- this.SelectedTab = tab;
- }
-
- /// <summary>
/// Validate the Autoname Fileformat string
/// </summary>
/// <param name="input">The format string</param>
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index a428144c0..a28fa889b 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -788,8 +788,9 @@ namespace HandBrakeWPF.ViewModels this.Task.Height = this.GetModulusValue(this.sourceResolution.Height - this.CropTop - this.CropBottom);
this.MaintainAspectRatio = preset.Task.KeepDisplayAspect;
}
- else // Custom
+ else
{
+ // Custom
// Set the Width, and Maintain Aspect ratio. That should calc the Height for us.
this.Task.Width = this.GetModulusValue(this.MaxWidth - this.CropLeft - this.CropRight);
@@ -1063,7 +1064,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// The changed picture field.
/// </summary>
- enum ChangedPictureField
+ public enum ChangedPictureField
{
Width,
Height,
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs index 97811dec9..c5351d729 100644 --- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs @@ -459,7 +459,6 @@ namespace HandBrakeWPF.ViewModels this.queueProcessor.QueueCompleted += this.queueProcessor_QueueCompleted;
this.queueProcessor.QueueChanged += this.QueueManager_QueueChanged;
this.queueProcessor.JobProcessingStarted += this.QueueProcessorJobProcessingStarted;
-
}
public void Deactivate()
diff --git a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs index fdc2886c7..55045cbca 100644 --- a/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/StaticPreviewViewModel.cs @@ -591,7 +591,7 @@ namespace HandBrakeWPF.ViewModels // Attempt to find VLC if it doesn't exist in the default set location.
string vlcPath;
- if (IntPtr.Size == 8 || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))
+ if (IntPtr.Size == 8 || (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432"))))
vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)");
else
vlcPath = Environment.GetEnvironmentVariable("ProgramFiles");
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index 826805636..d38883b44 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -198,7 +198,7 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// The add first for selected languages.
/// </summary>
- private void AddFirstForSelectedLanguages()
+ public void AddFirstForSelectedLanguages()
{
foreach (Subtitle sourceTrack in this.GetSelectedLanguagesTracks())
{
@@ -372,7 +372,8 @@ namespace HandBrakeWPF.ViewModels case SubtitleBurnInBehaviourModes.FirstTrack:
foreach (var track in this.Task.SubtitleTracks)
{
- if (track.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch) // Foreign Audio Search is always first in the list.
+ // Foreign Audio Search is always first in the list.
+ if (track.SourceTrack.SubtitleType == SubtitleType.ForeignAudioSearch)
{
track.Forced = true;
continue;
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index 32f0b8dbd..d3da0f1c0 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -337,7 +337,7 @@ namespace HandBrakeWPF.ViewModels case VideoEncoder.X265_10:
case VideoEncoder.X265_12:
double cqStep = userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step);
- double rfValue = 51.0 - value * cqStep;
+ double rfValue = 51.0 - (value * cqStep);
rfValue = Math.Round(rfValue, 2);
this.Task.Quality = rfValue;
break;
@@ -714,7 +714,7 @@ namespace HandBrakeWPF.ViewModels if (encoder != null)
{
string preset = value >= 0 ? encoder.Presets[value] : null;
- this.VideoPreset = preset != null ?new VideoPreset(preset, preset) : this.VideoPresets.FirstOrDefault();
+ this.VideoPreset = preset != null ? new VideoPreset(preset, preset) : this.VideoPresets.FirstOrDefault();
}
this.NotifyOfPropertyChange(() => this.VideoPresetValue);
@@ -1062,7 +1062,6 @@ namespace HandBrakeWPF.ViewModels }
}
-
/// <summary>
/// The get actualx 264 query.
/// </summary>
|