Commit 41264c86 authored by GitLab CI's avatar GitLab CI

Merge remote-tracking branch 'upstream/master' into master-build

* upstream/master:
  WinGui: Use hb_presets_read_file_json to read the UI presets file. This allows us to better handle version upgrades without resetting everything back to 0.
  WinGui: More Robust Queue Backup and Recovery.
  WinGui: Switch the GUI over to using JSON for the queue. (Note, this is not the same format as the CLI and thus cannot be imported. This may happen in the future) Please finish existing queue before installing new version.
parents ccfc138b 50f8adb4
Pipeline #60866249 passed with stages
in 65 minutes and 32 seconds
......@@ -121,6 +121,7 @@
<Compile Include="Interop\Model\Encoding\Detelecine.cs" />
<Compile Include="Interop\Model\Encoding\HBPresetTune.cs" />
<Compile Include="Interop\Model\Encoding\Sharpen.cs" />
<Compile Include="Interop\Model\PresetVersion.cs" />
<Compile Include="Interop\Model\Preview\RawPreviewData.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Interop\Json\Scan\SourceAudioTrack.cs" />
......
......@@ -17,6 +17,7 @@ namespace HandBrake.Interop.Interop
using HandBrake.Interop.Interop.HbLib;
using HandBrake.Interop.Interop.Helpers;
using HandBrake.Interop.Interop.Json.Presets;
using HandBrake.Interop.Interop.Model;
using Newtonsoft.Json;
......@@ -50,7 +51,7 @@ namespace HandBrake.Interop.Interop
/// <returns>
/// The <see cref="PresetCategory"/>.
/// </returns>
public static PresetTransportContainer GetPresetFromFile(string filename)
public static PresetTransportContainer GetPresetsFromFile(string filename)
{
IntPtr presetStringPointer = HBFunctions.hb_presets_read_file_json(InteropUtilities.ToUtf8PtrFromString(filename));
string presetJson = Marshal.PtrToStringAnsi(presetStringPointer);
......@@ -88,5 +89,24 @@ namespace HandBrake.Interop.Interop
writer.Write(preset);
}
}
public static PresetVersion GetCurrentPresetVersion()
{
IntPtr major = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
IntPtr minor = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
IntPtr micro = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
HBFunctions.hb_presets_current_version(major, minor, micro);
int majorVersion = Marshal.ReadInt32(major);
int minorVersion = Marshal.ReadInt32(minor);
int microVersion = Marshal.ReadInt32(micro);
Marshal.FreeHGlobal(major);
Marshal.FreeHGlobal(minor);
Marshal.FreeHGlobal(micro);
return new PresetVersion(majorVersion, minorVersion, microVersion);
}
}
}
......@@ -469,5 +469,8 @@ namespace HandBrake.Interop.Interop.HbLib
// char * hb_presets_read_file_json(const char *filename);
[DllImport("hb", EntryPoint = "hb_presets_read_file_json", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_presets_read_file_json(IntPtr filename);
[DllImport("hb", EntryPoint = "hb_presets_current_version", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr hb_presets_current_version(IntPtr major, IntPtr minor, IntPtr micro);
}
}
......@@ -37,7 +37,7 @@ namespace HandBrake.Interop.Interop.Json.Presets
/// <param name="versionMicro">
/// The version micro.
/// </param>
public PresetTransportContainer(string versionMajor, string versionMinor, string versionMicro)
public PresetTransportContainer(int versionMajor, int versionMinor, int versionMicro)
{
this.VersionMajor = versionMajor;
this.VersionMicro = versionMicro;
......@@ -52,16 +52,16 @@ namespace HandBrake.Interop.Interop.Json.Presets
/// <summary>
/// Gets or sets the version major.
/// </summary>
public string VersionMajor { get; set; }
public int VersionMajor { get; set; }
/// <summary>
/// Gets or sets the version micro.
/// </summary>
public string VersionMicro { get; set; }
public int VersionMicro { get; set; }
/// <summary>
/// Gets or sets the version minor.
/// </summary>
public string VersionMinor { get; set; }
public int VersionMinor { get; set; }
}
}
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="PresetVersion.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 the PresetVersion type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------
namespace HandBrake.Interop.Interop.Model
{
public class PresetVersion
{
public PresetVersion(int major, int minor, int micro)
{
this.Major = major;
this.Minor = minor;
this.Micro = micro;
}
public int Major { get; }
public int Minor { get; }
public int Micro { get; }
}
}
......@@ -9,11 +9,12 @@
namespace HandBrake.Interop.Model
{
/// <summary>
/// HandBrakes configuration options
/// </summary>
public class HBConfiguration
{
public HBConfiguration()
{
}
/// <summary>
/// Gets or sets a value indicating whether is dvd nav disabled.
/// </summary>
......
......@@ -37,11 +37,6 @@ namespace HandBrakeWPF
public const string SourcePath = "{source_path}";
public const string SourceFolderName = "{source_folder_name}";
/* Preset Versions */
public const string PresetVersionMajor = "35";
public const string PresetVersionMinor = "0";
public const string PresetVersionMicro = "0";
public const string FileScanMru = "FileScanMru";
public const string FileSaveMru = "FileSaveMru";
}
......
......@@ -223,7 +223,7 @@
<Compile Include="Services\Presets\Factories\JsonPresetFactory.cs" />
<Compile Include="Services\Presets\Interfaces\IPresetObject.cs" />
<Compile Include="Services\Presets\Model\PresetDisplayCategory.cs" />
<Compile Include="Services\Queue\Interfaces\IQueueProcessor.cs" />
<Compile Include="Services\Queue\Interfaces\IQueueService.cs" />
<Compile Include="Helpers\FileHelper.cs" />
<Compile Include="Services\Presets\Model\Preset.cs" />
<Compile Include="Model\ScanMode.cs" />
......@@ -233,7 +233,7 @@
<Compile Include="Services\Presets\PresetService.cs" />
<Compile Include="Services\Queue\Model\QueueStats.cs" />
<Compile Include="Services\Queue\Model\QueueTaskContainer.cs" />
<Compile Include="Services\Queue\QueueProcessor.cs" />
<Compile Include="Services\Queue\QueueService.cs" />
<Compile Include="Services\Queue\Model\QueueItemStatus.cs" />
<Compile Include="Services\Queue\Model\QueueTask.cs" />
<Compile Include="Services\Scan\EventArgs\ScanCompletedEventArgs.cs" />
......
......@@ -16,7 +16,6 @@ namespace HandBrakeWPF.Helpers
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;
using System.Xml.Serialization;
using HandBrake.Interop.Utilities;
......@@ -24,13 +23,14 @@ namespace HandBrakeWPF.Helpers
using HandBrakeWPF.Services.Queue.Model;
using HandBrakeWPF.Utilities;
using IQueueProcessor = HandBrakeWPF.Services.Queue.Interfaces.IQueueProcessor;
using Newtonsoft.Json;
using IQueueService = HandBrakeWPF.Services.Queue.Interfaces.IQueueService;
/// <summary>
/// Queue Recovery Helper
/// </summary>
public class QueueRecoveryHelper
{
public static string QueueFileName = "hb_queue";
/// <summary>
/// Check if the queue recovery file contains records.
/// If it does, it means the last queue did not complete before HandBrake closed.
......@@ -46,9 +46,13 @@ namespace HandBrakeWPF.Helpers
{
try
{
// Check for any Corrupted Backup Files and try recover them
RecoverFromBackupFailure();
// Now check for all available recovery files. (There may be more than 1 for multi-instance support)
string tempPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
DirectoryInfo info = new DirectoryInfo(tempPath);
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.xml").Where(f => f.Name.StartsWith("hb_queue_recovery"));
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.json").Where(f => f.Name.StartsWith(QueueFileName));
var queueFiles = GetFilesExcludingActiveProcesses(foundFiles, filterQueueFiles);
if (!queueFiles.Any())
......@@ -59,14 +63,14 @@ namespace HandBrakeWPF.Helpers
List<string> removeFiles = new List<string>();
List<string> acceptedFiles = new List<string>();
XmlSerializer ser = new XmlSerializer(typeof(List<QueueTask>));
foreach (string file in queueFiles)
{
try
{
using (FileStream strm = new FileStream(file, FileMode.Open, FileAccess.Read))
using (StreamReader stream = new StreamReader(file))
{
List<QueueTask> list = ser.Deserialize(strm) as List<QueueTask>;
List<QueueTask> list = list = JsonConvert.DeserializeObject<List<QueueTask>>(stream.ReadToEnd());
if (list != null && list.Count == 0)
{
removeFiles.Add(file);
......@@ -115,10 +119,13 @@ namespace HandBrakeWPF.Helpers
/// <param name="silentRecovery">
/// The silent Recovery.
/// </param>
/// <param name="queueFilter">
/// The queue Filter.
/// </param>
/// <returns>
/// The <see cref="bool"/>.
/// </returns>
public static bool RecoverQueue(IQueueProcessor encodeQueue, IErrorService errorService, bool silentRecovery, List<string> queueFilter)
public static bool RecoverQueue(IQueueService encodeQueue, IErrorService errorService, bool silentRecovery, List<string> queueFilter)
{
string appDataPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
List<string> queueFiles = CheckQueueRecovery(queueFilter);
......@@ -129,8 +136,8 @@ namespace HandBrakeWPF.Helpers
{
result =
errorService.ShowMessageBox(
"HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?",
"Queue Recovery Possible",
Properties.Resources.Queue_RecoverQueueQuestionSingular,
Properties.Resources.Queue_RecoveryPossible,
MessageBoxButton.YesNo,
MessageBoxImage.Question);
}
......@@ -138,8 +145,8 @@ namespace HandBrakeWPF.Helpers
{
result =
errorService.ShowMessageBox(
"HandBrake has detected multiple unfinished queue files. These will be from multiple instances of HandBrake running. Would you like to recover all unfinished jobs?",
"Queue Recovery Possible",
Properties.Resources.Queue_RecoverQueueQuestionPlural,
Properties.Resources.Queue_RecoveryPossible,
MessageBoxButton.YesNo,
MessageBoxImage.Question);
}
......@@ -173,11 +180,29 @@ namespace HandBrakeWPF.Helpers
{
string appDataPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
DirectoryInfo info = new DirectoryInfo(appDataPath);
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.archive").Where(f => f.Name.StartsWith("hb_queue_recovery"));
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.archive").Where(f => f.Name.StartsWith(QueueFileName));
return foundFiles.Any();
}
private static void RecoverFromBackupFailure()
{
string appDataPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
DirectoryInfo info = new DirectoryInfo(appDataPath);
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.last");
foreach (FileInfo file in foundFiles)
{
string corruptedFile = file.FullName.Replace(".last", string.Empty);
if (File.Exists(corruptedFile))
{
File.Delete(corruptedFile);
}
File.Move(file.FullName, corruptedFile);
}
}
private static List<string> GetFilesExcludingActiveProcesses(IEnumerable<FileInfo> foundFiles, List<string> filterQueueFiles)
{
List<string> queueFiles = new List<string>();
......@@ -185,7 +210,7 @@ namespace HandBrakeWPF.Helpers
// Remove any files where we have an active instnace.
foreach (FileInfo file in foundFiles)
{
string fileProcessId = file.Name.Replace("hb_queue_recovery", string.Empty).Replace(".xml", string.Empty);
string fileProcessId = file.Name.Replace(QueueFileName, string.Empty).Replace(".json", string.Empty);
int processId;
if (!string.IsNullOrEmpty(fileProcessId) && int.TryParse(fileProcessId, out processId))
{
......@@ -216,7 +241,7 @@ namespace HandBrakeWPF.Helpers
// Cleanup old/unused queue files for now.
foreach (string file in removeFiles)
{
Match m = Regex.Match(file, @"([0-9]+).xml");
Match m = Regex.Match(file, @"([0-9]+).json");
if (m.Success)
{
int processId = int.Parse(m.Groups[1].ToString());
......@@ -249,13 +274,13 @@ namespace HandBrakeWPF.Helpers
{
string appDataPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
DirectoryInfo info = new DirectoryInfo(appDataPath);
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.archive").Where(f => f.Name.StartsWith("hb_queue_recovery"));
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.archive").Where(f => f.Name.StartsWith(QueueFileName));
DateTime LastWeek = DateTime.Now.AddDays(-7);
DateTime lastWeek = DateTime.Now.AddDays(-7);
foreach (FileInfo file in foundFiles)
{
if (file.CreationTime < LastWeek)
if (file.CreationTime < lastWeek)
{
string fullPath = Path.Combine(appDataPath, file.Name);
File.Delete(fullPath);
......@@ -267,7 +292,7 @@ namespace HandBrakeWPF.Helpers
{
string appDataPath = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
DirectoryInfo info = new DirectoryInfo(appDataPath);
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.archive").Where(f => f.Name.StartsWith("hb_queue_recovery"));
IEnumerable<FileInfo> foundFiles = info.GetFiles("*.archive").Where(f => f.Name.StartsWith(QueueFileName));
foreach (FileInfo file in foundFiles)
{
string fullPath = Path.Combine(appDataPath, file.Name);
......
......@@ -3737,17 +3737,6 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to HandBrake has detected your presets file is from an older version.
///It will try and load the file anyway.
///If it fails, it will archive off the old file and create a new one..
/// </summary>
public static string PresetService_PresetsOutOfDate {
get {
return ResourceManager.GetString("PresetService_PresetsOutOfDate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to load presets..
/// </summary>
......@@ -3813,6 +3802,33 @@ namespace HandBrakeWPF.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to HandBrake has detected multiple unfinished queue files. These will be from multiple instances of HandBrake running. Would you like to recover all unfinished jobs?.
/// </summary>
public static string Queue_RecoverQueueQuestionPlural {
get {
return ResourceManager.GetString("Queue_RecoverQueueQuestionPlural", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?.
/// </summary>
public static string Queue_RecoverQueueQuestionSingular {
get {
return ResourceManager.GetString("Queue_RecoverQueueQuestionSingular", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Queue Recovery Possible.
/// </summary>
public static string Queue_RecoveryPossible {
get {
return ResourceManager.GetString("Queue_RecoveryPossible", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Unable to reset job status as it is not in an Error or Completed state.
/// </summary>
......
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
......@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
......@@ -559,11 +559,6 @@ Bitte stellen Sie sicher, dass VLC installiert und der Pfad in den HandBrake-Ein
<data name="PresetService_ArchiveFile" xml:space="preserve">
<value>Archivierte Datei:</value>
</data>
<data name="PresetService_PresetsOutOfDate" xml:space="preserve">
<value>HandBrake hat festgestellt, dass die Voreinstellungsdatei von einer älteren Version stammt.
Es wird versucht die Datei trotzdem zu laden.
Schlägt dies fehl, wird die Datei archiviert und eine neue erstellt.</value>
</data>
<data name="PresetService_UnableToLoad" xml:space="preserve">
<value>Laden der Voreinstellung fehlgeschlagen.</value>
</data>
......@@ -1964,4 +1959,4 @@ Nicht-Echtzeit Optionen: {date} {time} {creation-date} {creation-time} {quality}
<data name="CollisionBehaviour_AppendNumber" xml:space="preserve">
<value>Zahl anhängen</value>
</data>
</root>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
......@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
......@@ -573,11 +573,6 @@ Assurez-vous que VLC est installé et que le répertoire spécifié dans les opt
<data name="PresetService_ArchiveFile" xml:space="preserve">
<value>Fichier archivé:</value>
</data>
<data name="PresetService_PresetsOutOfDate" xml:space="preserve">
<value>HandBrake a détecté que votre fichier de préréglages provient d'une version antérieure.
Il va quand même essayer de charger le fichier.
Si cela échoue, il archivera l'ancien fichier et en créera un nouveau.</value>
</data>
<data name="PresetService_UnableToLoad" xml:space="preserve">
<value>Impossible de charger les préréglages.</value>
</data>
......@@ -1978,4 +1973,4 @@ Non-Live Options: {date} {time} {creation-date} {creation-time} {quality} {bitra
<data name="CollisionBehaviour_AppendNumber" xml:space="preserve">
<value>Append Number</value>
</data>
</root>
</root>
\ No newline at end of file
......@@ -573,11 +573,6 @@ Please make sure VLC is installed and the directory specified in HandBrake's opt
<data name="PresetService_ArchiveFile" xml:space="preserve">
<value>Archived File:</value>
</data>
<data name="PresetService_PresetsOutOfDate" xml:space="preserve">
<value>HandBrake has detected your presets file is from an older version.
It will try and load the file anyway.
If it fails, it will archive off the old file and create a new one.</value>
</data>
<data name="PresetService_UnableToLoad" xml:space="preserve">
<value>Unable to load presets.</value>
</data>
......@@ -1987,4 +1982,13 @@ Non-Live Options: {date} {time} {creation-date} {creation-time} {quality} {bitra
<data name="OptionsView_ChoiceOfEncoderHint" xml:space="preserve">
<value>Choice of encoder will be made available on the 'Video' tab.</value>
</data>
<data name="Queue_RecoverQueueQuestionPlural" xml:space="preserve">
<value>HandBrake has detected multiple unfinished queue files. These will be from multiple instances of HandBrake running. Would you like to recover all unfinished jobs?</value>
</data>
<data name="Queue_RecoverQueueQuestionSingular" xml:space="preserve">
<value>HandBrake has detected unfinished items on the queue from the last time the application was launched. Would you like to recover these?</value>
</data>
<data name="Queue_RecoveryPossible" xml:space="preserve">
<value>Queue Recovery Possible</value>
</data>
</root>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
......@@ -60,45 +60,45 @@
: and then encoded with base64 encoding.
-->
<xsd:schema xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" id="root">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"/>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string"/>
<xsd:attribute name="type" type="xsd:string"/>
<xsd:attribute name="mimetype" type="xsd:string"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string"/>
<xsd:attribute name="name" type="xsd:string"/>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1"/>
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3"/>
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4"/>
<xsd:attribute ref="xml:space"/>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1"/>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required"/>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
......@@ -566,11 +566,6 @@ Foreign Audio Preferred, else First - 如果存在外语轨道,则会将其烧
<data name="PresetService_ArchiveFile" xml:space="preserve">
<value>存档的文件:</value>
</data>
<data name="PresetService_PresetsOutOfDate" xml:space="preserve">
<value>HandBrake 检测到预设文件来自旧版本。
它将尝试加载文件。
如果失败,它将存档旧文件并创建新文件。</value>
</data>
<data name="PresetService_UnableToLoad" xml:space="preserve">
<value>无法加载预设。</value>
</data>
......@@ -1966,4 +1961,4 @@ Non-Live Options: {date} {time} {creation-date} {creation-time} {quality} {bitra
<data name="CollisionBehaviour_AppendNumber" xml:space="preserve">
<value>Append Number</value>
</data>
</root>
</root>
\ No newline at end of file
......@@ -18,6 +18,8 @@ namespace HandBrakeWPF.Services.Encode.Model
using HandBrakeWPF.Model.Filters;
using HandBrakeWPF.Services.Encode.Model.Models;
using Newtonsoft.Json;
using AllowedPassthru = Models.AllowedPassthru;
using AudioTrack = Models.AudioTrack;
using ChapterMarker = Models.ChapterMarker;
......
......@@ -27,9 +27,7 @@ namespace HandBrakeWPF.Services.Encode.Model.Models
using Newtonsoft.Json;
/// <summary>
/// Model of a HandBrake Audio Track and it's associated behaviours.
/// </summary>
[JsonObject(MemberSerialization.OptOut)]
public class AudioTrack : PropertyChangedBase
{
private int bitrate;
......
......@@ -13,9 +13,9 @@ namespace HandBrakeWPF.Services.Encode.Model.Models