diff options
author | sr55 <[email protected]> | 2011-02-05 21:39:09 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2011-02-05 21:39:09 +0000 |
commit | 19c97ddd16b4da9d7d7bf05cc1e91537227da526 (patch) | |
tree | 0b88a29428fd1fba3c8c6bc8315c2702a72d74a5 /win | |
parent | c315f3cf228d84ab67c75c7f8fa7221379e88600 (diff) |
WinGui:
- Updates to the WinForms app for the library changes.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3782 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win')
-rw-r--r-- | win/C#/Controls/AudioPanel.cs | 7 | ||||
-rw-r--r-- | win/C#/Controls/Filters.cs | 70 | ||||
-rw-r--r-- | win/C#/Functions/PresetLoader.cs | 181 | ||||
-rw-r--r-- | win/C#/HandBrake10.5.1.ReSharper | 1 | ||||
-rw-r--r-- | win/C#/frmMain.cs | 8 | ||||
-rw-r--r-- | win/C#/frmQueue.cs | 43 |
6 files changed, 203 insertions, 107 deletions
diff --git a/win/C#/Controls/AudioPanel.cs b/win/C#/Controls/AudioPanel.cs index ba9c1794e..ed56bf384 100644 --- a/win/C#/Controls/AudioPanel.cs +++ b/win/C#/Controls/AudioPanel.cs @@ -7,6 +7,7 @@ namespace Handbrake.Controls {
using System;
using System.Collections;
+ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
@@ -105,7 +106,7 @@ namespace Handbrake.Controls /// Load an arraylist of AudioTrack items into the list.
/// </summary>
/// <param name="audioTracks">List of audio tracks</param>
- public void LoadTracks(ArrayList audioTracks)
+ public void LoadTracks(List<AudioTrack> audioTracks)
{
ClearAudioList();
@@ -152,8 +153,8 @@ namespace Handbrake.Controls // Add any tracks the preset has, if there is a preset and no audio tracks in the list currently
if (audioList.Rows.Count == 0 && preset != null)
{
- QueryParserUtility parsed = QueryParserUtility.Parse(preset.Query);
- foreach (AudioTrack audioTrack in parsed.AudioInformation)
+ EncodeTask parsed = QueryParserUtility.Parse(preset.Query);
+ foreach (AudioTrack audioTrack in parsed.AudioTracks)
{
DataGridViewRow newTrack = new DataGridViewRow();
newTrack.CreateCells(audioList);
diff --git a/win/C#/Controls/Filters.cs b/win/C#/Controls/Filters.cs index dda8c9548..0f47b4b75 100644 --- a/win/C#/Controls/Filters.cs +++ b/win/C#/Controls/Filters.cs @@ -8,6 +8,8 @@ namespace Handbrake.Controls using System;
using System.Windows.Forms;
+ using HandBrake.ApplicationServices.Model.Encoding;
+
/// <summary>
/// The Filters Panel
/// </summary>
@@ -129,22 +131,27 @@ namespace Handbrake.Controls /// <summary>
/// Set the Detelecine control
/// </summary>
- /// <param name="value">The value part of the CLI string</param>
- public void SetDeTelecine(string value)
+ /// <param name="value">
+ /// The value part of the CLI string
+ /// </param>
+ /// <param name="custom">
+ /// The Custom Detelecine setting
+ /// </param>
+ public void SetDeTelecine(Detelecine value, string custom)
{
text_customDT.Text = string.Empty;
text_customDT.Visible = false;
switch (value)
{
- case "Off":
+ case Detelecine.Off:
drop_detelecine.SelectedIndex = 0;
break;
- case "Default":
+ case Detelecine.Default:
drop_detelecine.SelectedIndex = 2;
break;
default:
drop_detelecine.SelectedIndex = 1;
- text_customDT.Text = value;
+ text_customDT.Text = custom;
text_customDT.Visible = true;
break;
}
@@ -153,28 +160,33 @@ namespace Handbrake.Controls /// <summary>
/// Set the Denoise control
/// </summary>
- /// <param name="value">The value part of the CLI string</param>
- public void SetDeNoise(string value)
+ /// <param name="value">
+ /// The value part of the CLI string
+ /// </param>
+ /// <param name="custom">
+ /// The custom denoise setting.
+ /// </param>
+ public void SetDeNoise(Denoise value, string custom)
{
text_customDN.Text = string.Empty;
text_customDN.Visible = false;
switch (value)
{
- case "Off":
+ case Denoise.Off:
drop_denoise.SelectedIndex = 0;
break;
- case "Weak":
+ case Denoise.Weak:
drop_denoise.SelectedIndex = 2;
break;
- case "Medium":
+ case Denoise.Medium:
drop_denoise.SelectedIndex = 3;
break;
- case "Strong":
+ case Denoise.Strong:
drop_denoise.SelectedIndex = 4;
break;
default:
drop_denoise.SelectedIndex = 1;
- text_customDN.Text = value;
+ text_customDN.Text = custom;
text_customDN.Visible = true;
break;
}
@@ -183,29 +195,34 @@ namespace Handbrake.Controls /// <summary>
/// Set the Deinterlace Control
/// </summary>
- /// <param name="value">The value part of the CLI string</param>
- public void SetDeInterlace(string value)
+ /// <param name="value">
+ /// The value part of the CLI string
+ /// </param>
+ /// <param name="custom">
+ /// The Custom Detinerlace Settings
+ /// </param>
+ public void SetDeInterlace(Deinterlace value, string custom)
{
text_customDI.Text = string.Empty;
text_customDI.Visible = false;
switch (value)
{
- case "Off":
+ case Deinterlace.Off:
drop_deinterlace.SelectedIndex = 0;
break;
- case "Fast":
+ case Deinterlace.Fast:
drop_deinterlace.SelectedIndex = 2;
break;
- case "Slow":
+ case Deinterlace.Slow:
drop_deinterlace.SelectedIndex = 3;
break;
- case "Slower":
+ case Deinterlace.Slower:
drop_deinterlace.SelectedIndex = 4;
break;
default:
drop_deinterlace.SelectedIndex = 1;
- text_customDI.Text = value;
+ text_customDI.Text = custom;
text_customDI.Visible = true;
break;
}
@@ -214,22 +231,27 @@ namespace Handbrake.Controls /// <summary>
/// Set the Decomb Control
/// </summary>
- /// <param name="value">The value part of the CLI string</param>
- public void SetDecomb(string value)
+ /// <param name="value">
+ /// The value part of the CLI string
+ /// </param>
+ /// <param name="custom">
+ /// The custom option string
+ /// </param>
+ public void SetDecomb(Decomb value, string custom)
{
text_customDC.Text = string.Empty;
text_customDC.Visible = false;
switch (value)
{
- case "Off":
+ case Decomb.Off:
drop_decomb.SelectedIndex = 0;
break;
- case "Default":
+ case Decomb.Default:
drop_decomb.SelectedIndex = 2;
break;
default:
drop_decomb.SelectedIndex = 1;
- text_customDC.Text = value;
+ text_customDC.Text = custom;
text_customDC.Visible = true;
break;
}
diff --git a/win/C#/Functions/PresetLoader.cs b/win/C#/Functions/PresetLoader.cs index f15389eae..64e153e16 100644 --- a/win/C#/Functions/PresetLoader.cs +++ b/win/C#/Functions/PresetLoader.cs @@ -8,7 +8,8 @@ namespace Handbrake.Functions using System.Drawing;
using System.Windows.Forms;
- using HandBrake.ApplicationServices.Utilities;
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Model.Encoding;
/// <summary>
/// Load a preset into the main Window
@@ -28,7 +29,7 @@ namespace Handbrake.Functions /// <param name="name">
/// Name of the preset
/// </param>
- public static void LoadPreset(frmMain mainWindow, QueryParserUtility presetQuery, string name)
+ public static void LoadPreset(frmMain mainWindow, EncodeTask presetQuery, string name)
{
#region Source
@@ -36,44 +37,46 @@ namespace Handbrake.Functions mainWindow.check_iPodAtom.CheckState = CheckState.Unchecked;
// Now load all the new settings onto the main window
- if (presetQuery.Format != null)
- {
- string destination = mainWindow.text_destination.Text;
- destination = destination.Replace(".mp4", "." + presetQuery.Format);
- destination = destination.Replace(".m4v", "." + presetQuery.Format);
- destination = destination.Replace(".mkv", "." + presetQuery.Format);
- mainWindow.text_destination.Text = destination;
- }
+ string destination = mainWindow.text_destination.Text;
+ destination = destination.Replace(".mp4", "." + presetQuery.OutputFormat);
+ destination = destination.Replace(".m4v", "." + presetQuery.OutputFormat);
+ destination = destination.Replace(".mkv", "." + presetQuery.OutputFormat);
+ mainWindow.text_destination.Text = destination;
#endregion
#region Destination and Output Settings
- if (presetQuery.Format != null)
+ if (presetQuery.OutputFormat == OutputFormat.Mp4 || presetQuery.OutputFormat == OutputFormat.M4V)
{
- if (presetQuery.Format == "mp4" || presetQuery.Format == "m4v")
+ if (mainWindow.drop_format.SelectedIndex == 0)
{
- if (mainWindow.drop_format.SelectedIndex == 0)
- mainWindow.SetExtension(".mp4");
- else
- mainWindow.drop_format.SelectedIndex = 0;
+ mainWindow.SetExtension(".mp4");
}
- else if (presetQuery.Format == "mkv")
+ else
{
- if (mainWindow.drop_format.SelectedIndex == 1)
- mainWindow.SetExtension(".mkv");
- else
- mainWindow.drop_format.SelectedIndex = 1;
+ mainWindow.drop_format.SelectedIndex = 0;
+ }
+ }
+ else if (presetQuery.OutputFormat == OutputFormat.Mkv)
+ {
+ if (mainWindow.drop_format.SelectedIndex == 1)
+ {
+ mainWindow.SetExtension(".mkv");
+ }
+ else
+ {
+ mainWindow.drop_format.SelectedIndex = 1;
}
}
- mainWindow.check_iPodAtom.CheckState = presetQuery.IpodAtom ? CheckState.Checked : CheckState.Unchecked;
+ mainWindow.check_iPodAtom.CheckState = presetQuery.IPod5GSupport ? CheckState.Checked : CheckState.Unchecked;
mainWindow.check_optimiseMP4.CheckState = presetQuery.OptimizeMP4
? CheckState.Checked
: CheckState.Unchecked;
- mainWindow.check_largeFile.CheckState = presetQuery.LargeMP4 ? CheckState.Checked : CheckState.Unchecked;
+ mainWindow.check_largeFile.CheckState = presetQuery.LargeFile ? CheckState.Checked : CheckState.Unchecked;
mainWindow.setContainerOpts(); // select the container options according to the selected format
@@ -82,104 +85,150 @@ namespace Handbrake.Functions #region Picture
mainWindow.PictureSettings.check_autoCrop.Checked = true;
- if (presetQuery.CropValues != null)
+ if (presetQuery.IsCustomCropping)
{
- int top, bottom, left, right;
- int.TryParse(presetQuery.CropTop, out top);
- int.TryParse(presetQuery.CropBottom, out bottom);
- int.TryParse(presetQuery.CropLeft, out left);
- int.TryParse(presetQuery.CropRight, out right);
-
mainWindow.PictureSettings.check_customCrop.Checked = true;
- mainWindow.PictureSettings.crop_top.Value = top;
- mainWindow.PictureSettings.crop_bottom.Value = bottom;
- mainWindow.PictureSettings.crop_left.Value = left;
- mainWindow.PictureSettings.crop_right.Value = right;
+ mainWindow.PictureSettings.crop_top.Value = presetQuery.Cropping.Top;
+ mainWindow.PictureSettings.crop_bottom.Value = presetQuery.Cropping.Bottom;
+ mainWindow.PictureSettings.crop_left.Value = presetQuery.Cropping.Left;
+ mainWindow.PictureSettings.crop_right.Value = presetQuery.Cropping.Right;
}
// Set the anamorphic mode 0,1,2,3
- mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = presetQuery.AnamorphicMode;
+
+ switch (presetQuery.Anamorphic)
+ {
+ case Anamorphic.None:
+ mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 0;
+ break;
+ case Anamorphic.Strict:
+ mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 1;
+ break;
+ case Anamorphic.Loose:
+ mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 2;
+ break;
+ case Anamorphic.Custom:
+ mainWindow.PictureSettings.drp_anamorphic.SelectedIndex = 3;
+ break;
+ }
// Keep Aspect Ration Anamorphic Setting.
- mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.KeepDisplayAsect
+ mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.KeepDisplayAspect
? CheckState.Checked
: CheckState.Unchecked;
// Set the Width and height as Required.
if (presetQuery.Width != 0)
+ {
mainWindow.PictureSettings.text_width.Value = presetQuery.Width;
+ }
if (presetQuery.Height != 0)
+ {
mainWindow.PictureSettings.text_height.Value = presetQuery.Height;
+ }
// Max Width/Height override Width/Height
if (presetQuery.MaxWidth != 0)
+ {
mainWindow.PictureSettings.text_width.Value = presetQuery.MaxWidth;
+ }
if (presetQuery.MaxHeight != 0)
+ {
mainWindow.PictureSettings.text_height.Value = presetQuery.MaxHeight;
+ }
mainWindow.PictureSettings.PresetMaximumResolution = new Size(presetQuery.MaxWidth, presetQuery.MaxHeight);
// Case where both height and max height are 0 - For built-in presets
if (presetQuery.MaxHeight == 0 && presetQuery.Height == 0)
+ {
mainWindow.PictureSettings.text_height.Value = 0;
+ }
if (presetQuery.MaxWidth == 0 && presetQuery.Width == 0)
+ {
if (mainWindow.selectedTitle != null && mainWindow.selectedTitle.Resolution.Width != 0)
+ {
mainWindow.PictureSettings.text_width.Value = mainWindow.selectedTitle.Resolution.Width;
+ }
+ }
// Aspect Ratio for non anamorphic sources
- if (presetQuery.AnamorphicMode == 0)
+ if (presetQuery.Anamorphic == Anamorphic.None)
+ {
mainWindow.PictureSettings.check_KeepAR.CheckState = presetQuery.Height == 0
? CheckState.Checked
: CheckState.Unchecked;
+ }
// Custom Anamorphic Controls
- mainWindow.PictureSettings.updownDisplayWidth.Text = presetQuery.DisplayWidthValue.ToString();
- mainWindow.PictureSettings.updownParHeight.Text = presetQuery.PixelAspectHeight.ToString();
- mainWindow.PictureSettings.updownParWidth.Text = presetQuery.PixelAspectWidth.ToString();
- mainWindow.PictureSettings.drp_modulus.SelectedItem = presetQuery.AnamorphicModulus.ToString();
+ mainWindow.PictureSettings.updownDisplayWidth.Text = presetQuery.DisplayWidth.ToString();
+ mainWindow.PictureSettings.updownParHeight.Text = presetQuery.PixelAspectY.ToString();
+ mainWindow.PictureSettings.updownParWidth.Text = presetQuery.PixelAspectX.ToString();
+ mainWindow.PictureSettings.drp_modulus.SelectedItem = presetQuery.Modulus.ToString();
#endregion
#region Filters
- mainWindow.Filters.SetDecomb(presetQuery.Decomb);
- mainWindow.Filters.SetDeInterlace(presetQuery.DeInterlace);
- mainWindow.Filters.SetDeNoise(presetQuery.DeNoise);
- mainWindow.Filters.SetDeTelecine(presetQuery.DeTelecine);
- mainWindow.Filters.SetDeBlock(presetQuery.DeBlock);
+ mainWindow.Filters.SetDecomb(presetQuery.Decomb, presetQuery.CustomDecomb);
+ mainWindow.Filters.SetDeInterlace(presetQuery.Deinterlace, presetQuery.CustomDeinterlace);
+ mainWindow.Filters.SetDeNoise(presetQuery.Denoise, presetQuery.CustomDenoise);
+ mainWindow.Filters.SetDeTelecine(presetQuery.Detelecine, presetQuery.CustomDetelecine);
+ mainWindow.Filters.SetDeBlock(presetQuery.Deblock);
mainWindow.Filters.SetGrayScale(presetQuery.Grayscale);
#endregion
#region Video
- mainWindow.drp_videoEncoder.Text = presetQuery.VideoEncoder;
+ switch (presetQuery.VideoEncoder)
+ {
+ case VideoEncoder.X264:
+ mainWindow.drp_videoEncoder.SelectedIndex = 1;
+ break;
+ case VideoEncoder.FFMpeg:
+ mainWindow.drp_videoEncoder.SelectedIndex = 0;
+ break;
+ case VideoEncoder.Theora:
+ mainWindow.drp_videoEncoder.SelectedIndex = 2;
+ break;
+ }
- if (presetQuery.AverageVideoBitrate != null)
+ if (presetQuery.VideoBitrate != null)
{
mainWindow.radio_avgBitrate.Checked = true;
- mainWindow.text_bitrate.Text = presetQuery.AverageVideoBitrate;
+ mainWindow.text_bitrate.Text = presetQuery.VideoBitrate.ToString();
}
- if (presetQuery.VideoTargetSize != null)
+
+ if (presetQuery.TargetSize != null)
{
mainWindow.radio_targetFilesize.Checked = true;
- mainWindow.text_filesize.Text = presetQuery.VideoTargetSize;
+ mainWindow.text_filesize.Text = presetQuery.TargetSize.ToString();
}
// Quality
- if (presetQuery.VideoQuality != -1)
+ if (presetQuery.Quality != null)
{
mainWindow.radio_cq.Checked = true;
- mainWindow.slider_videoQuality.Value = QualityToSliderValue(presetQuery.VideoEncoder, presetQuery.VideoQuality);
+ mainWindow.slider_videoQuality.Value = QualityToSliderValue(
+ presetQuery.VideoEncoder, presetQuery.Quality);
}
mainWindow.check_2PassEncode.CheckState = presetQuery.TwoPass ? CheckState.Checked : CheckState.Unchecked;
- mainWindow.drp_videoFramerate.Text = presetQuery.VideoFramerate;
- mainWindow.checkMaximumFramerate.Checked = presetQuery.Pfr;
+ if (presetQuery.Framerate != null)
+ {
+ mainWindow.drp_videoFramerate.Text = presetQuery.Framerate.ToString();
+ }
+ else
+ {
+ mainWindow.drp_videoFramerate.SelectedIndex = 0;
+ }
+
+ mainWindow.checkMaximumFramerate.Checked = presetQuery.FramerateMode == FramerateMode.PFR;
mainWindow.check_turbo.CheckState = presetQuery.TurboFirstPass ? CheckState.Checked : CheckState.Unchecked;
@@ -187,25 +236,27 @@ namespace Handbrake.Functions #region Chapter Markers
- if (presetQuery.ChapterMarkers)
+ if (presetQuery.IncludeChapterMarkers)
{
mainWindow.Check_ChapterMarkers.CheckState = CheckState.Checked;
mainWindow.Check_ChapterMarkers.Enabled = true;
}
else
+ {
mainWindow.Check_ChapterMarkers.CheckState = CheckState.Unchecked;
+ }
#endregion
#region Audio
- mainWindow.AudioSettings.LoadTracks(presetQuery.AudioInformation);
+ mainWindow.AudioSettings.LoadTracks(presetQuery.AudioTracks);
#endregion
#region Other
- mainWindow.x264Panel.X264Query = presetQuery.H264Query;
+ mainWindow.x264Panel.X264Query = presetQuery.X264Options;
// Set the preset name
mainWindow.labelPreset.Text = "Output Settings (Preset: " + name + ")";
@@ -219,19 +270,25 @@ namespace Handbrake.Functions /// <param name="videoEncoder">The selected video encoder</param>
/// <param name="value">The Quality value</param>
/// <returns>The position on the video quality slider</returns>
- private static int QualityToSliderValue(string videoEncoder, float value)
+ private static int QualityToSliderValue(VideoEncoder videoEncoder, double? value)
{
+ if (!value.HasValue)
+ {
+ // Default to a sensible level.
+ return 20;
+ }
+
int sliderValue = 0;
switch (videoEncoder)
{
- case "MPEG-4 (FFmpeg)":
+ case VideoEncoder.FFMpeg:
sliderValue = 32 - (int)value;
break;
- case "H.264 (x264)":
+ case VideoEncoder.X264:
double cqStep = Properties.Settings.Default.x264cqstep;
sliderValue = (int)((51.0 / cqStep) - (value / cqStep));
break;
- case "VP3 (Theora)":
+ case VideoEncoder.Theora:
sliderValue = (int)value;
break;
}
diff --git a/win/C#/HandBrake10.5.1.ReSharper b/win/C#/HandBrake10.5.1.ReSharper index 70de4715c..da45302cf 100644 --- a/win/C#/HandBrake10.5.1.ReSharper +++ b/win/C#/HandBrake10.5.1.ReSharper @@ -89,6 +89,7 @@ <Abbreviation Text="CLI" />
<Abbreviation Text="MP" />
<Abbreviation Text="II" />
+ <Abbreviation Text="GUI" />
</Naming2>
<CustomMemberReorderingPatterns><![CDATA[<?xml version="1.0" encoding="utf-8"?>
<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns">
diff --git a/win/C#/frmMain.cs b/win/C#/frmMain.cs index 95e7ce746..b9255ee48 100644 --- a/win/C#/frmMain.cs +++ b/win/C#/frmMain.cs @@ -172,7 +172,7 @@ namespace Handbrake {
x264Panel.Reset2Defaults();
- QueryParserUtility presetQuery = QueryParserUtility.Parse(query);
+ EncodeTask presetQuery = QueryParserUtility.Parse(query);
PresetLoader.LoadPreset(this, presetQuery, Settings.Default.defaultPreset);
x264Panel.StandardizeOptString();
@@ -900,7 +900,7 @@ namespace Handbrake x264Panel.Reset2Defaults();
// Send the query from the file to the Query Parser class
- QueryParserUtility presetQuery = QueryParserUtility.Parse(query);
+ EncodeTask presetQuery = QueryParserUtility.Parse(query);
// Now load the preset
PresetLoader.LoadPreset(this, presetQuery, presetName);
@@ -939,7 +939,7 @@ namespace Handbrake {
if (openPreset.ShowDialog() == DialogResult.OK)
{
- QueryParserUtility parsed = PlistPresetHandler.Import(openPreset.FileName);
+ EncodeTask parsed = PlistPresetHandler.Import(openPreset.FileName);
if (presetHandler.CheckIfUserPresetExists(parsed.PresetName + " (Imported)"))
{
DialogResult result =
@@ -2238,7 +2238,7 @@ namespace Handbrake if (queueEdit.Query != null)
{
// Send the query from the file to the Query Parser class
- QueryParserUtility presetQuery = QueryParserUtility.Parse(queueEdit.Query);
+ EncodeTask presetQuery = QueryParserUtility.Parse(queueEdit.Query);
// Now load the preset
PresetLoader.LoadPreset(this, presetQuery, "Load Back From Queue");
diff --git a/win/C#/frmQueue.cs b/win/C#/frmQueue.cs index 1ccda8139..d715d8970 100644 --- a/win/C#/frmQueue.cs +++ b/win/C#/frmQueue.cs @@ -324,31 +324,46 @@ namespace Handbrake foreach (QueueTask queueItem in theQueue)
{
string qItem = queueItem.Query;
- QueryParserUtility parsed = QueryParserUtility.Parse(qItem);
+ EncodeTask parsed = QueryParserUtility.Parse(qItem);
// Get the DVD Title
string title = parsed.Title == 0 ? "Auto" : parsed.Title.ToString();
// Get the DVD Chapters
string chapters;
- if (parsed.ChapterStart == 0)
+ if (parsed.StartPoint == 0)
chapters = "Auto";
else
{
- chapters = parsed.ChapterStart.ToString();
- if (parsed.ChapterFinish != 0)
- chapters = chapters + " - " + parsed.ChapterFinish;
+ chapters = parsed.StartPoint.ToString();
+ if (parsed.EndPoint != 0)
+ chapters = chapters + " - " + parsed.EndPoint;
}
ListViewItem item = new ListViewItem { Tag = queueItem, Text = title };
item.SubItems.Add(chapters); // Chapters
item.SubItems.Add(queueItem.Source); // Source
item.SubItems.Add(queueItem.Destination); // Destination
- item.SubItems.Add(parsed.VideoEncoder); // Video
+
+ switch (parsed.VideoEncoder)
+ {
+ case VideoEncoder.FFMpeg:
+ item.SubItems.Add("MPEG-4 (FFmpeg)");
+ break;
+ default:
+ case VideoEncoder.X264:
+ item.SubItems.Add("H.264 (x264)");
+ break;
+ case VideoEncoder.Theora:
+ item.SubItems.Add("VP3 (Theroa)");
+ break;
+ }
+
+ // Video
// Display The Audio Track Information
string audio = string.Empty;
- foreach (AudioTrack track in parsed.AudioInformation)
+ foreach (AudioTrack track in parsed.AudioTracks)
{
if (audio != string.Empty)
audio += ", " + track.Encoder;
@@ -388,24 +403,24 @@ namespace Handbrake BeginInvoke(new UpdateHandler(SetCurrentEncodeInformation));
}
- QueryParserUtility parsed = QueryParserUtility.Parse(queue.QueueManager.LastProcessedJob.Query);
+ EncodeTask parsed = QueryParserUtility.Parse(queue.QueueManager.LastProcessedJob.Query);
// Get title and chapters
string title = parsed.Title == 0 ? "Auto" : parsed.Title.ToString();
string chapterlbl;
- if (Equals(parsed.ChapterStart, 0))
+ if (Equals(parsed.StartPoint, 0))
chapterlbl = "Auto";
else
{
- string chapters = parsed.ChapterStart.ToString();
- if (parsed.ChapterFinish != 0)
- chapters = chapters + " - " + parsed.ChapterFinish;
+ string chapters = parsed.StartPoint.ToString();
+ if (parsed.EndPoint != 0)
+ chapters = chapters + " - " + parsed.EndPoint;
chapterlbl = chapters;
}
// Get audio information
string audio = string.Empty;
- foreach (AudioTrack track in parsed.AudioInformation)
+ foreach (AudioTrack track in parsed.AudioTracks)
{
if (audio != string.Empty)
audio += ", " + track.Encoder;
@@ -418,7 +433,7 @@ namespace Handbrake lbl_source.Text = queue.QueueManager.LastProcessedJob.Source + "(Title: " + title + " Chapters: " + chapterlbl + ")";
lbl_dest.Text = queue.QueueManager.LastProcessedJob.Destination;
lbl_encodeOptions.Text = "Video: " + parsed.VideoEncoder + " Audio: " + audio + Environment.NewLine +
- "x264 Options: " + parsed.H264Query;
+ "x264 Options: " + parsed.X264Options;
}
catch (Exception)
{
|