diff options
author | Scott <[email protected]> | 2015-12-27 21:57:05 +0000 |
---|---|---|
committer | Scott <[email protected]> | 2015-12-27 21:57:05 +0000 |
commit | e2a5481e83511c59a3322eadab2e71b9f0796cb7 (patch) | |
tree | 971464d9cb8039e65c88aaae3a3a8b41b42d3c80 /win/CS/HandBrakeWPF/Services | |
parent | 930039b3154fcbf919b77ca0448865467e352896 (diff) |
WinGui: Some API and warnings cleanup.
Diffstat (limited to 'win/CS/HandBrakeWPF/Services')
4 files changed, 21 insertions, 108 deletions
diff --git a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs index 5f022f6b5..03cea74f5 100644 --- a/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs +++ b/win/CS/HandBrakeWPF/Services/Encode/Model/EncodeTask.cs @@ -9,10 +9,8 @@ namespace HandBrakeWPF.Services.Encode.Model { - using System; using System.Collections.Generic; using System.Collections.ObjectModel; - using System.Linq; using HandBrake.ApplicationServices.Interop.Model; using HandBrake.ApplicationServices.Interop.Model.Encoding; @@ -20,7 +18,6 @@ namespace HandBrakeWPF.Services.Encode.Model using HandBrakeWPF.Utilities; using AllowedPassthru = HandBrakeWPF.Services.Encode.Model.Models.AllowedPassthru; - using AudioEncoder = HandBrakeWPF.Services.Encode.Model.Models.AudioEncoder; using AudioTrack = HandBrakeWPF.Services.Encode.Model.Models.AudioTrack; using ChapterMarker = HandBrakeWPF.Services.Encode.Model.Models.ChapterMarker; using DenoisePreset = HandBrakeWPF.Services.Encode.Model.Models.DenoisePreset; @@ -29,7 +26,6 @@ namespace HandBrakeWPF.Services.Encode.Model using OutputFormat = HandBrakeWPF.Services.Encode.Model.Models.OutputFormat; using PointToPointMode = HandBrakeWPF.Services.Encode.Model.Models.PointToPointMode; using SubtitleTrack = HandBrakeWPF.Services.Encode.Model.Models.SubtitleTrack; - using SubtitleType = HandBrakeWPF.Services.Encode.Model.Models.SubtitleType; using VideoLevel = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoLevel; using VideoPreset = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoPreset; using VideoProfile = HandBrakeWPF.Services.Encode.Model.Models.Video.VideoProfile; @@ -464,53 +460,6 @@ namespace HandBrakeWPF.Services.Encode.Model /// </summary> public string ExtraAdvancedArguments { get; set; } - #endregion - - #region Preview - - /// <summary> - /// Gets or sets a value indicating whether IsPreviewEncode. - /// </summary> - public bool IsPreviewEncode { get; set; } - - /// <summary> - /// Gets or sets PreviewEncodeDuration. - /// </summary> - public int? PreviewEncodeDuration { get; set; } - - /// <summary> - /// Gets or sets PreviewEncodeStartAt. - /// </summary> - public int? PreviewEncodeStartAt { get; set; } - - #endregion - - #region Helpers - - /// <summary> - /// Gets a value indicating whether M4v extension is required. - /// </summary> - public bool RequiresM4v - { - get - { - if (this.OutputFormat == OutputFormat.Mp4) - { - bool audio = - this.AudioTracks.Any( - item => - item.Encoder == AudioEncoder.Ac3Passthrough || item.Encoder == AudioEncoder.Ac3 - || item.Encoder == AudioEncoder.DtsPassthrough || item.Encoder == AudioEncoder.Passthrough); - - bool subtitles = this.SubtitleTracks.Any(track => track.SubtitleType != SubtitleType.VobSub); - - return audio || subtitles; - } - - return false; - } - } - /// <summary> /// Gets or sets a value indicating whether advanced panel enabled. /// </summary> @@ -530,34 +479,24 @@ namespace HandBrakeWPF.Services.Encode.Model } } + #endregion + + #region Preview + /// <summary> - /// Gets the picture settings desc. + /// Gets or sets a value indicating whether IsPreviewEncode. /// </summary> - public string PictureSettingsDesc - { - get - { - string resolution = string.Empty; - switch (this.Anamorphic) - { - case Anamorphic.Strict: - resolution = "Anamorphic: Strict"; - break; - case Anamorphic.Loose: - resolution = "Anamorphic: Loose, Width: " + this.Width; - break; - case Anamorphic.Custom: - resolution = "Anamorphic: Custom, Resolution: " + this.Width + "x" + this.Height; - break; - case Anamorphic.None: - resolution = "Resolution: " + this.Width + "x" + this.Height; - break; - } + public bool IsPreviewEncode { get; set; } - return resolution + Environment.NewLine + "Crop Top: " + this.Cropping.Top + ", Botton: " + this.Cropping.Bottom + ", Left: " - + this.Cropping.Left + ", Right: " + this.Cropping.Right; - } - } + /// <summary> + /// Gets or sets PreviewEncodeDuration. + /// </summary> + public int? PreviewEncodeDuration { get; set; } + + /// <summary> + /// Gets or sets PreviewEncodeStartAt. + /// </summary> + public int? PreviewEncodeStartAt { get; set; } #endregion } diff --git a/win/CS/HandBrakeWPF/Services/Interfaces/IUserSettingService.cs b/win/CS/HandBrakeWPF/Services/Interfaces/IUserSettingService.cs index c8b34b7cd..bcd0ab27d 100644 --- a/win/CS/HandBrakeWPF/Services/Interfaces/IUserSettingService.cs +++ b/win/CS/HandBrakeWPF/Services/Interfaces/IUserSettingService.cs @@ -56,16 +56,5 @@ namespace HandBrakeWPF.Services.Interfaces /// The user setting
/// </returns>
T GetUserSetting<T>(string name);
-
- /// <summary>
- /// Get an StringCollection type user setting
- /// </summary>
- /// <param name="name">
- /// The setting name
- /// </param>
- /// <returns>
- /// The settings value
- /// </returns>
- System.Collections.Specialized.StringCollection GetUserSettingStringCollection(string name);
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs b/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs index e148269ff..1e86d06ba 100644 --- a/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs +++ b/win/CS/HandBrakeWPF/Services/Queue/Interfaces/IQueueProcessor.cs @@ -44,7 +44,6 @@ namespace HandBrakeWPF.Services.Queue.Interfaces /// </summary>
event EventHandler QueuePaused;
-
/// <summary>
/// Low Diskspace has been detected.
/// Checked before each job starts.
@@ -61,7 +60,7 @@ namespace HandBrakeWPF.Services.Queue.Interfaces int Count { get; }
/// <summary>
- /// The number of errors detected in the queue.
+ /// Gets the number of errors detected in the queue.
/// </summary>
int ErrorCount { get; }
diff --git a/win/CS/HandBrakeWPF/Services/UserSettingService.cs b/win/CS/HandBrakeWPF/Services/UserSettingService.cs index 8f0093009..612999a3a 100644 --- a/win/CS/HandBrakeWPF/Services/UserSettingService.cs +++ b/win/CS/HandBrakeWPF/Services/UserSettingService.cs @@ -10,12 +10,12 @@ namespace HandBrakeWPF.Services
{
using System;
- using System.Collections.Specialized;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.Serialization;
+ using HandBrakeWPF.Properties;
using HandBrakeWPF.Services.Interfaces;
using GeneralApplicationException = HandBrakeWPF.Exceptions.GeneralApplicationException;
@@ -94,20 +94,6 @@ namespace HandBrakeWPF.Services }
/// <summary>
- /// Get an StringCollection type user setting
- /// </summary>
- /// <param name="name">
- /// The setting name
- /// </param>
- /// <returns>
- /// The settings value
- /// </returns>
- public StringCollection GetUserSettingStringCollection(string name)
- {
- return (StringCollection)this.userSettings[name];
- }
-
- /// <summary>
/// The on setting changed.
/// </summary>
/// <param name="e">
@@ -143,8 +129,8 @@ namespace HandBrakeWPF.Services catch (Exception exc)
{
throw new GeneralApplicationException(
- "A problem occured when trying to save your preferences.",
- "Any settings you changed may need to be reset the next time HandBrake launches.",
+ Resources.UserSettings_AnErrorOccured,
+ Resources.SettingService_SaveErrorReset,
exc);
}
}
@@ -189,11 +175,11 @@ namespace HandBrakeWPF.Services }
this.Save();
- throw new GeneralApplicationException("Warning, your settings have been reset!", "Your user settings file was corrupted or inaccessible. Settings have been reset to defaults.", exc);
+ throw new GeneralApplicationException(Resources.UserSettings_YourSettingsHaveBeenReset, Resources.UserSettings_YourSettingsAreCorrupt, exc);
}
catch (Exception)
{
- throw new GeneralApplicationException("Unable to load user settings file: " + this.settingsFile, "Your user settings file appears to be inaccessible or corrupted. You may have to delete the file and let HandBrake generate a new one.", exc);
+ throw new GeneralApplicationException(string.Format(Resources.UserSettings_UnableToLoad, this.settingsFile), Resources.UserSettings_UnableToLoadSolution, exc);
}
}
}
|