this.SubtitleTracks = new ObservableCollection<SubtitleTrack>();\r
this.ChapterNames = new ObservableCollection<ChapterMarker>();\r
this.AllowedPassthruOptions = new AllowedPassthru();\r
- this.x264Preset = x264Preset.None;\r
- this.x264Profile = x264Profile.None;\r
+ this.X264Preset = x264Preset.Medium;\r
+ this.H264Profile = x264Profile.None;\r
this.X264Tune = x264Tune.None;\r
this.Modulus = 16;\r
}\r
this.AudioTracks.Add(new AudioTrack(track));\r
}\r
\r
-\r
this.ChapterNames = new ObservableCollection<ChapterMarker>();\r
foreach (ChapterMarker track in task.ChapterNames)\r
{\r
this.VideoEncoder = task.VideoEncoder;\r
this.VideoEncodeRateType = task.VideoEncodeRateType;\r
this.Width = task.Width;\r
- this.x264Preset = task.x264Preset;\r
- this.x264Profile = task.x264Profile;\r
+ this.X264Preset = task.X264Preset;\r
+ this.H264Profile = task.H264Profile;\r
this.X264Tune = task.X264Tune;\r
+ this.FastDecode = task.FastDecode;\r
\r
this.PreviewStartAt = task.PreviewStartAt;\r
this.PreviewDuration = task.PreviewDuration;\r
/// <summary>\r
/// Gets or sets x264Preset.\r
/// </summary>\r
- public x264Preset x264Preset { get; set; }\r
+ public x264Preset X264Preset { get; set; }\r
\r
/// <summary>\r
/// Gets or sets x264Profile.\r
/// </summary>\r
- public x264Profile x264Profile { get; set; }\r
+ public x264Profile H264Profile { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the x 264 level.\r
+ /// </summary>\r
+ public string H264Level { get; set; }\r
\r
/// <summary>\r
/// Gets or sets X264Tune.\r
/// </summary>\r
public x264Tune X264Tune { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether fast decode.\r
+ /// </summary>\r
+ public bool FastDecode { get; set; }\r
+\r
#endregion\r
\r
#region Preview\r
: base(userSettingService)\r
{\r
this.userSettingService = userSettingService;\r
- this.EncodeStarted += this.EncodeEncodeStarted;\r
- \r
+ this.EncodeStarted += this.EncodeEncodeStarted; \r
}\r
\r
#region Properties\r
return x264Tune.Ssim;\r
case "fastdecode":\r
return x264Tune.Fastdecode;\r
- case "zerolatency":\r
- return x264Tune.Zerolatency;\r
default:\r
return x264Tune.Film;\r
}\r
/// </returns>\r
public static string GenerateQuery(EncodeTask task, int previewScanCount, int verbosity, bool disableLibDvdNav)\r
{\r
+ if (string.IsNullOrEmpty(task.Source))\r
+ {\r
+ return "No source selected";\r
+ }\r
+\r
string query = string.Empty;\r
query += SourceQuery(task, null, null, previewScanCount);\r
query += DestinationQuery(task);\r
{\r
string query = string.Empty; \r
\r
- if (task.x264Preset != x264Preset.None)\r
+ if (task.X264Preset != x264Preset.Medium)\r
{\r
- query += string.Format("--x264-preset={0} ", task.x264Preset.ToString().ToLower().Replace(" ", string.Empty));\r
+ query += string.Format(" --x264-preset={0} ", task.X264Preset.ToString().ToLower().Replace(" ", string.Empty));\r
}\r
\r
- if (task.x264Profile != x264Profile.None)\r
+ if (task.H264Profile != x264Profile.None)\r
{\r
- query += string.Format("--x264-profile={0} ", task.x264Profile.ToString().ToLower().Replace(" ", string.Empty));\r
+ query += string.Format(" --x264-profile={0} ", task.H264Profile.ToString().ToLower().Replace(" ", string.Empty));\r
}\r
\r
if (task.X264Tune != x264Tune.None)\r
{\r
- query += string.Format("--x264-tune={0} ", task.X264Tune.ToString().ToLower().Replace(" ", string.Empty));\r
+ string tune = string.Empty;\r
+\r
+ if (task.FastDecode)\r
+ {\r
+ tune = "fastdecode";\r
+ }\r
+\r
+ string tuneDropdown = task.X264Tune.ToString().ToLower().Replace(" ", string.Empty);\r
+ if (task.X264Tune != x264Tune.None && !string.IsNullOrEmpty(tuneDropdown))\r
+ {\r
+ tune = string.IsNullOrEmpty(tune) ? tuneDropdown : string.Format(",{0}", tuneDropdown); \r
+ }\r
+\r
+ query += string.Format(" --x264-tune=\"{0}\" ", tune);\r
+ }\r
+\r
+ if (task.H264Level != "Auto")\r
+ {\r
+ query += string.Format(" --h264-level=\"{0}\" ", task.H264Level);\r
}\r
\r
if (!string.IsNullOrEmpty(task.AdvancedEncoderOptions))\r
Match turboFirstPass = Regex.Match(input, @" -T");\r
Match optimizeMP4 = Regex.Match(input, @" -O");\r
Match pfr = Regex.Match(input, @" --pfr");\r
- Match vfr = Regex.Match(input, @" --vfr");\r
Match cfr = Regex.Match(input, @" --cfr");\r
\r
// Audio Settings Tab\r
- Match noAudio = Regex.Match(input, @"-a none");\r
- Match audioTracks = Regex.Match(input, @"-a ([0-9,]+)");\r
Match audioTrackMixes = Regex.Match(input, @"-6 ([0-9a-zA-Z,]+)");\r
Match audioEncoders = Regex.Match(input, @"-E ([a-zA-Z0-9+,:\*]+)");\r
Match audioBitrates = Regex.Match(input, @"-B ([0-9a-zA-Z,]+)"); // Auto = a-z\r
\r
// Advanced Tab\r
Match advanced = Regex.Match(input, @"-x ([.,/a-zA-Z0-9=:-]*)");\r
- Match x264Preset = Regex.Match(input, @"--x264-preset([=a-zA-Z0-9\s]*)");\r
- Match x264Tune = Regex.Match(input, @"--x264-tune([=a-zA-Z0-9\s]*)");\r
- Match x264Profile = Regex.Match(input, @"--x264-profile([=a-zA-Z0-9\s]*)");\r
+ Match x264Preset = Regex.Match(input, @"--x264-preset([=a-zA-Z0-9\s ]*)");\r
+ Match x264Tune = Regex.Match(input, @"--x264-tune([=,a-zA-Z0-9\s ]*)");\r
+ Match h264Profile = Regex.Match(input, @"--h264-profile([=a-zA-Z0-9\s ]*)");\r
+ Match x264Profile = Regex.Match(input, @"--x264-profile([=a-zA-Z0-9\s ]*)");\r
+ Match h264Level = Regex.Match(input, @"--h264-level([=a-zA-Z0-9.\s ]*)");\r
\r
#endregion\r
\r
parsed.CustomDecomb = value;\r
parsed.Decomb = parsed.CustomDecomb == "7:2:6:9:1:80" ? Decomb.Fast : Decomb.Custom;\r
}\r
-\r
}\r
}\r
\r
}\r
\r
// Get the data from the regular expression results\r
- string[] trackData = null;\r
string[] trackMixes = null;\r
string[] trackEncoders = null;\r
string[] trackBitrates = null;\r
string[] trackDRCvalues = null;\r
string[] trackGainValues = null;\r
\r
- if (audioTracks.Success)\r
- trackData = audioTracks.ToString().Replace("-a ", string.Empty).Split(',');\r
if (audioTrackMixes.Success)\r
trackMixes = audioTrackMixes.ToString().Replace("-6 ", string.Empty).Split(',');\r
if (audioEncoders.Success)\r
for (int x = 0; x < encoderCount; x++)\r
{\r
AudioTrack track = new AudioTrack();\r
- //if (trackData != null)\r
- // if (trackData.Length >= (x + 1)) // Audio Track\r
- // track.ScannedTrack = trackData[x].Trim();\r
\r
if (trackMixes != null)\r
if (trackMixes.Length >= (x + 1)) // Audio Mix\r
parsed.AdvancedEncoderOptions = advanced.ToString().Replace("-x ", string.Empty);\r
\r
if (x264Preset.Success)\r
- parsed.x264Preset =\r
+ parsed.X264Preset =\r
Converters.Getx264PresetFromCli(x264Preset.ToString().Replace("--x264-preset", string.Empty).Replace("=", string.Empty).Trim());\r
\r
+ if (h264Profile.Success)\r
+ parsed.H264Profile =\r
+ Converters.Getx264ProfileFromCli(h264Profile.ToString().Replace("--h264-profile", string.Empty).Replace("=", string.Empty).Trim());\r
+\r
if (x264Profile.Success)\r
- parsed.x264Profile =\r
- Converters.Getx264ProfileFromCli(x264Profile.ToString().Replace("--x264-profile", string.Empty).Replace("=", string.Empty).Trim());\r
+ parsed.H264Profile =\r
+ Converters.Getx264ProfileFromCli(x264Profile.ToString().Replace("--x264-profile", string.Empty).Replace("=", string.Empty).Trim());\r
+\r
+ if (h264Level.Success)\r
+ parsed.H264Level =\r
+ h264Level.ToString().Replace("--h264-level", string.Empty).Replace("=", string.Empty).Trim();\r
\r
if (x264Tune.Success)\r
- parsed.X264Tune =\r
- Converters.Getx264TuneFromCli(x264Tune.ToString().Replace("--x264-tune", string.Empty).Replace("=", string.Empty).Trim());\r
+ {\r
+ string tuneOptions =\r
+ x264Tune.ToString().Replace("--x264-tune", string.Empty).Replace("=", string.Empty).Trim();\r
\r
+ parsed.FastDecode = tuneOptions.Contains("fastdecode");\r
+\r
+ // Remove these options. They are not in the dropdown.\r
+ tuneOptions = tuneOptions.Replace("fastdecode", string.Empty).Replace(\r
+ ",", string.Empty);\r
+\r
+ parsed.X264Tune = Converters.Getx264TuneFromCli(tuneOptions);\r
+ }\r
+ \r
#endregion\r
}\r
catch (Exception exc)\r
/// </summary>\r
public enum x264Preset\r
{\r
- [Display(Name = "None")]\r
- None = 0,\r
-\r
[Display(Name = "Ultrafast")]\r
Ultrafast,\r
\r
/// </summary>\r
public enum x264Profile\r
{\r
- [Display(Name = "None")]\r
+ [Display(Name = "Auto")]\r
None = 0,\r
\r
[Display(Name = "Baseline")]\r
\r
[Display(Name = "Fast Decode")]\r
Fastdecode,\r
-\r
- [Display(Name = "Zero Latency")]\r
- Zerolatency,\r
}\r
}\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="AdvancedEncoderOptionsCommand.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// A Command for resetting the video / advnaced tabs encoder options.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Commands\r
+{\r
+ using Caliburn.Micro;\r
+\r
+ using HandBrakeWPF.Commands.Interfaces;\r
+ using HandBrakeWPF.ViewModels.Interfaces;\r
+\r
+ /// <summary>\r
+ /// A Command for resetting the video / advnaced tabs encoder options.\r
+ /// </summary>\r
+ public class AdvancedEncoderOptionsCommand : IAdvancedEncoderOptionsCommand\r
+ {\r
+ /// <summary>\r
+ /// Clear out the advanced options\r
+ /// </summary>\r
+ public void ExecuteClearAdvanced()\r
+ {\r
+ IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();\r
+ advancedViewModel.Clear();\r
+ }\r
+\r
+ /// <summary>\r
+ /// Clear the advanced encoder options out on the video tab.\r
+ /// </summary>\r
+ public void ExecuteClearVideo()\r
+ {\r
+ IVideoViewModel videoViewModel = IoC.Get<IVideoViewModel>();\r
+ videoViewModel.ClearAdvancedSettings();\r
+ }\r
+ }\r
+}\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------\r
+// <copyright file="IAdvancedEncoderOptionsCommand.cs" company="HandBrake Project (http://handbrake.fr)">\r
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
+// </copyright>\r
+// <summary>\r
+// The AdvancedEncoderOptionsCommand interface.\r
+// </summary>\r
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrakeWPF.Commands.Interfaces\r
+{\r
+ /// <summary>\r
+ /// The AdvancedEncoderOptionsCommand interface.\r
+ /// </summary>\r
+ public interface IAdvancedEncoderOptionsCommand\r
+ {\r
+ /// <summary>\r
+ /// Clear out the advanced options\r
+ /// </summary>\r
+ void ExecuteClearAdvanced();\r
+\r
+ /// <summary>\r
+ /// Clear the advanced encoder options out on the video tab.\r
+ /// </summary>\r
+ void ExecuteClearVideo();\r
+ }\r
+}
\ No newline at end of file
</ApplicationDefinition>\r
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />\r
<Compile Include="Commands\CancelScanCommand.cs" />\r
+ <Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />\r
<Compile Include="Commands\ProcessShortcutCommand.cs" />\r
<Compile Include="Commands\SourceMenuCommand.cs" />\r
+ <Compile Include="Commands\AdvancedEncoderOptionsCommand.cs" />\r
<Compile Include="Controls\Loading.xaml.cs">\r
<DependentUpon>Loading.xaml</DependentUpon>\r
</Compile>\r
<Compile Include="Converters\Options\OptionsTabConverter.cs" />\r
<Compile Include="Converters\Subtitles\SubtitlesQueueDisplayConverter.cs" />\r
<Compile Include="Converters\Video\VideoEncoderConverter.cs" />\r
+ <Compile Include="Helpers\GrayscaleImage.cs" />\r
<Compile Include="Helpers\GrowlCommunicator.cs" />\r
<Compile Include="Services\DriveDetectService.cs" />\r
<Compile Include="Services\EncodeServiceWrapper.cs" />\r
//------------------------------------------------------------------------------\r
// <auto-generated>\r
// This code was generated by a tool.\r
-// Runtime Version:4.0.30319.269\r
+// Runtime Version:4.0.30319.296\r
//\r
// Changes to this file may cause incorrect behavior and will be lost if\r
// the code is regenerated.\r
return ((System.Drawing.Bitmap)(obj));\r
}\r
}\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Set the desired quality factor. The encoder targets a certain quality. \r
+ ///The scale used by each video encoder is different.\r
+ ///\r
+ ///x264's scale is logarithmic and lower values correspond to higher quality. \r
+ ///So small increases in value will result in progressively larger increases in the resulting file size. \r
+ ///A value of 0 means lossless and will result in a file size that is larger than the original source, \r
+ ///unless the source was also lossless. \r
+ ///Suggested values are: 18 to 20 for Standard Definition and 20 t [rest of string was truncated]";.\r
+ /// </summary>\r
+ public static string Video_QualitySlider {\r
+ get {\r
+ return ResourceManager.GetString("Video_QualitySlider", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to The full x264 list of parameters: {0}.\r
+ /// </summary>\r
+ public static string Video_x264ExtraArgs {\r
+ get {\r
+ return ResourceManager.GetString("Video_x264ExtraArgs", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Reduce decoder CPU usage.\r
+ ///\r
+ ///Set this if your device is struggling to play the output. (i.e. dropped frames).\r
+ /// </summary>\r
+ public static string Video_x264FastDecode {\r
+ get {\r
+ return ResourceManager.GetString("Video_x264FastDecode", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Sets and ensures compliance with the specified H.264 Levels. This will override all other settings..\r
+ /// </summary>\r
+ public static string Video_x264Level {\r
+ get {\r
+ return ResourceManager.GetString("Video_x264Level", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Adjusts x264 settings to trade off compression efficiency against encoding speed.\r
+ ///\r
+ ///This establishes your default x264 settings. Tunes, profiles, levels and advanced options string will be applied to this.\r
+ ///\r
+ ///You should generally set this option to the slowest you can bear since slower settings will result in better quality or smaller files..\r
+ /// </summary>\r
+ public static string Video_x264Preset {\r
+ get {\r
+ return ResourceManager.GetString("Video_x264Preset", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Limit the H.264 profile of the output stream. This will override all other settings..\r
+ /// </summary>\r
+ public static string Video_x264Profile {\r
+ get {\r
+ return ResourceManager.GetString("Video_x264Profile", resourceCulture);\r
+ }\r
+ }\r
+ \r
+ /// <summary>\r
+ /// Looks up a localized string similar to Tune settings to optimise for common scenarios\r
+ ///\r
+ ///This can improve efficiency for particular source characteristics or set of characteristics of the output file.\r
+ ///\r
+ ///Changes will be applied after the preset but before all other parameters..\r
+ /// </summary>\r
+ public static string Video_x264Tune {\r
+ get {\r
+ return ResourceManager.GetString("Video_x264Tune", resourceCulture);\r
+ }\r
+ }\r
}\r
}\r
<data name="logo64" type="System.Resources.ResXFileRef, System.Windows.Forms">\r
<value>..\Resources\logo64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>\r
</data>\r
+ <data name="Video_x264ExtraArgs" xml:space="preserve">\r
+ <value>The full x264 list of parameters: {0}</value>\r
+ </data>\r
+ <data name="Video_x264FastDecode" xml:space="preserve">\r
+ <value>Reduce decoder CPU usage.\r
+\r
+Set this if your device is struggling to play the output. (i.e. dropped frames)</value>\r
+ </data>\r
+ <data name="Video_x264Level" xml:space="preserve">\r
+ <value>Sets and ensures compliance with the specified H.264 Levels. This will override all other settings.</value>\r
+ </data>\r
+ <data name="Video_x264Preset" xml:space="preserve">\r
+ <value>Adjusts x264 settings to trade off compression efficiency against encoding speed.\r
+\r
+This establishes your default x264 settings. Tunes, profiles, levels and advanced options string will be applied to this.\r
+\r
+You should generally set this option to the slowest you can bear since slower settings will result in better quality or smaller files.</value>\r
+ </data>\r
+ <data name="Video_x264Profile" xml:space="preserve">\r
+ <value>Limit the H.264 profile of the output stream. This will override all other settings.</value>\r
+ </data>\r
+ <data name="Video_x264Tune" xml:space="preserve">\r
+ <value>Tune settings to optimise for common scenarios\r
+\r
+This can improve efficiency for particular source characteristics or set of characteristics of the output file.\r
+\r
+Changes will be applied after the preset but before all other parameters.</value>\r
+ </data>\r
+ <data name="Video_QualitySlider" xml:space="preserve">\r
+ <value>Set the desired quality factor. The encoder targets a certain quality. \r
+The scale used by each video encoder is different.\r
+\r
+x264's scale is logarithmic and lower values correspond to higher quality. \r
+So small increases in value will result in progressively larger increases in the resulting file size. \r
+A value of 0 means lossless and will result in a file size that is larger than the original source, \r
+unless the source was also lossless. \r
+Suggested values are: 18 to 20 for Standard Definition and 20 to 23 for High Definition.\r
+\r
+FFMpeg's and Theora's scale is more linear. These encoders do not have a lossless mode.</value>\r
+ </data>\r
</root>
\ No newline at end of file
using HandBrake.ApplicationServices;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
\r
+ using HandBrakeWPF.Commands;\r
+ using HandBrakeWPF.Commands.Interfaces;\r
+\r
using ViewModels;\r
using ViewModels.Interfaces;\r
\r
this.windsorContainer.Register(Component.For<IEncodeServiceWrapper>().ImplementedBy<EncodeServiceWrapper>().LifeStyle.Is(LifestyleType.Singleton));\r
this.windsorContainer.Register(Component.For<INotificationService>().ImplementedBy<NotificationService>().LifeStyle.Is(LifestyleType.Singleton));\r
\r
+ // Commands\r
+ this.windsorContainer.Register(Component.For<IAdvancedEncoderOptionsCommand>().ImplementedBy<AdvancedEncoderOptionsCommand>().LifeStyle.Is(LifestyleType.Singleton));\r
+\r
// Shell\r
this.windsorContainer.Register(Component.For<IErrorService>().ImplementedBy<ErrorService>().LifeStyle.Is(LifestyleType.Singleton));\r
this.windsorContainer.Register(Component.For<IErrorViewModel>().ImplementedBy<ErrorViewModel>().LifeStyle.Is(LifestyleType.Singleton));\r
/// </summary>\r
public const string HandBrakePlatform = "HandBrakePlatform";\r
\r
+ /// <summary>\r
+ /// The show advanced tab.\r
+ /// </summary>\r
+ public const string ShowAdvancedTab = "ShowAdvancedTab";\r
+\r
#endregion\r
}\r
}
\ No newline at end of file
using HandBrake.ApplicationServices.Parsing;\r
using HandBrake.Interop.Model.Encoding;\r
\r
+ using HandBrakeWPF.Commands.Interfaces;\r
using HandBrakeWPF.Helpers;\r
using HandBrakeWPF.Model;\r
using HandBrakeWPF.ViewModels.Interfaces;\r
/// </summary>\r
public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel\r
{\r
+ /// <summary>\r
+ /// The advanced encoder options command.\r
+ /// </summary>\r
+ private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;\r
+\r
#region Constants and Fields\r
\r
/// <summary>\r
/// <summary>\r
/// Initializes a new instance of the <see cref="AdvancedViewModel"/> class.\r
/// </summary>\r
- public AdvancedViewModel()\r
+ public AdvancedViewModel(IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand)\r
{\r
+ this.advancedEncoderOptionsCommand = advancedEncoderOptionsCommand;\r
this.Task = new EncodeTask();\r
this.UpdateUIFromAdvancedOptions();\r
}\r
this.Task.AdvancedEncoderOptions = value;\r
this.UpdateUIFromAdvancedOptions();\r
this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
+\r
+ // Reset the video tab if the user is using this tab.\r
+ if (!string.IsNullOrEmpty(this.Task.AdvancedEncoderOptions))\r
+ {\r
+ this.advancedEncoderOptionsCommand.ExecuteClearVideo();\r
+ }\r
}\r
}\r
\r
\r
#region Public Methods\r
\r
- /// <summary>\r
- /// The notify all changed.\r
- /// </summary>\r
- public void NotifyAllChanged()\r
- {\r
- this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
- }\r
-\r
/// <summary>\r
/// The update ui from advanced options.\r
/// </summary>\r
}\r
}\r
\r
- break;\r
- default:\r
break;\r
}\r
}\r
} \r
}\r
\r
+ /// <summary>\r
+ /// The clear.\r
+ /// </summary>\r
+ public void Clear()\r
+ {\r
+ this.AdvancedOptionsString = string.Empty;\r
+ }\r
+\r
#endregion\r
\r
#region ITabInterface\r
int equalsIndex = existingSegment.IndexOf('=');\r
if (equalsIndex >= 0)\r
{\r
- optionName = existingSegment.Substring(0, existingSegment.IndexOf("="));\r
+ optionName = existingSegment.Substring(0, existingSegment.IndexOf("=", System.StringComparison.Ordinal));\r
}\r
\r
if (!this.uiOptions.Contains(optionName) && optionName != string.Empty)\r
\r
this.Task.AdvancedEncoderOptions = string.Join(":", newOptions);\r
this.NotifyOfPropertyChange(() => this.AdvancedOptionsString);\r
+\r
+ // Reset the video tab if the user is using this tab.\r
+ if (!string.IsNullOrEmpty(this.Task.AdvancedEncoderOptions))\r
+ {\r
+ this.advancedEncoderOptionsCommand.ExecuteClearVideo();\r
+ }\r
}\r
\r
#endregion\r
/// The Video Encoder.\r
/// </param>\r
void SetEncoder(VideoEncoder encoder);\r
+\r
+ /// <summary>\r
+ /// Clear out the settings.\r
+ /// </summary>\r
+ void Clear();\r
}\r
}\r
/// Trigger a Notify Property Changed on the Task to force various UI elements to update.\r
/// </summary>\r
void RefreshTask();\r
+\r
+ /// <summary>\r
+ /// Clear the advanced x264 options.\r
+ /// </summary>\r
+ void ClearAdvancedSettings();\r
}\r
}\r
/// </summary>\r
public CancelScanCommand CancelScanCommand { get; set; }\r
\r
- #endregion\r
-\r
- #region Properties for Settings\r
-\r
/// <summary>\r
/// Gets or sets Destination.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets a value indicating whether show advanced tab.\r
+ /// </summary>\r
+ public bool ShowAdvancedTab\r
+ {\r
+ get\r
+ {\r
+ return this.userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedTab);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Load and Shutdown Handling\r
using System.Linq;\r
using System.Windows;\r
\r
- using Caliburn.Micro;\r
-\r
using HandBrake.ApplicationServices;\r
- using HandBrake.ApplicationServices.Exceptions;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Utilities;\r
\r
/// </summary>\r
private bool enableLibHb;\r
\r
+ /// <summary>\r
+ /// The show advanced tab backing field.\r
+ /// </summary>\r
+ private bool showAdvancedTab;\r
+\r
#endregion\r
\r
#region Constructors and Destructors\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether enable lib hb.\r
+ /// </summary>\r
+ public bool ShowAdvancedTab\r
+ {\r
+ get\r
+ {\r
+ return this.showAdvancedTab;\r
+ }\r
+ set\r
+ {\r
+ this.showAdvancedTab = value;\r
+ this.NotifyOfPropertyChange(() => this.ShowAdvancedTab);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#endregion\r
this.MinimiseToTray = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.MainWindowMinimize);\r
this.DisablePresetUpdateCheckNotification = this.userSettingService.GetUserSetting<bool>(UserSettingConstants.PresetNotification);\r
this.ClearQueueOnEncodeCompleted = userSettingService.GetUserSetting<bool>(ASUserSettingConstants.ClearCompletedFromQueue);\r
+ this.ShowAdvancedTab = userSettingService.GetUserSetting<bool>(UserSettingConstants.ShowAdvancedTab);\r
\r
// Set the preview count\r
this.PreviewPicturesToScan.Clear();\r
this.ConstantQualityGranularity.Add("1.00");\r
this.ConstantQualityGranularity.Add("0.50");\r
this.ConstantQualityGranularity.Add("0.25");\r
- this.ConstantQualityGranularity.Add("0.20");\r
this.SelectedGranulairty = userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step).ToString("0.00", CultureInfo.InvariantCulture);\r
\r
// Min Title Length\r
userSettingService.SetUserSetting(ASUserSettingConstants.ClearCompletedFromQueue, this.ClearQueueOnEncodeCompleted);\r
userSettingService.SetUserSetting(ASUserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);\r
userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture));\r
+ userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);\r
\r
int value;\r
if (int.TryParse(this.MinLength.ToString(CultureInfo.InvariantCulture), out value))\r
{\r
using System;\r
using System.Collections.Generic;\r
+ using System.ComponentModel;\r
using System.Globalization;\r
+ using System.Linq;\r
\r
using Caliburn.Micro;\r
\r
using HandBrake.ApplicationServices.Parsing;\r
using HandBrake.ApplicationServices.Services.Interfaces;\r
using HandBrake.ApplicationServices.Utilities;\r
+ using HandBrake.Interop;\r
+ using HandBrake.Interop.HbLib;\r
using HandBrake.Interop.Model.Encoding;\r
+ using HandBrake.Interop.Model.Encoding.x264;\r
\r
+ using HandBrakeWPF.Commands.Interfaces;\r
+ using HandBrakeWPF.Properties;\r
using HandBrakeWPF.ViewModels.Interfaces;\r
\r
/// <summary>\r
public class VideoViewModel : ViewModelBase, IVideoViewModel\r
{\r
#region Constants and Fields\r
-\r
/// <summary>\r
/// Same as source constant.\r
/// </summary>\r
private const string SameAsSource = "Same as source";\r
\r
+ /// <summary>\r
+ /// The possible h264 levels.\r
+ /// </summary>\r
+ private static readonly List<string> Levels = new List<string> { "Auto", "1.0", "1b", "1.1", "1.2", "1.3", "2.0", "2.1", "2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2", "5.0", "5.1", "5.2"};\r
+\r
/// <summary>\r
/// Backing field for the user setting service.\r
/// </summary>\r
- private IUserSettingService userSettingService;\r
+ private readonly IUserSettingService userSettingService;\r
+\r
+ /// <summary>\r
+ /// The advanced encoder options command\r
+ /// </summary>\r
+ private readonly IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand;\r
\r
/// <summary>\r
/// Backing field used to display / hide the x264 options\r
/// </summary>\r
private int rf;\r
\r
+ /// <summary>\r
+ /// The x264 preset value.\r
+ /// </summary>\r
+ private int x264PresetValue;\r
+\r
+ /// <summary>\r
+ /// The extra arguments.\r
+ /// </summary>\r
+ private string extraArguments;\r
+\r
+ /// <summary>\r
+ /// The can clear tracker.\r
+ /// </summary>\r
+ private bool canClear;\r
+\r
#endregion\r
\r
#region Constructors and Destructors\r
/// <summary>\r
/// Initializes a new instance of the <see cref="VideoViewModel"/> class.\r
/// </summary>\r
- /// <param name="windowManager">\r
- /// The window manager.\r
- /// </param>\r
/// <param name="userSettingService">\r
/// The user Setting Service.\r
/// </param>\r
- public VideoViewModel(IWindowManager windowManager, IUserSettingService userSettingService)\r
+ /// <param name="advancedEncoderOptionsCommand">\r
+ /// The advanced Encoder Options Command.\r
+ /// </param>\r
+ public VideoViewModel(IUserSettingService userSettingService, IAdvancedEncoderOptionsCommand advancedEncoderOptionsCommand)\r
{\r
this.Task = new EncodeTask { VideoEncoder = VideoEncoder.X264 };\r
this.userSettingService = userSettingService;\r
+ this.advancedEncoderOptionsCommand = advancedEncoderOptionsCommand;\r
this.QualityMin = 0;\r
this.QualityMax = 51;\r
this.IsConstantQuantity = true;\r
this.VideoEncoders = EnumHelper<VideoEncoder>.GetEnumList();\r
\r
- //X264Presets = EnumHelper<x264Preset>.GetEnumList();\r
- //X264Profiles = EnumHelper<x264Profile>.GetEnumList();\r
- //X264Tunes = EnumHelper<x264Tune>.GetEnumList();\r
+ X264Presets = new BindingList<x264Preset>(EnumHelper<x264Preset>.GetEnumList().ToList());\r
+ H264Profiles = EnumHelper<x264Profile>.GetEnumList();\r
+ X264Tunes = EnumHelper<x264Tune>.GetEnumList().Where(t => t != x264Tune.Fastdecode);\r
+ this.H264Levels = Levels;\r
}\r
\r
#endregion\r
this.rf = value;\r
\r
double cqStep = userSettingService.GetUserSetting<double>(UserSettingConstants.X264Step);\r
- this.SetQualitySliderBounds(); \r
+ this.SetQualitySliderBounds();\r
switch (this.SelectedVideoEncoder)\r
{\r
case VideoEncoder.FFMpeg:\r
/// </summary>\r
public IEnumerable<VideoEncoder> VideoEncoders { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets the extra arguments.\r
+ /// </summary>\r
+ public string ExtraArguments\r
+ {\r
+ get\r
+ {\r
+ return this.extraArguments;\r
+ }\r
+ set\r
+ {\r
+ if (!object.Equals(this.extraArguments, value))\r
+ {\r
+ this.extraArguments = value;\r
+ this.NotifyOfPropertyChange(() => this.ExtraArguments);\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether display x 264 options.\r
+ /// </summary>\r
+ public bool DisplayX264Options\r
+ {\r
+ get\r
+ {\r
+ return this.displayX264Options;\r
+ }\r
+ set\r
+ {\r
+ this.displayX264Options = value;\r
+ this.NotifyOfPropertyChange(() => this.DisplayX264Options);\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the x 264 preset value.\r
+ /// </summary>\r
+ public int X264PresetValue\r
+ {\r
+ get\r
+ {\r
+ return this.x264PresetValue;\r
+ }\r
+ set\r
+ {\r
+ if (!object.Equals(this.X264PresetValue, value))\r
+ {\r
+ this.x264PresetValue = value;\r
+ this.X264Preset = this.X264Presets[value];\r
+ this.NotifyOfPropertyChange(() => this.x264PresetValue);\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets X264Preset.\r
+ /// </summary>\r
+ public x264Preset X264Preset\r
+ {\r
+ get\r
+ {\r
+ return this.Task.X264Preset;\r
+ }\r
+ set\r
+ {\r
+ if (!object.Equals(this.X264Preset, value))\r
+ {\r
+ this.Task.X264Preset = value;\r
+ this.NotifyOfPropertyChange(() => this.X264Preset);\r
+ ResetAdvancedTab();\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets H264Profile.\r
+ /// </summary>\r
+ public x264Profile H264Profile\r
+ {\r
+ get\r
+ {\r
+ return this.Task.H264Profile;\r
+ }\r
+\r
+ set\r
+ {\r
+ if (!object.Equals(this.H264Profile, value))\r
+ {\r
+ this.Task.H264Profile = value;\r
+ this.NotifyOfPropertyChange(() => this.H264Profile);\r
+ ResetAdvancedTab();\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets H264Profile.\r
+ /// </summary>\r
+ public string H264Level\r
+ {\r
+ get\r
+ {\r
+ return this.Task.H264Level;\r
+ }\r
+ set\r
+ {\r
+ if (!object.Equals(this.H264Level, value))\r
+ {\r
+ this.Task.H264Level = value;\r
+ this.NotifyOfPropertyChange(() => this.H264Level);\r
+ ResetAdvancedTab();\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets X264Tune.\r
+ /// </summary>\r
+ public x264Tune X264Tune\r
+ {\r
+ get\r
+ {\r
+ return this.Task.X264Tune;\r
+ }\r
+ set\r
+ {\r
+ if (!object.Equals(this.X264Tune, value))\r
+ {\r
+ this.Task.X264Tune = value;\r
+ this.NotifyOfPropertyChange(() => this.X264Tune);\r
+ ResetAdvancedTab();\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether fast decode.\r
+ /// </summary>\r
+ public bool FastDecode\r
+ {\r
+ get\r
+ {\r
+ return this.Task.FastDecode;\r
+ }\r
+ set\r
+ {\r
+ if (!object.Equals(this.FastDecode, value))\r
+ {\r
+ this.Task.FastDecode = value;\r
+ this.NotifyOfPropertyChange(() => this.FastDecode);\r
+ ResetAdvancedTab();\r
+ }\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// Gets or sets X264Presets.\r
+ /// </summary>\r
+ public BindingList<x264Preset> X264Presets { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets X264Profiles.\r
+ /// </summary>\r
+ public IEnumerable<x264Profile> H264Profiles { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets X264Tunes.\r
+ /// </summary>\r
+ public IEnumerable<x264Tune> X264Tunes { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the x 264 levels.\r
+ /// </summary>\r
+ public IEnumerable<string> H264Levels { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets the full options tooltip.\r
+ /// </summary>\r
+ public string FullOptionsTooltip\r
+ {\r
+ get\r
+ {\r
+ return "You can provide additional arguments using the standard x264 format"; // string.Format(Resources.Video_x264ExtraArgs, this.GetActualx264Query());\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#region Public Methods\r
{\r
case VideoEncoder.FFMpeg:\r
case VideoEncoder.FFMpeg2:\r
- int cq;\r
if (preset.Task.Quality.HasValue)\r
{\r
+ int cq;\r
int.TryParse(preset.Task.Quality.Value.ToString(CultureInfo.InvariantCulture), out cq);\r
this.RF = 32 - cq;\r
}\r
break;\r
case VideoEncoder.X264:\r
- \r
+\r
double multiplier = 1.0 / cqStep;\r
if (preset.Task.Quality.HasValue)\r
{\r
\r
this.NotifyOfPropertyChange(() => this.Task);\r
\r
- //if (preset != null && preset.Task != null)\r
- //{\r
- // this.Query = preset.Task.AdvancedEncoderOptions;\r
- // this.SetEncoder(preset.Task.VideoEncoder);\r
-\r
- // this.X264Preset = preset.Task.x264Preset;\r
- // this.X264Profile = preset.Task.x264Profile;\r
- // this.X264Tune = preset.Task.X264Tune;\r
- //}\r
+ if (preset.Task != null)\r
+ {\r
+ this.SetEncoder(preset.Task.VideoEncoder);\r
+ this.X264PresetValue = preset.Task.VideoEncoder == VideoEncoder.X264\r
+ ? (int)preset.Task.X264Preset\r
+ : (int)x264Preset.Medium;\r
+ this.H264Profile = preset.Task.VideoEncoder == VideoEncoder.X264 ? preset.Task.H264Profile : x264Profile.None;\r
+ this.X264Tune = preset.Task.VideoEncoder == VideoEncoder.X264 ? preset.Task.X264Tune : x264Tune.None;\r
+ this.H264Level = preset.Task.H264Level;\r
+ }\r
}\r
\r
/// <summary>\r
/// </param>\r
public void SetEncoder(VideoEncoder encoder)\r
{\r
- //this.DisplayX264Options = encoder == VideoEncoder.X264;\r
+ this.DisplayX264Options = encoder == VideoEncoder.X264;\r
}\r
\r
/// <summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Clear advanced settings.\r
+ /// </summary>\r
+ public void ClearAdvancedSettings()\r
+ {\r
+ this.canClear = false;\r
+ this.X264PresetValue = 5;\r
+ this.X264Tune = x264Tune.None;\r
+ this.H264Profile = x264Profile.None;\r
+ this.FastDecode = false;\r
+ this.H264Level = "Auto";\r
+ this.ExtraArguments = string.Empty;\r
+ this.canClear = true;\r
+ }\r
+\r
#endregion\r
\r
/// <summary>\r
}\r
}\r
\r
- #region Advanced\r
- ///// <summary>\r
- ///// Gets or sets State.\r
- ///// </summary>\r
- //public string Query\r
- //{\r
- // get\r
- // {\r
- // return this.Task.AdvancedEncoderOptions;\r
- // }\r
- // set\r
- // {\r
- // this.Task.AdvancedEncoderOptions = value;\r
- // this.NotifyOfPropertyChange(() => this.Query);\r
- // }\r
- //}\r
-\r
- ///// <summary>\r
- ///// Gets or sets X264Preset.\r
- ///// </summary>\r
- //public x264Preset X264Preset\r
- //{\r
- // get\r
- // {\r
- // return this.Task.x264Preset;\r
- // }\r
- // set\r
- // {\r
- // this.Task.x264Preset = value;\r
- // this.NotifyOfPropertyChange(() => this.X264Preset);\r
- // }\r
- //}\r
-\r
- ///// <summary>\r
- ///// Gets or sets X264Profile.\r
- ///// </summary>\r
- //public x264Profile X264Profile\r
- //{\r
- // get\r
- // {\r
- // return this.Task.x264Profile;\r
- // }\r
- // set\r
- // {\r
- // this.Task.x264Profile = value;\r
- // this.NotifyOfPropertyChange(() => this.X264Profile);\r
- // }\r
- //}\r
-\r
- ///// <summary>\r
- ///// Gets or sets X264Tune.\r
- ///// </summary>\r
- //public x264Tune X264Tune\r
- //{\r
- // get\r
- // {\r
- // return this.Task.X264Tune;\r
- // }\r
- // set\r
- // {\r
- // this.Task.X264Tune = value;\r
- // this.NotifyOfPropertyChange(() => this.X264Tune);\r
- // }\r
- //}\r
-\r
- ///// <summary>\r
- ///// Gets or sets X264Presets.\r
- ///// </summary>\r
- //public IEnumerable<x264Preset> X264Presets { get; set; }\r
-\r
- ///// <summary>\r
- ///// Gets or sets X264Profiles.\r
- ///// </summary>\r
- //public IEnumerable<x264Profile> X264Profiles { get; set; }\r
-\r
- ///// <summary>\r
- ///// Gets or sets X264Tunes.\r
- ///// </summary>\r
- //public IEnumerable<x264Tune> X264Tunes { get; set; }\r
-\r
- ///// <summary>\r
- ///// Gets or sets a value indicating whether DisplayX264Options.\r
- ///// </summary>\r
- //public bool DisplayX264Options\r
- //{\r
- // get\r
- // {\r
- // return this.displayX264Options;\r
- // }\r
- // set\r
- // {\r
- // this.displayX264Options = value;\r
- // this.NotifyOfPropertyChange(() => this.DisplayX264Options);\r
- // }\r
- //}\r
- #endregion\r
+ /// <summary>\r
+ /// Reset advanced tab.\r
+ /// </summary>\r
+ private void ResetAdvancedTab()\r
+ {\r
+ if (canClear)\r
+ {\r
+ this.advancedEncoderOptionsCommand.ExecuteClearAdvanced();\r
+ }\r
+ }\r
+\r
+ /// <summary>\r
+ /// The get actualx 264 query.\r
+ /// </summary>\r
+ /// <returns>\r
+ /// The <see cref="string"/>.\r
+ /// </returns>\r
+ private string GetActualx264Query()\r
+ {\r
+ string preset = EnumHelper<x264Preset>.GetDisplay(this.X264Preset);\r
+ string profile = EnumHelper<x264Profile>.GetDisplay(this.H264Profile);\r
+\r
+ List<string> tunes = new List<string>();\r
+ if (X264Tune != x264Tune.None)\r
+ {\r
+ tunes.Add(EnumHelper<x264Tune>.GetDisplay(this.X264Tune));\r
+ }\r
+ if (this.FastDecode)\r
+ {\r
+ tunes.Add("fastdecode");\r
+ }\r
+\r
+ // Get the width or height, default if we don't have it yet so we don't crash.\r
+ int width = this.Task.Width.HasValue ? this.Task.Width.Value : 720;\r
+ int height = this.Task.Height.HasValue ? this.Task.Height.Value : 576;\r
+\r
+ // TODO figure out what is wrong with this??\r
+ return HandBrakeUtils.CreateX264OptionsString(preset, tunes, this.ExtraArguments, profile, this.H264Level, width, height);\r
+ }\r
}\r
}
\ No newline at end of file
<TabItem Name="pictureTab" Header="Picture">\r
<ContentControl x:Name="PictureSettingsViewModel" />\r
</TabItem>\r
- <TabItem Name="filtersTab" Header="Video Filters">\r
+ <TabItem Name="filtersTab" Header="Filters">\r
<ContentControl x:Name="FiltersViewModel" />\r
</TabItem>\r
<TabItem Name="videoTab" Header="Video">\r
<TabItem Name="chaptersTab" Header="Chapters">\r
<ContentControl x:Name="ChaptersViewModel" />\r
</TabItem>\r
- <TabItem Name="advancedTab" Header="Advanced">\r
+ <TabItem Name="advancedTab" Header="Advanced" Visibility="{Binding ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">\r
<ContentControl x:Name="AdvancedViewModel" />\r
</TabItem>\r
</TabControl>\r
<CheckBox Content="Display status messages from tray icon (balloon popups)" Visibility="Collapsed" IsChecked="{Binding DisplayStatusMessagesTrayIcon}" />\r
<CheckBox Content="Disable built-in preset update notification" IsChecked="{Binding DisablePresetUpdateCheckNotification}" />\r
<CheckBox Content="Always clear completed queue items after an encode completes" IsChecked="{Binding ClearQueueOnEncodeCompleted}" />\r
+ <CheckBox Content="Show Advanced Tab" IsChecked="{Binding ShowAdvancedTab}" />\r
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">\r
<TextBlock Text="Number of picture previews to scan:" VerticalAlignment="Center" Width="250" />\r
<ComboBox Name="numberOfPreviews" ItemsSource="{Binding PreviewPicturesToScan}" SelectedItem="{Binding SelectedPreviewCount}" Width="120" />\r
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" \r
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"\r
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"\r
- xmlns:Video="clr-namespace:HandBrakeWPF.Converters.Video" mc:Ignorable="d" >\r
+ xmlns:Video="clr-namespace:HandBrakeWPF.Converters.Video"\r
+ xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" mc:Ignorable="d" >\r
\r
<UserControl.Resources>\r
<Converters:BooleanConverter x:Key="boolConverter" />\r
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />\r
<Converters:EnumComboConverter x:Key="enumComboConverter" />\r
<Video:VideoEncoderConverter x:Key="videoEncoderConverter" />\r
+\r
+ <Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">\r
+ <Setter Property="ToolTipService.ShowDuration" Value="20000" />\r
+ </Style>\r
</UserControl.Resources>\r
\r
<Grid Margin="10,5,0,0">\r
<ColumnDefinition Width="*" />\r
<ColumnDefinition Width="*" />\r
</Grid.ColumnDefinitions>\r
+ \r
+ <Grid.RowDefinitions>\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ </Grid.RowDefinitions>\r
\r
<StackPanel Orientation="Vertical" Grid.Column="0" >\r
\r
<StackPanel Orientation="Vertical">\r
<ComboBox Width="120" ItemsSource="{Binding Framerates}" SelectedItem="{Binding SelectedFramerate}" />\r
<RadioButton Content="Constant Framerate" IsChecked="{Binding IsConstantFramerate}" Margin="0,10,0,0" />\r
- <RadioButton Content="Variable Framerate" IsChecked="{Binding IsVariableFramerate}" Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />\r
- <RadioButton Content="Peak Framerate" IsChecked="{Binding IsPeakFramerate}" Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
+ <RadioButton Content="Variable Framerate" IsChecked="{Binding IsVariableFramerate}" Margin="0,5,0,0" \r
+ Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />\r
+ <RadioButton Content="Peak Framerate" IsChecked="{Binding IsPeakFramerate}" Margin="0,5,0,0"\r
+ Visibility="{Binding ShowPeakFramerate, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />\r
</StackPanel>\r
</StackPanel>\r
</StackPanel>\r
<TextBlock Text="RF" FontWeight="Bold" />\r
</StackPanel>\r
\r
- <Slider Width="240" Value="{Binding RF}" Maximum="{Binding QualityMax}" Minimum="{Binding QualityMin}"\r
- IsEnabled="{Binding IsConstantQuantity}" Margin="0,0,0,20" />\r
+ <Slider Width="280" Value="{Binding RF}" HorizontalAlignment="Left" Maximum="{Binding QualityMax}" Minimum="{Binding QualityMin}"\r
+ IsEnabled="{Binding IsConstantQuantity}" Margin="20,0,0,20"\r
+ ToolTip="{x:Static Properties:Resources.Video_QualitySlider}" Style="{StaticResource LongToolTipHolder}" \r
+ IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" />\r
\r
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">\r
<RadioButton Content="Avg Bitrate (kbps):" IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0"/>\r
\r
</StackPanel>\r
\r
-\r
- <!--<Grid Grid.Row="1" Margin="10,10,0,0" Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}">\r
+ <!-- H264 settings -->\r
+ <Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="0,20,0,0" Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}">\r
<Grid.RowDefinitions>\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
+ <RowDefinition Height="Auto" />\r
<RowDefinition Height="Auto" />\r
<RowDefinition Height="*" />\r
</Grid.RowDefinitions>\r
-\r
- <StackPanel Grid.Row="0" Orientation="Vertical" Margin="0,0,0,10">\r
-\r
- <TextBlock Text="X264 Advanced Options:" Margin="0,0,0,5" FontWeight="Bold" VerticalAlignment="Center" />\r
-\r
- <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,10">\r
- <TextBlock Text="Preset:" VerticalAlignment="Center" />\r
- <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"\r
- ItemsSource="{Binding X264Presets, Converter={StaticResource x264DisplayConverter}}" \r
- SelectedItem="{Binding X264Preset, Converter={StaticResource x264DisplayConverter}}"/>\r
-\r
- <TextBlock Text="Profile:" VerticalAlignment="Center" />\r
- <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"\r
- ItemsSource="{Binding X264Profiles, Converter={StaticResource x264DisplayConverter}}" \r
- SelectedItem="{Binding X264Profile, Converter={StaticResource x264DisplayConverter}}"/>\r
-\r
-\r
- <TextBlock Text="Tune:" VerticalAlignment="Center" />\r
- <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"\r
- ItemsSource="{Binding X264Tunes, Converter={StaticResource x264DisplayConverter}}" \r
- SelectedItem="{Binding X264Tune, Converter={StaticResource x264DisplayConverter}}"/>\r
- </StackPanel>\r
+ \r
+ <Grid.ColumnDefinitions>\r
+ <ColumnDefinition Width="Auto" />\r
+ <ColumnDefinition Width="Auto" />\r
+ <ColumnDefinition Width="Auto" />\r
+ <ColumnDefinition Width="Auto" />\r
+ </Grid.ColumnDefinitions>\r
+\r
+ <TextBlock Text="Optimise Video:" Margin="0,0,0,8" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" FontWeight="Bold" VerticalAlignment="Center" />\r
+\r
+ <!-- Row 1 -->\r
+ <TextBlock Text="x264 Preset:" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" />\r
+ <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Orientation="Horizontal">\r
+ <Slider Minimum="0" Maximum="9" Width="150" Value="{Binding X264PresetValue, Mode=Default, UpdateSourceTrigger=PropertyChanged}" \r
+ IsSnapToTickEnabled="True" TickFrequency="1" TickPlacement="BottomRight" ToolTip="{x:Static Properties:Resources.Video_x264Preset}" \r
+ Style="{StaticResource LongToolTipHolder}" />\r
+ <TextBlock Text="{Binding X264Preset, Converter={StaticResource enumComboConverter}}" Margin="5,0,0,0" />\r
</StackPanel>\r
\r
+ <TextBlock Text="x264 Tune:" Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" Margin="0,10,0,0" />\r
+ <ComboBox Width="100" Grid.Row="2" Grid.Column="1" Margin="5,10,5,0" Height="22"\r
+ ItemsSource="{Binding X264Tunes, Converter={StaticResource enumComboConverter}}" \r
+ SelectedItem="{Binding X264Tune, Converter={StaticResource enumComboConverter}}"\r
+ ToolTip="{x:Static Properties:Resources.Video_x264Tune}"\r
+ Style="{StaticResource LongToolTipHolder}" />\r
+ <CheckBox IsChecked="{Binding FastDecode}" Content="Fast Decode" Grid.Row="2" Grid.Column="2" Margin="10,10,10,0" VerticalAlignment="Center"\r
+ ToolTip="{x:Static Properties:Resources.Video_x264FastDecode}"/>\r
+ \r
+\r
+ <!-- Row 2-->\r
+ <TextBlock Text="H.264 Profile:" Grid.Row="3" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" />\r
+ <ComboBox Width="100" Grid.Row="3" Grid.Column="1" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"\r
+ ItemsSource="{Binding H264Profiles, Converter={StaticResource enumComboConverter}}" \r
+ SelectedItem="{Binding H264Profile, Converter={StaticResource enumComboConverter}}"\r
+ Style="{StaticResource LongToolTipHolder}"\r
+ ToolTip="{x:Static Properties:Resources.Video_x264Profile}" />\r
+\r
+ <TextBlock Text="H.264 Level:" Grid.Row="3" Grid.Column="2" Margin="10,10,0,0" VerticalAlignment="Center" />\r
+ <ComboBox Width="100" Grid.Row="3" Grid.Column="3" Margin="5,10,5,0" Height="22" VerticalAlignment="Center"\r
+ ItemsSource="{Binding H264Levels}" \r
+ SelectedItem="{Binding H264Level}"\r
+ Style="{StaticResource LongToolTipHolder}"\r
+ ToolTip="{x:Static Properties:Resources.Video_x264Level}"/>\r
+ \r
+ <!-- Row 3 -->\r
+ <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />\r
+ <TextBox Text="{Binding ExtraArguments}" Height="30" MaxLines="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="5,10,0,0" VerticalAlignment="Center"\r
+ ToolTip="{Binding FullOptionsTooltip}"/>\r
+ \r
+ \r
</Grid>\r
-\r
- <StackPanel Grid.Row="2" Margin="10" Height="100" VerticalAlignment="Top" >\r
- <TextBlock Text="Advanced Query" Margin="0,0,0,5" FontWeight="Bold" VerticalAlignment="Center" />\r
- <TextBox Text="{Binding Query}" \r
- VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="150" TextWrapping="Wrap" />\r
- </StackPanel>-->\r
-\r
-\r
-\r
</Grid>\r
\r
</Grid>\r
<string>X264Step</string>\r
</key>\r
<value>\r
- <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:double" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">0.25</anyType>\r
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:double" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">1.0</anyType>\r
</value>\r
</item>\r
<item>\r
<anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>\r
</value>\r
</item>\r
+ <item>\r
+ <key>\r
+ <string>ShowAdvancedTab</string>\r
+ </key>\r
+ <value>\r
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">true</anyType>\r
+ </value>\r
+ </item>\r
</dictionary>
\ No newline at end of file