summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-03-01 19:01:54 +0000
committersr55 <[email protected]>2012-03-01 19:01:54 +0000
commit2efd8f264113bcd3d8c39a1f408c16cc27100aa7 (patch)
treeaedb1cc0017839a91bdc80c46819332b76a975f9
parent5bb4078641106578dd0a8e1eab6e1cfbc814067e (diff)
WinGui: (WPF) Further work wiring up the new UI.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4479 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs90
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs1
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs19
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs13
-rw-r--r--win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs30
-rw-r--r--win/CS/HandBrake.ApplicationServices/Parsing/Title.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Services/ScanService.cs2
-rw-r--r--win/CS/HandBrake.Interop/HandBrakeInterop/Model/Cropping.cs51
-rw-r--r--win/CS/HandBrakeWPF/Converters/AudioEnumConverter.cs83
-rw-r--r--win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs155
-rw-r--r--win/CS/HandBrakeWPF/Converters/FullPathToFileNameConverter.cs5
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj14
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs86
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs40
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs17
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs10
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs19
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs42
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs50
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs230
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs13
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs11
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs263
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml47
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml19
-rw-r--r--win/CS/HandBrakeWPF/Views/ChaptersView.xaml3
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml1
-rw-r--r--win/CS/HandBrakeWPF/Views/QueueView.xaml9
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml12
-rw-r--r--win/CS/frmMain.Designer.cs165
-rw-r--r--win/CS/frmMain.cs1
-rw-r--r--win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.XML270
-rw-r--r--win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dllbin0 -> 29184 bytes
40 files changed, 1315 insertions, 572 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
index 6f3500d9e..16d8d1694 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/EncodeTask.cs
@@ -33,6 +33,96 @@ namespace HandBrake.ApplicationServices.Model
}
#region Source
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="EncodeTask"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="task">
+ /// The task.
+ /// </param>
+ public EncodeTask(EncodeTask task)
+ {
+ this.AdvancedEncoderOptions = task.AdvancedEncoderOptions;
+ this.AllowedPassthruOptions = new AllowedPassthru(task.AllowedPassthruOptions);
+ this.Anamorphic = task.Anamorphic;
+ this.Angle = task.Angle;
+
+ this.AudioTracks = new ObservableCollection<AudioTrack>();
+ foreach (AudioTrack track in task.AudioTracks)
+ {
+ this.AudioTracks.Add(new AudioTrack(track));
+ }
+
+
+ this.ChapterNames = new ObservableCollection<ChapterMarker>();
+ foreach (ChapterMarker track in task.ChapterNames)
+ {
+ this.ChapterNames.Add(new ChapterMarker(track));
+ }
+
+ this.ChapterMarkersFilePath = task.ChapterMarkersFilePath;
+ this.Cropping = new Cropping(task.Cropping);
+ this.CustomDecomb = task.CustomDecomb;
+ this.CustomDeinterlace = task.CustomDeinterlace;
+ this.CustomDenoise = task.CustomDenoise;
+ this.CustomDetelecine = task.CustomDetelecine;
+ this.Deblock = task.Deblock;
+ this.Decomb = task.Decomb;
+ this.Deinterlace = task.Deinterlace;
+ this.Denoise = task.Denoise;
+ this.Destination = task.Destination;
+ this.Detelecine = task.Detelecine;
+ this.DisableLibDvdNav = task.DisableLibDvdNav;
+ this.DisplayWidth = task.DisplayWidth;
+ this.EndPoint = task.EndPoint;
+ this.Framerate = task.Framerate;
+ this.FramerateMode = task.FramerateMode;
+ this.Grayscale = task.Grayscale;
+ this.HasCropping = task.HasCropping;
+ this.Height = task.Height;
+ this.IncludeChapterMarkers = task.IncludeChapterMarkers;
+ this.IPod5GSupport = task.IPod5GSupport;
+ this.KeepDisplayAspect = task.KeepDisplayAspect;
+ this.LargeFile = task.LargeFile;
+ this.MaxHeight = task.MaxHeight;
+ this.MaxWidth = task.MaxWidth;
+ this.Modulus = task.Modulus;
+ this.OptimizeMP4 = task.OptimizeMP4;
+ this.OutputFormat = task.OutputFormat;
+ this.PixelAspectX = task.PixelAspectX;
+ this.PixelAspectY = task.PixelAspectY;
+ this.PointToPointMode = task.PointToPointMode;
+ this.PresetBuildNumber = task.PresetBuildNumber;
+ this.PresetDescription = task.PresetDescription;
+ this.PresetName = task.PresetName;
+ this.Quality = task.Quality;
+ this.Source = task.Source;
+ this.StartPoint = task.StartPoint;
+
+ this.SubtitleTracks = new ObservableCollection<SubtitleTrack>();
+ foreach (SubtitleTrack subtitleTrack in task.SubtitleTracks)
+ {
+ this.SubtitleTracks.Add(new SubtitleTrack(subtitleTrack));
+ }
+
+ this.Title = task.Title;
+ this.TurboFirstPass = task.TurboFirstPass;
+ this.TwoPass = task.TwoPass;
+ this.Type = task.Type;
+ this.UsesMaxPictureSettings = task.UsesMaxPictureSettings;
+ this.UsesPictureFilters = task.UsesPictureFilters;
+ this.UsesPictureSettings = task.UsesPictureSettings;
+ this.Verbosity = task.Verbosity;
+ this.VideoBitrate = task.VideoBitrate;
+ this.VideoEncoder = task.VideoEncoder;
+ this.VideoEncodeRateType = task.VideoEncodeRateType;
+ this.Width = task.Width;
+ this.x264Preset = task.x264Preset;
+ this.x264Profile = task.x264Profile;
+ this.X264Tune = task.X264Tune;
+ }
+
/// <summary>
/// Gets or sets Source.
/// </summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
index a892eb119..4b86fc9a1 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AllowedPassthru.cs
@@ -43,6 +43,7 @@ namespace HandBrake.ApplicationServices.Model.Encoding
/// <summary>
/// Initializes a new instance of the <see cref="AllowedPassthru"/> class.
+ /// Copy Constructor
/// </summary>
/// <param name="initialValue">
/// The initial value.
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
index 3ef786629..4d05591c5 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/AudioTrack.cs
@@ -83,6 +83,25 @@ namespace HandBrake.ApplicationServices.Model.Encoding
this.ScannedTrack = new Audio();
}
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioTrack"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="track">
+ /// The track.
+ /// </param>
+ public AudioTrack(AudioTrack track)
+ {
+ this.bitrate = track.Bitrate;
+ this.drc = track.DRC;
+ this.encoder = track.Encoder;
+ this.gain = track.Gain;
+ this.mixDown = track.MixDown;
+ this.sampleRate = track.SampleRate;
+ this.scannedTrack = new Audio();
+ this.trackName = track.TrackName;
+ }
+
#endregion
#region Public Properties
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs
index 8fb1a5920..88f99008c 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/ChapterMarker.cs
@@ -33,6 +33,19 @@ namespace HandBrake.ApplicationServices.Model.Encoding
}
/// <summary>
+ /// Initializes a new instance of the <see cref="ChapterMarker"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="chapter">
+ /// The chapter.
+ /// </param>
+ public ChapterMarker(ChapterMarker chapter)
+ {
+ this.ChapterName = chapter.ChapterName;
+ this.ChapterNumber = chapter.ChapterNumber;
+ }
+
+ /// <summary>
/// Gets or sets The number of this Chapter, in regards to it's parent Title
/// </summary>
public int ChapterNumber { get; set; }
diff --git a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
index fa7dfd10e..9ad24a1f9 100644
--- a/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
+++ b/win/CS/HandBrake.ApplicationServices/Model/Encoding/SubtitleTrack.cs
@@ -28,8 +28,38 @@ namespace HandBrake.ApplicationServices.Model.Encoding
#endregion
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitleTrack"/> class.
+ /// </summary>
+ public SubtitleTrack()
+ {
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitleTrack"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="subtitle">
+ /// The subtitle.
+ /// </param>
+ public SubtitleTrack(SubtitleTrack subtitle)
+ {
+ this.Burned = subtitle.Burned;
+ this.Default = subtitle.Default;
+ this.Forced = subtitle.Forced;
+ this.sourceTrack = subtitle.SourceTrack;
+ this.SrtCharCode = subtitle.SrtCharCode;
+ this.SrtFileName = subtitle.SrtFileName;
+ this.SrtLang = subtitle.SrtLang;
+ this.SrtOffset = subtitle.SrtOffset;
+ this.SrtPath = subtitle.SrtPath;
+ this.SubtitleType = subtitle.SubtitleType;
+ this.SourceTrack = subtitle.SourceTrack;
+ }
+
#region Public Properties
+
/// <summary>
/// Gets or sets a value indicating whether Burned.
/// </summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
index 4c800f24c..51c2f11c3 100644
--- a/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
+++ b/win/CS/HandBrake.ApplicationServices/Parsing/Title.cs
@@ -245,8 +245,6 @@ namespace HandBrake.ApplicationServices.Parsing
public TimeSpan CalculateDuration(int startPoint, int endPoint)
{
TimeSpan duration = TimeSpan.FromSeconds(0.0);
- startPoint++;
- endPoint++;
if (startPoint != 0 && endPoint != 0 && endPoint <= this.Chapters.Count)
{
for (int i = startPoint; i <= endPoint; i++)
diff --git a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
index 7c6192636..cc94a3f7d 100644
--- a/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
+++ b/win/CS/HandBrake.ApplicationServices/Services/ScanService.cs
@@ -259,7 +259,7 @@ namespace HandBrake.ApplicationServices.Services
this.readData = new Parser(this.hbProc.StandardError.BaseStream);
this.readData.OnScanProgress += this.OnScanProgress;
this.SouceData = Source.Parse(this.readData);
- this.SouceData.ScanPath = source;
+ this.SouceData.ScanPath = (string)sourcePath;
// Write the Buffer out to file.
using (StreamWriter scanLog = new StreamWriter(dvdInfoPath))
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Cropping.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Cropping.cs
index e13c9daff..8e6e6c1f5 100644
--- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Cropping.cs
+++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/Cropping.cs
@@ -9,7 +9,10 @@
namespace HandBrake.Interop.Model
{
- public class Cropping
+ /// <summary>
+ /// The Cropping Model
+ /// </summary>
+ public class Cropping
{
/// <summary>
/// Initializes a new instance of the <see cref="Cropping"/> class.
@@ -19,6 +22,21 @@ namespace HandBrake.Interop.Model
}
/// <summary>
+ /// Initializes a new instance of the <see cref="Cropping"/> class.
+ /// Copy Constructor
+ /// </summary>
+ /// <param name="croping">
+ /// The croping.
+ /// </param>
+ public Cropping(Cropping croping)
+ {
+ this.Top = croping.Top;
+ this.Bottom = croping.Bottom;
+ this.Left = croping.Left;
+ this.Right = croping.Right;
+ }
+
+ /// <summary>
/// Initializes a new instance of the <see cref="Cropping"/> class.
/// </summary>
/// <param name="top">
@@ -41,12 +59,33 @@ namespace HandBrake.Interop.Model
this.Right = right;
}
- public int Top { get; set; }
- public int Bottom { get; set; }
- public int Left { get; set; }
- public int Right { get; set; }
+ /// <summary>
+ /// Gets or sets Top.
+ /// </summary>
+ public int Top { get; set; }
- public Cropping Clone()
+ /// <summary>
+ /// Gets or sets Bottom.
+ /// </summary>
+ public int Bottom { get; set; }
+
+ /// <summary>
+ /// Gets or sets Left.
+ /// </summary>
+ public int Left { get; set; }
+
+ /// <summary>
+ /// Gets or sets Right.
+ /// </summary>
+ public int Right { get; set; }
+
+ /// <summary>
+ /// Clone this model
+ /// </summary>
+ /// <returns>
+ /// A Cloned copy
+ /// </returns>
+ public Cropping Clone()
{
return new Cropping
{
diff --git a/win/CS/HandBrakeWPF/Converters/AudioEnumConverter.cs b/win/CS/HandBrakeWPF/Converters/AudioEnumConverter.cs
deleted file mode 100644
index b53637bca..000000000
--- a/win/CS/HandBrakeWPF/Converters/AudioEnumConverter.cs
+++ /dev/null
@@ -1,83 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="BooleanToVisibilityConverter.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 BooleanToVisibilityConverter type.
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Converters
-{
- using System.Collections.Generic;
- using System.Globalization;
- using System.Windows.Data;
- using System;
-
- using HandBrake.ApplicationServices.Functions;
- using HandBrake.Interop.Model.Encoding;
-
- /// <summary>
- /// Boolean to Visibility Converter
- /// </summary>
- public sealed class AudioEnumConverter : IValueConverter
- {
- /// <summary>
- /// Convert an Enum to it's display value (attribute)
- /// </summary>
- /// <param name="value">
- /// The value.
- /// </param>
- /// <param name="targetType">
- /// The target type.
- /// </param>
- /// <param name="parameter">
- /// The parameter. (A boolean which inverts the output)
- /// </param>
- /// <param name="culture">
- /// The culture.
- /// </param>
- /// <returns>
- /// Visibility property
- /// </returns>
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is Mixdown)
- {
- return EnumHelper<Mixdown>.GetEnumDisplayValues(value.GetType());
- }
- else if (value is AudioEncoder)
- {
- return EnumHelper<AudioEncoder>.GetEnumDisplayValues(value.GetType());
- }
-
- return new List<string>();
- }
-
- /// <summary>
- /// Convert Back for the IValueConverter Interface. Not used!
- /// </summary>
- /// <param name="value">
- /// The value.
- /// </param>
- /// <param name="targetType">
- /// The target type.
- /// </param>
- /// <param name="parameter">
- /// The parameter.
- /// </param>
- /// <param name="culture">
- /// The culture.
- /// </param>
- /// <returns>
- /// Nothing
- /// </returns>
- /// <exception cref="NotImplementedException">
- /// This method is not used!
- /// </exception>
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
new file mode 100644
index 000000000..b5ee371b6
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Converters/EnumComboConverter.cs
@@ -0,0 +1,155 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="EnumComboConverter.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 EnumComboConverter type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Converters
+{
+ using System.Collections.Generic;
+ using System.Globalization;
+ using System.Windows.Data;
+ using System;
+
+ using HandBrake.ApplicationServices.Functions;
+ using HandBrake.Interop.Model.Encoding;
+ using HandBrake.Interop.Model.Encoding.x264;
+
+ /// <summary>
+ /// Enum Combo Converter
+ /// </summary>
+ public sealed class EnumComboConverter : IValueConverter
+ {
+ /// <summary>
+ /// Convert an Enum to it's display value (attribute)
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter. (A boolean which inverts the output)
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// Visibility property
+ /// </returns>
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ // Lists
+ if (value is IEnumerable<x264Preset>)
+ {
+ return EnumHelper<x264Preset>.GetEnumDisplayValues(typeof(x264Preset));
+ }
+ if (value is IEnumerable<x264Profile>)
+ {
+ return EnumHelper<x264Profile>.GetEnumDisplayValues(typeof(x264Profile));
+ }
+ if (value is IEnumerable<x264Tune>)
+ {
+ return EnumHelper<x264Tune>.GetEnumDisplayValues(typeof(x264Tune));
+ }
+ if (value is IEnumerable<VideoEncoder>)
+ {
+ return EnumHelper<VideoEncoder>.GetEnumDisplayValues(typeof(VideoEncoder));
+ }
+ if (value is IEnumerable<Mixdown>)
+ {
+ return EnumHelper<Mixdown>.GetEnumDisplayValues(typeof(Mixdown));
+ }
+
+ if (value is IEnumerable<AudioEncoder>)
+ {
+ return EnumHelper<AudioEncoder>.GetEnumDisplayValues(typeof(AudioEncoder));
+ }
+
+
+
+ // Single Items
+ if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
+ {
+ return EnumHelper<x264Preset>.GetDisplay((x264Preset)value);
+ }
+ if (targetType == typeof(x264Profile) || value.GetType() == typeof(x264Profile))
+ {
+ return EnumHelper<x264Profile>.GetDisplay((x264Profile)value);
+ }
+ if (targetType == typeof(x264Tune) || value.GetType() == typeof(x264Tune))
+ {
+ return EnumHelper<x264Tune>.GetDisplay((x264Tune)value);
+ }
+ if (targetType == typeof(VideoEncoder) || value.GetType() == typeof(VideoEncoder))
+ {
+ return EnumHelper<VideoEncoder>.GetDisplay((VideoEncoder)value);
+ }
+ if (targetType == typeof(Mixdown) || value.GetType() == typeof(Mixdown))
+ {
+ return EnumHelper<Mixdown>.GetDisplay((Mixdown)value);
+ }
+ if (targetType == typeof(AudioEncoder) || value.GetType() == typeof(AudioEncoder))
+ {
+ return EnumHelper<AudioEncoder>.GetDisplay((AudioEncoder)value);
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Convert Back for the IValueConverter Interface.
+ /// </summary>
+ /// <param name="value">
+ /// The value.
+ /// </param>
+ /// <param name="targetType">
+ /// The target type.
+ /// </param>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <param name="culture">
+ /// The culture.
+ /// </param>
+ /// <returns>
+ /// Nothing
+ /// </returns>
+ /// <exception cref="NotImplementedException">
+ /// This method is not used!
+ /// </exception>
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (targetType == typeof(x264Preset) || value.GetType() == typeof(x264Preset))
+ {
+ return EnumHelper<x264Preset>.GetValue(value.ToString());
+ }
+ if (targetType == typeof(x264Profile) || value.GetType() == typeof(x264Profile))
+ {
+ return EnumHelper<x264Profile>.GetValue(value.ToString());
+ }
+ if (targetType == typeof(x264Tune) || value.GetType() == typeof(x264Tune))
+ {
+ return EnumHelper<x264Tune>.GetValue(value.ToString());
+ }
+ if (targetType == typeof(VideoEncoder) || value.GetType() == typeof(VideoEncoder))
+ {
+ return EnumHelper<VideoEncoder>.GetValue(value.ToString());
+ }
+ if (targetType == typeof(Mixdown) || value.GetType() == typeof(Mixdown))
+ {
+ return EnumHelper<Mixdown>.GetValue(value.ToString());
+ }
+ if (targetType == typeof(AudioEncoder) || value.GetType() == typeof(AudioEncoder))
+ {
+ return EnumHelper<AudioEncoder>.GetValue(value.ToString());
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Converters/FullPathToFileNameConverter.cs b/win/CS/HandBrakeWPF/Converters/FullPathToFileNameConverter.cs
index b0f764ba8..fa659d232 100644
--- a/win/CS/HandBrakeWPF/Converters/FullPathToFileNameConverter.cs
+++ b/win/CS/HandBrakeWPF/Converters/FullPathToFileNameConverter.cs
@@ -39,9 +39,10 @@ namespace HandBrakeWPF.Converters
/// </returns>
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- if (!string.IsNullOrEmpty(value.ToString()))
+ string path = value as string;
+ if (!string.IsNullOrEmpty(path) && ! path.EndsWith("\\"))
{
- return Path.GetFileName(value.ToString());
+ return Path.GetFileName(path);
}
return "Unknown";
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index dbfd18f20..2b4a5f501 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -48,29 +48,24 @@
<Reference Include="Castle.Windsor">
<HintPath>..\libraries\caliburn\Castle.Windsor.dll</HintPath>
</Reference>
- <Reference Include="Common.Logging">
- <HintPath>..\libraries\caliburn\Common.Logging.dll</HintPath>
- </Reference>
<Reference Include="EagleBoost.Wpf.Presentation">
<HintPath>..\libraries\EagleBoost.Wpf.Presentation.dll</HintPath>
</Reference>
+ <Reference Include="GongSolutions.Wpf.DragDrop">
+ <HintPath>..\libraries\WPFDragDrop\GongSolutions.Wpf.DragDrop.dll</HintPath>
+ </Reference>
<Reference Include="Ookii.Dialogs.Wpf">
<HintPath>..\libraries\OokiiDialogs\Ookii.Dialogs.Wpf.dll</HintPath>
</Reference>
<Reference Include="PresentationFramework" />
- <Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
- <Reference Include="System.ComponentModel.DataAnnotations" />
- <Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\libraries\caliburn\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
- <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
- <Reference Include="System.Xml.Linq" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
@@ -84,7 +79,7 @@
</ApplicationDefinition>
<Compile Include="Converters\BooleanConverter.cs" />
<Compile Include="Converters\BooleanToVisibilityConverter.cs" />
- <Compile Include="Converters\AudioEnumConverter.cs" />
+ <Compile Include="Converters\EnumComboConverter.cs" />
<Compile Include="Converters\FullPathToFileNameConverter.cs" />
<Compile Include="Helpers\AutoNameHelper.cs" />
<Compile Include="Helpers\ListBoxHelper.cs" />
@@ -103,6 +98,7 @@
<Compile Include="ViewModels\AddPresetViewModel.cs" />
<Compile Include="ViewModels\AudioViewModel.cs" />
<Compile Include="ViewModels\AdvancedViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\ITabInterface.cs" />
<Compile Include="ViewModels\VideoViewModel.cs" />
<Compile Include="ViewModels\FiltersViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IFiltersViewModel.cs" />
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
index 60a82d94e..5428e6bb7 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
@@ -9,13 +9,16 @@
namespace HandBrakeWPF.ViewModels
{
+ using System.Collections.Generic;
using System.ComponentModel.Composition;
using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.Interop.Model.Encoding;
using HandBrake.Interop.Model.Encoding.x264;
using HandBrakeWPF.ViewModels.Interfaces;
@@ -48,6 +51,11 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private x264Tune x264Tune;
+ /// <summary>
+ /// Backing field used to display / hide the x264 options
+ /// </summary>
+ private bool displayX264Options;
+
#endregion
#region Constructors and Destructors
@@ -63,6 +71,13 @@ namespace HandBrakeWPF.ViewModels
/// </param>
public AdvancedViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
+ X264Presets = EnumHelper<x264Preset>.GetEnumList();
+ X264Profiles = EnumHelper<x264Profile>.GetEnumList();
+ X264Tunes = EnumHelper<x264Tune>.GetEnumList();
+
+ this.x264Preset = x264Preset.None;
+ this.x264Profile = x264Profile.None;
+ this.x264Tune = x264Tune.None;
}
#endregion
@@ -133,6 +148,37 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Gets or sets X264Presets.
+ /// </summary>
+ public IEnumerable<x264Preset> X264Presets { get; set; }
+
+ /// <summary>
+ /// Gets or sets X264Profiles.
+ /// </summary>
+ public IEnumerable<x264Profile> X264Profiles { get; set; }
+
+ /// <summary>
+ /// Gets or sets X264Tunes.
+ /// </summary>
+ public IEnumerable<x264Tune> X264Tunes { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether DisplayX264Options.
+ /// </summary>
+ public bool DisplayX264Options
+ {
+ get
+ {
+ return this.displayX264Options;
+ }
+ set
+ {
+ this.displayX264Options = value;
+ this.NotifyOfPropertyChange(() => this.DisplayX264Options);
+ }
+ }
+
#endregion
#region Public Methods
@@ -157,6 +203,46 @@ namespace HandBrakeWPF.ViewModels
this.X264Tune = preset.Task.X264Tune;
}
+ /// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ if (preset != null && preset.Task != null)
+ {
+ this.Query = preset.Task.AdvancedEncoderOptions;
+ this.SetEncoder(preset.Task.VideoEncoder);
+
+ this.X264Preset = preset.Task.x264Preset;
+ this.X264Profile = preset.Task.x264Profile;
+ this.X264Tune = preset.Task.X264Tune;
+ }
+ }
+
+ /// <summary>
+ /// Set the currently selected encoder.
+ /// </summary>
+ /// <param name="encoder">
+ /// The Video Encoder.
+ /// </param>
+ public void SetEncoder(VideoEncoder encoder)
+ {
+ if (encoder == VideoEncoder.X264)
+ {
+ this.DisplayX264Options = true;
+ }
+ else
+ {
+ this.x264Preset = x264Preset.None;
+ this.x264Profile = x264Profile.None;
+ this.x264Tune = x264Tune.None;
+ this.DisplayX264Options = false;
+ }
+ }
+
#endregion
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
index b27c14583..63c333db2 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -123,6 +123,46 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ if (preset != null && preset.Task != null)
+ {
+ // Store the previously selected tracks
+ List<Audio> selectedTracks = this.AudioTracks.Select(track => track.ScannedTrack).ToList();
+ this.AudioTracks.Clear();
+
+ // Add the tracks from the preset
+ foreach (AudioTrack track in preset.Task.AudioTracks)
+ {
+ this.AudioTracks.Add(new AudioTrack(track));
+ }
+
+ // Attempt to restore the previously selected tracks.
+ // or fallback to the first source track.
+ foreach (AudioTrack track in this.AudioTracks)
+ {
+ if (selectedTracks.Count != 0)
+ {
+ track.ScannedTrack = selectedTracks[0];
+ selectedTracks.RemoveAt(0);
+ }
+ else
+ {
+ if (this.SourceTracks != null)
+ {
+ track.ScannedTrack = this.SourceTracks.FirstOrDefault();
+ }
+ }
+ }
+ }
+ }
+
+ /// <summary>
/// Get Appropiate Bitrates for the selected encoder and mixdown.
/// </summary>
/// <param name="encoder">
diff --git a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
index c36a7bcef..0495b8fcc 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
@@ -217,6 +217,16 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ }
+
+ /// <summary>
/// Set the Source Chapters List
/// </summary>
/// <param name="sourceChapters">
@@ -229,10 +239,15 @@ namespace HandBrakeWPF.ViewModels
this.Chapters.Clear();
// Then Add new Chapter Markers.
+ int counter = 1;
+
foreach (Chapter chapter in this.SourceChapterList)
{
- var marker = new ChapterMarker(chapter.ChapterNumber, chapter.ChapterName);
+ string chapterName = string.IsNullOrEmpty(chapter.ChapterName) ? string.Format("Chapter {0}", counter) : chapter.ChapterName;
+ var marker = new ChapterMarker(chapter.ChapterNumber, chapterName);
this.Chapters.Add(marker);
+
+ counter += 1;
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
index 6dd4292e7..9cd9ce540 100644
--- a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
@@ -372,6 +372,16 @@ namespace HandBrakeWPF.ViewModels
/// </param>
public void SetSource(Title title, Preset preset, EncodeTask task)
{
+ }
+
+ /// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
if (preset != null)
{
// Properties
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
index dc43ac831..9114bea32 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
@@ -9,26 +9,19 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.Interop.Model.Encoding;
/// <summary>
/// The Advanced View Model Interface
/// </summary>
- public interface IAdvancedViewModel
+ public interface IAdvancedViewModel : ITabInterface
{
/// <summary>
- /// Set the selected preset
+ /// Set the currently selected encoder.
/// </summary>
- /// <param name="title">
- /// The title.
+ /// <param name="encoder">
+ /// The Video Encoder.
/// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title title, Preset preset, EncodeTask task);
+ void SetEncoder(VideoEncoder encoder);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs
index 2d38ab31c..e1d4328c6 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs
@@ -9,26 +9,10 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
-
/// <summary>
/// The Audio View Model Interface
/// </summary>
- public interface IAudioViewModel
+ public interface IAudioViewModel : ITabInterface
{
- /// <summary>
- /// Set the Source Title
- /// </summary>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title title, Preset preset, EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs
index 42820006a..8a6ee72c0 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs
@@ -9,26 +9,10 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
-
/// <summary>
/// The Chapters View Model Interface
/// </summary>
- public interface IChaptersViewModel
+ public interface IChaptersViewModel : ITabInterface
{
- /// <summary>
- /// Set the selected preset
- /// </summary>
- /// <param name="currentTitle">
- /// The current Title.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title currentTitle, Preset preset, EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs
index cf7d00474..ba7d1636e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs
@@ -9,26 +9,10 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
-
/// <summary>
/// The Filters View Model Interface
/// </summary>
- public interface IFiltersViewModel
+ public interface IFiltersViewModel : ITabInterface
{
- /// <summary>
- /// Setup a selected preset.
- /// </summary>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="preset">
- /// The Current Preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title title, Preset preset, EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs
index 293dc728a..2992a2b1f 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs
@@ -9,26 +9,10 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
-
/// <summary>
/// The Picture Settings View Model Interface
/// </summary>
- public interface IPictureSettingsViewModel
+ public interface IPictureSettingsViewModel : ITabInterface
{
- /// <summary>
- /// Setup the window after a scan.
- /// </summary>
- /// <param name="selectedTitle">
- /// The selected title.
- /// </param>
- /// <param name="currentPreset">
- /// The Current preset
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title selectedTitle, Preset currentPreset, EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs
index e45aec710..2b10089de 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs
@@ -9,26 +9,10 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
-
/// <summary>
/// The Subtiles View Model Interface
/// </summary>
- public interface ISubtitlesViewModel
+ public interface ISubtitlesViewModel : ITabInterface
{
- /// <summary>
- /// Set the selected preset
- /// </summary>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title title, Preset preset, EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs
new file mode 100644
index 000000000..6091b506a
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ITabInterface.cs
@@ -0,0 +1,42 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ITabInterface.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 ITabInterface type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Parsing;
+
+ /// <summary>
+ /// Common interface for all the main tab panels
+ /// </summary>
+ public interface ITabInterface
+ {
+ /// <summary>
+ /// Setup the window after a scan.
+ /// </summary>
+ /// <param name="selectedTitle">
+ /// The selected title.
+ /// </param>
+ /// <param name="currentPreset">
+ /// The Current preset
+ /// </param>
+ /// <param name="task">
+ /// The task.
+ /// </param>
+ void SetSource(Title selectedTitle, Preset currentPreset, EncodeTask task);
+
+ /// <summary>
+ /// Set the selected preset
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ void SetPreset(Preset preset);
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
index 229051812..d89e90ac6 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
@@ -9,26 +9,10 @@
namespace HandBrakeWPF.ViewModels.Interfaces
{
- using HandBrake.ApplicationServices.Model;
- using HandBrake.ApplicationServices.Parsing;
-
/// <summary>
/// The Video View Model Interface
/// </summary>
- public interface IVideoViewModel
+ public interface IVideoViewModel : ITabInterface
{
- /// <summary>
- /// Set the selected preset
- /// </summary>
- /// <param name="title">
- /// The title.
- /// </param>
- /// <param name="preset">
- /// The preset.
- /// </param>
- /// <param name="task">
- /// The task.
- /// </param>
- void SetSource(Title title, Preset preset, EncodeTask task);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index 420443a58..7d64cfb5e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -168,7 +168,6 @@ namespace HandBrakeWPF.ViewModels
this.WindowTitle = "HandBrake WPF Test Application";
this.CurrentTask = new EncodeTask();
this.ScannedSource = new Source();
- this.SelectedPreset = this.presetService.DefaultPreset;
// Setup Events
this.scanService.ScanStared += this.ScanStared;
@@ -283,7 +282,19 @@ namespace HandBrakeWPF.ViewModels
set
{
this.selectedPreset = value;
- this.NotifyOfPropertyChange("SelectedPreset");
+
+ if (this.SelectedPreset != null)
+ {
+ this.PictureSettingsViewModel.SetPreset(this.SelectedPreset);
+ this.VideoViewModel.SetPreset(this.SelectedPreset);
+ this.FiltersViewModel.SetPreset(this.SelectedPreset);
+ this.AudioViewModel.SetPreset(this.SelectedPreset);
+ this.SubtitleViewModel.SetPreset(this.SelectedPreset);
+ this.ChaptersViewModel.SetPreset(this.SelectedPreset);
+ this.AdvancedViewModel.SetPreset(this.SelectedPreset);
+ }
+
+ this.NotifyOfPropertyChange(() => this.SelectedPreset);
}
}
@@ -523,6 +534,8 @@ namespace HandBrakeWPF.ViewModels
this.CurrentTask.Destination = AutoNameHelper.AutoName(this.CurrentTask, this.SourceName);
this.NotifyOfPropertyChange("CurrentTask");
+ this.Duration = selectedTitle.Duration.ToString();
+
// Setup the tab controls
this.SetupTabs();
}
@@ -557,7 +570,8 @@ namespace HandBrakeWPF.ViewModels
set
{
this.CurrentTask.StartPoint = value;
- this.NotifyOfPropertyChange("SelectedStartPoint");
+ this.NotifyOfPropertyChange(() => this.SelectedStartPoint);
+ this.Duration = this.DurationCalculation();
}
}
@@ -573,7 +587,8 @@ namespace HandBrakeWPF.ViewModels
set
{
this.CurrentTask.EndPoint = value;
- this.NotifyOfPropertyChange("SelectedEndPoint");
+ this.NotifyOfPropertyChange(() => this.SelectedEndPoint);
+ this.Duration = this.DurationCalculation();
}
}
@@ -611,7 +626,6 @@ namespace HandBrakeWPF.ViewModels
}
}
-
#endregion
#region Load and Shutdown Handling
@@ -620,7 +634,7 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
public override void OnLoad()
{
- // TODO
+ this.SelectedPreset = this.presetService.DefaultPreset;
}
/// <summary>
@@ -1088,6 +1102,30 @@ namespace HandBrakeWPF.ViewModels
}
}
+ /// <summary>
+ /// Calculate the duration between the end and start point
+ /// </summary>
+ /// <returns>
+ /// The duration calculation.
+ /// </returns>
+ private string DurationCalculation()
+ {
+ double startEndDuration = this.SelectedEndPoint - this.SelectedStartPoint;
+ switch (this.SelectedPointToPoint)
+ {
+ case PointToPointMode.Chapters:
+ return this.SelectedTitle.CalculateDuration(this.SelectedStartPoint, this.SelectedEndPoint).ToString();
+ break;
+ case PointToPointMode.Seconds:
+ return TimeSpan.FromSeconds(startEndDuration).ToString();
+ case PointToPointMode.Frames:
+ startEndDuration = startEndDuration / selectedTitle.Fps;
+ return TimeSpan.FromSeconds(startEndDuration).ToString();
+ }
+
+ return "--:--:--";
+ }
+
#endregion
#region Event Handlers
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
index 6f741dea1..444208076 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -39,81 +39,16 @@ namespace HandBrakeWPF.ViewModels
#region Backing Fields
/// <summary>
- /// The crop bottom.
- /// </summary>
- private int cropBottom;
-
- /// <summary>
- /// The crop left.
- /// </summary>
- private int cropLeft;
-
- /// <summary>
- /// The crop right.
- /// </summary>
- private int cropRight;
-
- /// <summary>
- /// The crop top.
- /// </summary>
- private int cropTop;
-
- /// <summary>
/// The display size.
/// </summary>
private string displaySize;
/// <summary>
- /// The display width.
- /// </summary>
- private int displayWidth;
-
- /// <summary>
- /// The height.
- /// </summary>
- private int height;
-
- /// <summary>
- /// The is custom crop.
- /// </summary>
- private bool isCustomCrop;
-
- /// <summary>
- /// The maintain aspect ratio.
- /// </summary>
- private bool maintainAspectRatio;
-
- /// <summary>
- /// The par height.
- /// </summary>
- private int parHeight;
-
- /// <summary>
- /// The par width.
- /// </summary>
- private int parWidth;
-
- /// <summary>
- /// The selected anamorphic mode.
- /// </summary>
- private Anamorphic selectedAnamorphicMode;
-
- /// <summary>
- /// The selected modulus
- /// </summary>
- private int selectedModulus;
-
- /// <summary>
/// The source info.
/// </summary>
private string sourceInfo;
/// <summary>
- /// The width.
- /// </summary>
- private int width;
-
- /// <summary>
/// Backing field for show custom anamorphic controls
/// </summary>
private bool showCustomAnamorphicControls;
@@ -137,9 +72,6 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private Size sourceResolution;
- /// <summary>
- /// Source Aspect Ratio
- /// </summary>
private double sourceAspectRatio;
/// <summary>
@@ -161,6 +93,7 @@ namespace HandBrakeWPF.ViewModels
/// </param>
public PictureSettingsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
+ this.Task = new EncodeTask();
this.SelectedModulus = 16;
this.MaintainAspectRatio = true;
}
@@ -170,6 +103,11 @@ namespace HandBrakeWPF.ViewModels
#region Public Properties
/// <summary>
+ /// Gets or sets Task.
+ /// </summary>
+ public EncodeTask Task { get; set; }
+
+ /// <summary>
/// Gets AnamorphicModes.
/// </summary>
public IEnumerable<Anamorphic> AnamorphicModes
@@ -187,11 +125,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.cropBottom;
+ return this.Task.Cropping.Bottom;
}
set
{
- this.cropBottom = this.CorrectForModulus(this.cropBottom, value);
+ this.Task.Cropping.Bottom = this.CorrectForModulus(this.Task.Cropping.Bottom, value);
this.NotifyOfPropertyChange(() => this.CropBottom);
}
}
@@ -203,11 +141,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.cropLeft;
+ return this.Task.Cropping.Left;
}
set
{
- this.cropLeft = this.CorrectForModulus(this.cropLeft, value);
+ this.Task.Cropping.Left = this.CorrectForModulus(this.Task.Cropping.Left, value);
this.NotifyOfPropertyChange(() => this.CropLeft);
}
}
@@ -219,11 +157,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.cropRight;
+ return this.Task.Cropping.Right;
}
set
{
- this.cropRight = this.CorrectForModulus(this.cropRight, value);
+ this.Task.Cropping.Right = this.CorrectForModulus(this.Task.Cropping.Right, value);
this.NotifyOfPropertyChange(() => this.CropRight);
}
}
@@ -235,11 +173,12 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.cropTop;
+ return this.Task.Cropping.Top;
}
+
set
{
- this.cropTop = this.CorrectForModulus(this.cropTop, value);
+ this.Task.Cropping.Top = this.CorrectForModulus(this.Task.Cropping.Top, value);
this.NotifyOfPropertyChange(() => this.CropTop);
}
}
@@ -267,11 +206,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.displayWidth;
+ return this.Task.DisplayWidth.HasValue ? int.Parse(Math.Round(this.Task.DisplayWidth.Value, 0).ToString()) : 0;
}
set
{
- this.displayWidth = value;
+ this.Task.DisplayWidth = value;
this.CustomAnamorphicAdjust();
this.NotifyOfPropertyChange(() => this.DisplayWidth);
}
@@ -284,11 +223,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.isCustomCrop;
+ return this.Task.HasCropping;
}
set
{
- this.isCustomCrop = value;
+ this.Task.HasCropping = value;
this.NotifyOfPropertyChange(() => this.IsCustomCrop);
}
}
@@ -300,11 +239,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.maintainAspectRatio;
+ return this.Task.KeepDisplayAspect;
}
set
{
- this.maintainAspectRatio = value;
+ this.Task.KeepDisplayAspect = value;
this.WidthAdjust();
this.NotifyOfPropertyChange(() => this.MaintainAspectRatio);
}
@@ -328,11 +267,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.parHeight;
+ return this.Task.PixelAspectY;
}
set
{
- this.parHeight = value;
+ this.Task.PixelAspectY = value;
this.CustomAnamorphicAdjust();
this.NotifyOfPropertyChange(() => this.ParHeight);
}
@@ -345,11 +284,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.parWidth;
+ return this.Task.PixelAspectX;
}
set
{
- this.parWidth = value;
+ this.Task.PixelAspectX = value;
this.CustomAnamorphicAdjust();
this.NotifyOfPropertyChange(() => this.ParWidth);
}
@@ -362,11 +301,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.selectedAnamorphicMode;
+ return this.Task.Anamorphic;
}
set
{
- this.selectedAnamorphicMode = value;
+ this.Task.Anamorphic = value;
this.AnamorphicAdjust();
this.NotifyOfPropertyChange(() => this.SelectedAnamorphicMode);
}
@@ -375,15 +314,15 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Gets or sets SelectedModulus.
/// </summary>
- public int SelectedModulus
+ public int? SelectedModulus
{
get
{
- return this.selectedModulus;
+ return this.Task.Modulus;
}
set
{
- this.selectedModulus = value;
+ this.Task.Modulus = value;
this.ModulusAdjust();
this.NotifyOfPropertyChange(() => this.SelectedModulus);
}
@@ -412,11 +351,12 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.width;
+ return this.Task.Width.HasValue ? this.Task.Width.Value : 0;
}
+
set
{
- this.width = value;
+ this.Task.Width = value;
this.WidthAdjust();
this.NotifyOfPropertyChange(() => this.Width);
}
@@ -429,11 +369,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.height;
+ return this.Task.Height.HasValue ? this.Task.Height.Value : 0;
}
set
{
- this.height = value;
+ this.Task.Height = value;
this.HeightAdjust();
this.NotifyOfPropertyChange(() => this.Height);
}
@@ -525,6 +465,49 @@ namespace HandBrakeWPF.ViewModels
this.MaintainAspectRatio = true;
}
}
+
+ /// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ // TODO: These all need to be handled correctly.
+
+ if (Task.UsesMaxPictureSettings)
+ {
+ this.Task.MaxWidth = preset.Task.MaxWidth;
+ this.Task.MaxHeight = preset.Task.MaxHeight;
+ this.Task.Width = preset.Task.MaxWidth ?? 0;
+ this.Task.Height = preset.Task.MaxHeight ?? 0;
+ }
+ else
+ {
+ this.Task.Width = preset.Task.Width ?? 0;
+ this.Task.Height = preset.Task.Height ?? 0;
+ }
+
+ if (Task.Anamorphic == Anamorphic.Custom)
+ {
+ this.Task.DisplayWidth = preset.Task.DisplayWidth ?? 0;
+ this.Task.PixelAspectX = preset.Task.PixelAspectX;
+ this.Task.PixelAspectY = preset.Task.PixelAspectY;
+ }
+
+ this.Task.KeepDisplayAspect = preset.Task.KeepDisplayAspect;
+
+ if (this.Task.Modulus.HasValue)
+ {
+ this.Task.Modulus = preset.Task.Modulus;
+ }
+
+ if (preset.Task.HasCropping)
+ {
+ this.Task.Cropping = preset.Task.Cropping;
+ }
+ }
#endregion
/// <summary>
@@ -532,9 +515,10 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void WidthAdjust()
{
- if (this.width > this.sourceResolution.Width)
+ if (this.Width > this.sourceResolution.Width)
{
- this.width = this.sourceResolution.Width;
+ this.Task.Width = this.sourceResolution.Width;
+ this.NotifyOfPropertyChange(() => this.Task.Width);
}
switch (SelectedAnamorphicMode)
@@ -551,22 +535,22 @@ namespace HandBrakeWPF.ViewModels
double newHeight = ((double)this.Width * this.sourceResolution.Width * SourceAspect.Height * crop_height) /
(this.sourceResolution.Height * SourceAspect.Width * crop_width);
- this.height = (int)Math.Round(GetModulusValue(newHeight), 0);
+ this.Task.Height = (int)Math.Round(GetModulusValue(newHeight), 0);
this.NotifyOfPropertyChange("Height");
}
break;
case Anamorphic.Strict:
- this.width = 0;
- this.height = 0;
+ this.Task.Width = 0;
+ this.Task.Height = 0;
- this.NotifyOfPropertyChange("Width");
- this.NotifyOfPropertyChange("Height");
+ this.NotifyOfPropertyChange(() => this.Task.Width);
+ this.NotifyOfPropertyChange(() => this.Task.Height);
this.SetDisplaySize();
break;
case Anamorphic.Loose:
- this.height = 0;
- this.NotifyOfPropertyChange("Width");
- this.NotifyOfPropertyChange("Height");
+ this.Task.Height = 0;
+ this.NotifyOfPropertyChange(() => this.Task.Width);
+ this.NotifyOfPropertyChange(() => this.Task.Height);
this.SetDisplaySize();
break;
case Anamorphic.Custom:
@@ -580,9 +564,10 @@ namespace HandBrakeWPF.ViewModels
/// </summary>
private void HeightAdjust()
{
- if (this.height > this.sourceResolution.Height)
+ if (this.Height > this.sourceResolution.Height)
{
- this.height = this.sourceResolution.Height;
+ this.Task.Height = this.sourceResolution.Height;
+ this.NotifyOfPropertyChange(() => this.Task.Height);
}
switch (SelectedAnamorphicMode)
@@ -596,8 +581,8 @@ namespace HandBrakeWPF.ViewModels
double new_width = ((double)this.Height * this.sourceResolution.Height * SourceAspect.Width * crop_width) /
(this.sourceResolution.Width * SourceAspect.Height * crop_height);
- this.Width = (int)Math.Round(GetModulusValue(new_width), 0);
- this.NotifyOfPropertyChange("Width");
+ this.Task.Width = (int)Math.Round(GetModulusValue(new_width), 0);
+ this.NotifyOfPropertyChange(() => this.Task.Width);
}
break;
case Anamorphic.Custom:
@@ -647,8 +632,8 @@ namespace HandBrakeWPF.ViewModels
this.HeightControlEnabled = false;
this.ShowCustomAnamorphicControls = false;
- this.width = 0;
- this.height = 0;
+ this.Width = 0;
+ this.Height = 0;
this.NotifyOfPropertyChange(() => Width);
this.NotifyOfPropertyChange(() => Height);
this.SetDisplaySize();
@@ -659,8 +644,8 @@ namespace HandBrakeWPF.ViewModels
this.HeightControlEnabled = false;
this.ShowCustomAnamorphicControls = false;
- this.width = this.sourceResolution.Width;
- this.height = 0;
+ this.Width = this.sourceResolution.Width;
+ this.Height = 0;
this.NotifyOfPropertyChange(() => Width);
this.NotifyOfPropertyChange(() => Height);
this.SetDisplaySize();
@@ -671,14 +656,14 @@ namespace HandBrakeWPF.ViewModels
this.HeightControlEnabled = true;
this.ShowCustomAnamorphicControls = true;
- this.width = this.sourceResolution.Width;
- this.height = 0;
+ this.Width = this.sourceResolution.Width;
+ this.Height = 0;
this.NotifyOfPropertyChange(() => Width);
this.NotifyOfPropertyChange(() => Height);
- this.displayWidth = this.CalculateAnamorphicSizes().Width;
- this.parWidth = this.sourceParValues.Width;
- this.parHeight = this.sourceParValues.Height;
+ this.DisplayWidth = this.CalculateAnamorphicSizes().Width;
+ this.ParWidth = this.sourceParValues.Width;
+ this.ParHeight = this.sourceParValues.Height;
this.NotifyOfPropertyChange(() => ParHeight);
this.NotifyOfPropertyChange(() => ParWidth);
this.NotifyOfPropertyChange(() => DisplayWidth);
@@ -798,12 +783,17 @@ namespace HandBrakeWPF.ViewModels
/// </returns>
private double GetModulusValue(double value)
{
- double remainder = value % this.SelectedModulus;
+ if (this.SelectedModulus == null)
+ {
+ return 0;
+ }
+
+ double remainder = value % this.SelectedModulus.Value;
if (remainder == 0)
return value;
- return remainder >= ((double)this.SelectedModulus / 2) ? value + (this.SelectedModulus - remainder) : value - remainder;
+ return remainder >= ((double)this.SelectedModulus.Value / 2) ? value + (this.SelectedModulus.Value - remainder) : value - remainder;
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index 45ea7862b..7c3d79994 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -9,15 +9,18 @@
namespace HandBrakeWPF.ViewModels
{
- using System.Windows;
- using HandBrake.ApplicationServices.Model;
- using Services.Interfaces;
using System.Collections.ObjectModel;
- using HandBrake.ApplicationServices.Services.Interfaces;
using System.ComponentModel.Composition;
- using Interfaces;
+ using System.Windows;
+
using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.Services.Interfaces;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
/// <summary>
/// The Preview View Model
/// </summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
index 4b0a0af9b..13aabe5e8 100644
--- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -189,6 +189,17 @@ namespace HandBrakeWPF.ViewModels
this.SubtitleTracks = task.SubtitleTracks;
}
+ /// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ // We don't currently support subtitles within presets.
+ }
+
#endregion
}
} \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
index 842e109d1..81b1ec6eb 100644
--- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -9,13 +9,16 @@
namespace HandBrakeWPF.ViewModels
{
+ using System;
using System.Collections.Generic;
using System.ComponentModel.Composition;
using Caliburn.Micro;
+ using HandBrake.ApplicationServices;
using HandBrake.ApplicationServices.Functions;
using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Parsing;
using HandBrake.ApplicationServices.Services.Interfaces;
using HandBrake.Interop.Model.Encoding;
@@ -29,41 +32,10 @@ namespace HandBrakeWPF.ViewModels
public class VideoViewModel : ViewModelBase, IVideoViewModel
{
#region Constants and Fields
-
- /// <summary>
- /// The average bitrate.
- /// </summary>
- private int averageBitrate;
-
- /// <summary>
- /// The is constant framerate.
- /// </summary>
- private bool isConstantFramerate;
-
/// <summary>
- /// The is constant quantity.
+ /// Backing field for the user setting service.
/// </summary>
- private bool isConstantQuantity;
-
- /// <summary>
- /// The is peak framerate.
- /// </summary>
- private bool isPeakFramerate;
-
- /// <summary>
- /// The is turbo first pass.
- /// </summary>
- private bool isTurboFirstPass;
-
- /// <summary>
- /// The is two pass.
- /// </summary>
- private bool isTwoPass;
-
- /// <summary>
- /// The is variable framerate.
- /// </summary>
- private bool isVariableFramerate;
+ private IUserSettingService userSettingService;
/// <summary>
/// The quality max.
@@ -76,24 +48,14 @@ namespace HandBrakeWPF.ViewModels
private int qualityMin;
/// <summary>
- /// The rf.
- /// </summary>
- private int rf;
-
- /// <summary>
- /// The selected framerate.
- /// </summary>
- private double? selectedFramerate;
-
- /// <summary>
- /// The selected video encoder.
+ /// The show peak framerate.
/// </summary>
- private VideoEncoder selectedVideoEncoder;
+ private bool showPeakFramerate;
/// <summary>
/// The show peak framerate.
/// </summary>
- private bool showPeakFramerate;
+ private int rf;
#endregion
@@ -110,9 +72,12 @@ namespace HandBrakeWPF.ViewModels
/// </param>
public VideoViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
+ this.Task = new EncodeTask { VideoEncoder = VideoEncoder.X264 };
+ this.userSettingService = userSettingService;
this.QualityMin = 0;
this.QualityMax = 51;
this.IsConstantQuantity = true;
+ this.VideoEncoders = EnumHelper<VideoEncoder>.GetEnumList();
}
#endregion
@@ -120,23 +85,9 @@ namespace HandBrakeWPF.ViewModels
#region Public Properties
/// <summary>
- /// Gets or sets AverageBitrate.
+ /// Gets or sets the current Encode Task.
/// </summary>
- public string AverageBitrate
- {
- get
- {
- return this.averageBitrate.ToString();
- }
- set
- {
- if (value != null)
- {
- this.averageBitrate = int.Parse(value);
- }
- this.NotifyOfPropertyChange(() => this.AverageBitrate);
- }
- }
+ public EncodeTask Task { get; set; }
/// <summary>
/// Gets Framerates.
@@ -156,13 +107,13 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.isConstantFramerate;
+ return this.Task.FramerateMode == FramerateMode.CFR;
}
set
{
- this.isConstantFramerate = value;
if (value)
{
+ this.Task.FramerateMode = FramerateMode.CFR;
this.IsVariableFramerate = false;
this.IsPeakFramerate = false;
}
@@ -178,11 +129,23 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.isConstantQuantity;
+ return this.Task.VideoEncodeRateType == VideoEncodeRateType.ConstantQuality;
}
set
{
- this.isConstantQuantity = value;
+ if (value)
+ {
+ this.Task.VideoEncodeRateType = VideoEncodeRateType.ConstantQuality;
+ this.Task.TwoPass = false;
+ this.Task.TurboFirstPass = false;
+ this.Task.VideoBitrate = null;
+ this.NotifyOfPropertyChange(() => this.Task);
+ }
+ else
+ {
+ this.Task.VideoEncodeRateType = VideoEncodeRateType.AverageBitrate;
+ }
+
this.NotifyOfPropertyChange(() => this.IsConstantQuantity);
}
}
@@ -194,13 +157,13 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.isPeakFramerate;
+ return this.Task.FramerateMode == FramerateMode.PFR;
}
set
{
- this.isPeakFramerate = value;
if (value)
{
+ this.Task.FramerateMode = FramerateMode.PFR;
this.IsVariableFramerate = false;
this.IsConstantFramerate = false;
}
@@ -210,53 +173,21 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Gets or sets a value indicating whether IsTurboFirstPass.
- /// </summary>
- public bool IsTurboFirstPass
- {
- get
- {
- return this.isTurboFirstPass;
- }
- set
- {
- this.isTurboFirstPass = value;
- this.NotifyOfPropertyChange(() => this.IsTurboFirstPass);
- }
- }
-
- /// <summary>
- /// Gets or sets a value indicating whether IsTwoPass.
- /// </summary>
- public bool IsTwoPass
- {
- get
- {
- return this.isTwoPass;
- }
- set
- {
- this.isTwoPass = value;
- this.NotifyOfPropertyChange(() => this.IsTwoPass);
- }
- }
-
- /// <summary>
/// Gets or sets a value indicating whether IsVariableFramerate.
/// </summary>
public bool IsVariableFramerate
{
get
{
- return this.isVariableFramerate;
+ return this.Task.FramerateMode == FramerateMode.VFR;
}
set
{
- this.isVariableFramerate = value;
if (value)
{
this.IsPeakFramerate = false;
this.IsConstantFramerate = false;
+ this.Task.FramerateMode = FramerateMode.VFR;
}
this.NotifyOfPropertyChange(() => this.IsVariableFramerate);
@@ -302,12 +233,44 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- return this.rf;
+ return rf;
}
set
{
this.rf = value;
+
+ double cqStep = userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step);
+ switch (this.SelectedVideoEncoder)
+ {
+ case VideoEncoder.FFMpeg:
+ case VideoEncoder.FFMpeg2:
+ this.Task.Quality = (32 - value);
+ break;
+ case VideoEncoder.X264:
+ double rfValue = 51.0 - value * cqStep;
+ rfValue = Math.Round(rfValue, 2);
+ this.Task.Quality = rfValue;
+
+ // TODO: Lossless warning.
+ break;
+ case VideoEncoder.Theora:
+ Task.Quality = value;
+ break;
+ }
+
this.NotifyOfPropertyChange(() => this.RF);
+ this.NotifyOfPropertyChange(() => this.DisplayRF);
+ }
+ }
+
+ /// <summary>
+ /// Gets DisplayRF.
+ /// </summary>
+ public double DisplayRF
+ {
+ get
+ {
+ return Task.Quality.HasValue ? this.Task.Quality.Value : 0;
}
}
@@ -318,43 +281,70 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- if (this.selectedFramerate == null)
+ if (this.Task.Framerate == null)
{
return "Same as source";
}
- return this.selectedFramerate.ToString();
+ return this.Task.Framerate.ToString();
}
set
{
if (value == "Same as source")
{
- this.selectedFramerate = null;
+ this.Task.Framerate = null;
this.ShowPeakFramerate = false;
}
- else
+ else if (!string.IsNullOrEmpty(value))
{
this.ShowPeakFramerate = true;
- this.selectedFramerate = double.Parse(value);
+ if (this.Task.FramerateMode == FramerateMode.VFR)
+ {
+ this.Task.FramerateMode = FramerateMode.PFR;
+ }
+ this.Task.Framerate = double.Parse(value);
}
this.NotifyOfPropertyChange(() => this.SelectedFramerate);
+ this.NotifyOfPropertyChange(() => this.Task);
}
}
/// <summary>
/// Gets or sets SelectedVideoEncoder.
/// </summary>
- public string SelectedVideoEncoder
+ public VideoEncoder SelectedVideoEncoder
{
get
{
- return EnumHelper<VideoEncoder>.GetDisplay(this.selectedVideoEncoder);
+ return this.Task.VideoEncoder;
}
set
{
- this.selectedVideoEncoder = EnumHelper<VideoEncoder>.GetValue(value);
+ this.Task.VideoEncoder = value;
this.NotifyOfPropertyChange(() => this.SelectedVideoEncoder);
+
+ // Tell the Advanced Panel off the change
+ IAdvancedViewModel advancedViewModel = IoC.Get<IAdvancedViewModel>();
+ advancedViewModel.SetEncoder(this.Task.VideoEncoder);
+
+ // Update the Quality Slider
+ switch (this.SelectedVideoEncoder)
+ {
+ case VideoEncoder.FFMpeg:
+ case VideoEncoder.FFMpeg2:
+ this.QualityMin = 1;
+ this.QualityMax = 31;
+ break;
+ case VideoEncoder.X264:
+ this.QualityMin = 0;
+ this.QualityMax = (int)(51 / userSettingService.GetUserSetting<double>(ASUserSettingConstants.X264Step));
+ break;
+ case VideoEncoder.Theora:
+ this.QualityMin = 0;
+ this.QualityMax = 63;
+ break;
+ }
}
}
@@ -375,15 +365,9 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Gets VideoEncoders.
+ /// Gets or sets VideoEncoders.
/// </summary>
- public IEnumerable<string> VideoEncoders
- {
- get
- {
- return EnumHelper<VideoEncoder>.GetEnumDisplayValues(typeof(VideoEncoder));
- }
- }
+ public IEnumerable<VideoEncoder> VideoEncoders { get; set; }
#endregion
@@ -403,6 +387,47 @@ namespace HandBrakeWPF.ViewModels
/// </param>
public void SetSource(Title title, Preset preset, EncodeTask task)
{
+ this.Task = task;
+ }
+
+ /// <summary>
+ /// Setup this tab for the specified preset.
+ /// </summary>
+ /// <param name="preset">
+ /// The preset.
+ /// </param>
+ public void SetPreset(Preset preset)
+ {
+ if (preset == null || preset.Task == null)
+ {
+ return;
+ }
+
+ this.SelectedVideoEncoder = preset.Task.VideoEncoder;
+ this.SelectedFramerate = preset.Task.Framerate.ToString();
+ switch (preset.Task.FramerateMode)
+ {
+ case FramerateMode.CFR:
+ this.IsConstantFramerate = true;
+ break;
+ case FramerateMode.VFR:
+ this.IsVariableFramerate = true;
+ this.ShowPeakFramerate = false;
+ break;
+ case FramerateMode.PFR:
+ this.IsPeakFramerate = true;
+ this.ShowPeakFramerate = true;
+ break;
+ }
+
+ // TODO Compute RF
+ this.RF = 20;
+
+ this.Task.TwoPass = preset.Task.TwoPass;
+ this.Task.TurboFirstPass = preset.Task.TurboFirstPass;
+ this.Task.VideoBitrate = preset.Task.VideoBitrate;
+
+ this.NotifyOfPropertyChange(() => this.Task);
}
#endregion
diff --git a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
index ce91077ba..3fad3c54b 100644
--- a/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
@@ -2,10 +2,15 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- mc:Ignorable="d"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300"
x:Name="advancedView">
+ <UserControl.Resources>
+ <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ <Converters:EnumComboConverter x:Key="x264DisplayConverter" />
+ </UserControl.Resources>
+
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -15,8 +20,42 @@
<TextBlock Text="Advanced" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
- <TextBox Grid.Row="2" Margin="10" Text="{Binding Query}"
- VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
+ <Grid Grid.Row="1" Margin="10,10,0,0" Visibility="{Binding DisplayX264Options, Converter={StaticResource boolToVisConverter}}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <StackPanel Grid.Row="0" Orientation="Vertical" Margin="0,0,0,10">
+
+ <TextBlock Text="X264 Advanced Options:" Margin="0,0,0,5" FontWeight="Bold" VerticalAlignment="Center" />
+
+ <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,10">
+ <TextBlock Text="Preset:" VerticalAlignment="Center" />
+ <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"
+ ItemsSource="{Binding X264Presets, Converter={StaticResource x264DisplayConverter}}"
+ SelectedItem="{Binding X264Preset, Converter={StaticResource x264DisplayConverter}}"/>
+
+ <TextBlock Text="Profile:" VerticalAlignment="Center" />
+ <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"
+ ItemsSource="{Binding X264Profiles, Converter={StaticResource x264DisplayConverter}}"
+ SelectedItem="{Binding X264Profile, Converter={StaticResource x264DisplayConverter}}"/>
+
+
+ <TextBlock Text="Tune:" VerticalAlignment="Center" />
+ <ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"
+ ItemsSource="{Binding X264Tunes, Converter={StaticResource x264DisplayConverter}}"
+ SelectedItem="{Binding X264Tune, Converter={StaticResource x264DisplayConverter}}"/>
+ </StackPanel>
+ </StackPanel>
+
+ </Grid>
+
+ <StackPanel Grid.Row="2" Margin="10" Height="100" VerticalAlignment="Top" >
+ <TextBlock Text="Advanced Query" Margin="0,0,0,5" FontWeight="Bold" VerticalAlignment="Center" />
+ <TextBox Text="{Binding Query}"
+ VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="150" TextWrapping="Wrap" />
+ </StackPanel>
</Grid>
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index c14d81b2d..25f6cd0be 100644
--- a/win/CS/HandBrakeWPF/Views/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -6,7 +6,12 @@
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:cal="http://www.caliburnproject.org"
xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation"
- mc:Ignorable="d">
+ xmlns:Conveters="clr-namespace:HandBrakeWPF.Converters"
+ xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop" mc:Ignorable="d">
+
+ <UserControl.Resources>
+ <Conveters:EnumComboConverter x:Key="enumComboConverter" />
+ </UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -25,7 +30,9 @@
</Grid>
<ListBox Grid.Row="2" ItemsSource="{Binding AudioTracks}"
- SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10">
+ SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10"
+ dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True"
+ dd:DragDrop.DropHandler="{Binding}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
@@ -76,8 +83,8 @@
SelectedItem="{Binding ScannedTrack}"/>
<TextBlock Text="Codec" FontWeight="Bold" Grid.Column="2" VerticalAlignment="Center" />
<ComboBox Width="100" Grid.Column="3" Margin="5,0,5,0" Height="22"
- ItemsSource="{Binding DataContext.AudioEncoders, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding Encoder}"/>
+ ItemsSource="{Binding DataContext.AudioEncoders, Converter={StaticResource enumComboConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
+ SelectedItem="{Binding Encoder, Converter={StaticResource enumComboConverter}}"/>
<TextBlock Text="Bitrate" FontWeight="Bold" Grid.Column="4" VerticalAlignment="Center" />
<ComboBox Width="70" Grid.Column="5" Margin="5,0,5,0" Height="22"
ItemsSource="{Binding DataContext.AudioBitrates, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
@@ -90,8 +97,8 @@
<!-- Row 2-->
<TextBlock Text="Mixdown" FontWeight="Bold" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center"/>
<ComboBox Width="100" Grid.Column="1" Margin="5,0,5,0" Grid.Row="1" Height="22"
- ItemsSource="{Binding DataContext.AudioMixdowns, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
- SelectedItem="{Binding MixDown}"/>
+ ItemsSource="{Binding DataContext.AudioMixdowns, Converter={StaticResource enumComboConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"
+ SelectedItem="{Binding MixDown, Converter={StaticResource enumComboConverter}}"/>
<TextBlock Text="DRC" FontWeight="Bold" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center"/>
<NumericUpDown:NumericUpDown Width="45" Value="{Binding DRC}" Grid.Row="1" Grid.Column="3" HorizontalAlignment="Left" Margin="5,0,5,0" />
<TextBlock Text="Gain" FontWeight="Bold" Grid.Column="4" Grid.Row="1" VerticalAlignment="Center"/>
diff --git a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml
index 1c46e57ee..f3d6d1ed8 100644
--- a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml
@@ -27,7 +27,8 @@
<DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding Chapters}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutoGenerateColumns="False"
- CanUserSortColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False">
+ CanUserSortColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False"
+ CanUserAddRows="False" CanUserDeleteRows="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Chapter Number" Width="150" Binding="{Binding ChapterNumber}" IsReadOnly="True" />
<DataGridTextColumn Header="Chapter Name" Width="*" Binding="{Binding ChapterName}" IsReadOnly="False" />
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 1ec10a830..37a11a016 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -4,6 +4,7 @@
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" Title="{Data:Binding Path=WindowTitle}" Height="655" Width="1015" FontSize="11" Background="#FFF0F0F0"
+ Micro:Message.Attach="[Event Loaded] = [Action Load]"
AllowDrop="True">
<i:Interaction.Triggers>
diff --git a/win/CS/HandBrakeWPF/Views/QueueView.xaml b/win/CS/HandBrakeWPF/Views/QueueView.xaml
index 658b3d0c1..982b8f1ec 100644
--- a/win/CS/HandBrakeWPF/Views/QueueView.xaml
+++ b/win/CS/HandBrakeWPF/Views/QueueView.xaml
@@ -4,7 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cal="http://www.caliburnproject.org"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
- xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" mc:Ignorable="d" Title="{Binding Title}"
+ xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
+ xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop" mc:Ignorable="d" Title="{Binding Title}"
Width="600" Height="400"
Background="#FFF0F0F0">
@@ -42,7 +43,9 @@
<TextBlock Text="{Binding JobStatus}" />
</StackPanel>
- <ListBox Grid.Row="2" ItemsSource="{Binding QueueJobs}" SelectionMode="Extended" Background="LightGray" Margin="10,0,10,10">
+ <ListBox Grid.Row="2" ItemsSource="{Binding QueueJobs}" SelectionMode="Extended" Background="LightGray" Margin="10,0,10,10"
+ dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True"
+ dd:DragDrop.DropHandler="{Binding}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
@@ -52,7 +55,7 @@
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
- <DataTemplate>
+ <DataTemplate x:Name="QueueItemTemplate">
<Grid HorizontalAlignment="Stretch" >
<Grid.ColumnDefinitions>
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index 1e49fc3c2..898d5df64 100644
--- a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cal="http://www.caliburnproject.org"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation"
- mc:Ignorable="d">
+ xmlns:dd="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop" mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -26,7 +26,9 @@
</Grid>
<ListBox Grid.Row="2" ItemsSource="{Binding SubtitleTracks}"
- SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10">
+ SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10"
+ dd:DragDrop.IsDragSource="True" dd:DragDrop.IsDropTarget="True"
+ dd:DragDrop.DropHandler="{Binding}">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
index ada69e02e..ec6163b94 100644
--- a/win/CS/HandBrakeWPF/Views/VideoView.xaml
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -8,6 +8,7 @@
<UserControl.Resources>
<Converters:BooleanConverter x:Key="boolConverter" />
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ <Converters:EnumComboConverter x:Key="enumComboConverter" />
</UserControl.Resources>
<Grid Margin="10,5,0,0">
@@ -29,7 +30,8 @@
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
<TextBlock Text="Video Codec:" Width="100" />
- <ComboBox Width="120" ItemsSource="{Binding VideoEncoders}" SelectedItem="{Binding SelectedVideoEncoder}" />
+ <ComboBox Width="120" ItemsSource="{Binding VideoEncoders, Converter={StaticResource enumComboConverter}, Mode=TwoWay}"
+ SelectedItem="{Binding SelectedVideoEncoder, Converter={StaticResource enumComboConverter}, Mode=TwoWay}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
@@ -49,7 +51,7 @@
<StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
<RadioButton Content="Constant Quality:" IsChecked="{Binding IsConstantQuantity}" Margin="0,0,10,0"/>
- <TextBlock Text="{Binding RF}" Width="25" />
+ <TextBlock Text="{Binding DisplayRF}" Width="25" />
<TextBlock Text="RF" FontWeight="Bold" />
</StackPanel>
@@ -58,14 +60,14 @@
<StackPanel Orientation="Horizontal" Margin="0,0,0,10">
<RadioButton Content="Avg Bitrate (kbps):" IsChecked="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" Margin="0,0,10,0"/>
- <TextBox Width="75" Text="{Binding AverageBitrate}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" />
+ <TextBox Width="75" Text="{Binding Task.VideoBitrate}" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Margin="30,0,0,0">
<CheckBox Content="2-Pass Encoding" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
- IsChecked="{Binding IsTwoPass}" Margin="0,0,10,0" />
+ IsChecked="{Binding Task.TwoPass}" Margin="0,0,10,0" />
<CheckBox Content="Turbo first pass" IsEnabled="{Binding IsConstantQuantity, Converter={StaticResource boolConverter}, ConverterParameter=true}"
- IsChecked="{Binding IsTurboFirstPass}" />
+ IsChecked="{Binding Task.TurboFirstPass}" />
</StackPanel>
</StackPanel>
diff --git a/win/CS/frmMain.Designer.cs b/win/CS/frmMain.Designer.cs
index 8f1345b51..5dcbbbeab 100644
--- a/win/CS/frmMain.Designer.cs
+++ b/win/CS/frmMain.Designer.cs
@@ -60,7 +60,6 @@ namespace Handbrake
this.name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ChaptersMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.mnu_resetChapters = new System.Windows.Forms.ToolStripMenuItem();
- this.btn_file_source = new System.Windows.Forms.ToolStripMenuItem();
this.drop_format = new System.Windows.Forms.ComboBox();
this.drop_chapterFinish = new System.Windows.Forms.ComboBox();
this.drop_chapterStart = new System.Windows.Forms.ComboBox();
@@ -73,6 +72,7 @@ namespace Handbrake
this.radio_cq = new System.Windows.Forms.RadioButton();
this.radio_avgBitrate = new System.Windows.Forms.RadioButton();
this.check_2PassEncode = new System.Windows.Forms.CheckBox();
+ this.btn_file_source = new System.Windows.Forms.ToolStripMenuItem();
this.treeView_presets = new System.Windows.Forms.TreeView();
this.presets_menu = new System.Windows.Forms.ContextMenuStrip(this.components);
this.pmnu_expandAll = new System.Windows.Forms.ToolStripMenuItem();
@@ -99,6 +99,7 @@ namespace Handbrake
this.Label47 = new System.Windows.Forms.Label();
this.Label3 = new System.Windows.Forms.Label();
this.tab_audio = new System.Windows.Forms.TabPage();
+ this.AudioSettings = new Handbrake.Controls.AudioPanel();
this.AudioMenuRowHeightHack = new System.Windows.Forms.ImageList(this.components);
this.tab_video = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
@@ -109,13 +110,18 @@ namespace Handbrake
this.lbl_SliderValue = new System.Windows.Forms.Label();
this.lbl_framerate = new System.Windows.Forms.Label();
this.tab_picture = new System.Windows.Forms.TabPage();
+ this.PictureSettings = new Handbrake.Controls.PictureSettings();
this.Check_ChapterMarkers = new System.Windows.Forms.CheckBox();
this.tabs_panel = new System.Windows.Forms.TabControl();
this.tab_filters = new System.Windows.Forms.TabPage();
+ this.Filters = new Handbrake.Controls.Filters();
this.tab_subtitles = new System.Windows.Forms.TabPage();
+ this.Subtitles = new Handbrake.Controls.Subtitles();
this.tab_chapters = new System.Windows.Forms.TabPage();
this.label31 = new System.Windows.Forms.Label();
this.tab_advanced = new System.Windows.Forms.TabPage();
+ this.advancedEncoderOpts = new Handbrake.Controls.AdvancedEncoderOpts();
+ this.x264Panel = new Handbrake.Controls.x264Panel();
this.tab_query = new System.Windows.Forms.TabPage();
this.btn_clear = new System.Windows.Forms.Button();
this.label34 = new System.Windows.Forms.Label();
@@ -180,12 +186,6 @@ namespace Handbrake
this.SourceLayoutPanel = new System.Windows.Forms.FlowLayoutPanel();
this.openPreset = new System.Windows.Forms.OpenFileDialog();
this.File_ChapterImport = new System.Windows.Forms.OpenFileDialog();
- this.PictureSettings = new Handbrake.Controls.PictureSettings();
- this.Filters = new Handbrake.Controls.Filters();
- this.AudioSettings = new Handbrake.Controls.AudioPanel();
- this.Subtitles = new Handbrake.Controls.Subtitles();
- this.advancedEncoderOpts = new Handbrake.Controls.AdvancedEncoderOpts();
- this.x264Panel = new Handbrake.Controls.x264Panel();
notifyIconMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
notifyIconMenu.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.slider_videoQuality)).BeginInit();
@@ -427,15 +427,6 @@ namespace Handbrake
this.mnu_resetChapters.Text = "Reset Chapter Names";
this.mnu_resetChapters.Click += new System.EventHandler(this.mnu_resetChapters_Click);
//
- // btn_file_source
- //
- this.btn_file_source.Image = global::Handbrake.Properties.Resources.Movies_Small;
- this.btn_file_source.Name = "btn_file_source";
- this.btn_file_source.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
- this.btn_file_source.Size = new System.Drawing.Size(182, 22);
- this.btn_file_source.Text = "Video File";
- this.btn_file_source.Click += new System.EventHandler(this.BtnFileScanClicked);
- //
// drop_format
//
this.drop_format.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
@@ -599,6 +590,15 @@ namespace Handbrake
this.check_2PassEncode.UseVisualStyleBackColor = false;
this.check_2PassEncode.CheckedChanged += new System.EventHandler(this.check_2PassEncode_CheckedChanged);
//
+ // btn_file_source
+ //
+ this.btn_file_source.Image = global::Handbrake.Properties.Resources.Movies_Small;
+ this.btn_file_source.Name = "btn_file_source";
+ this.btn_file_source.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
+ this.btn_file_source.Size = new System.Drawing.Size(182, 22);
+ this.btn_file_source.Text = "Video File";
+ this.btn_file_source.Click += new System.EventHandler(this.BtnFileScanClicked);
+ //
// treeView_presets
//
this.treeView_presets.ContextMenuStrip = this.presets_menu;
@@ -824,6 +824,22 @@ namespace Handbrake
this.tab_audio.Text = "Audio";
this.tab_audio.UseVisualStyleBackColor = true;
//
+ // AudioSettings
+ //
+ this.AudioSettings.BackColor = System.Drawing.Color.Transparent;
+ this.AudioSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.AudioSettings.Location = new System.Drawing.Point(0, 0);
+ this.AudioSettings.Name = "AudioSettings";
+ allowedPassthru1.AudioAllowAACPass = true;
+ allowedPassthru1.AudioAllowAC3Pass = true;
+ allowedPassthru1.AudioAllowDTSHDPass = true;
+ allowedPassthru1.AudioAllowDTSPass = true;
+ allowedPassthru1.AudioAllowMP3Pass = true;
+ allowedPassthru1.AudioEncoderFallback = HandBrake.Interop.Model.Encoding.AudioEncoder.Ac3;
+ this.AudioSettings.PassthruSettings = allowedPassthru1;
+ this.AudioSettings.Size = new System.Drawing.Size(720, 310);
+ this.AudioSettings.TabIndex = 0;
+ //
// AudioMenuRowHeightHack
//
this.AudioMenuRowHeightHack.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
@@ -943,6 +959,19 @@ namespace Handbrake
this.tab_picture.Text = "Picture";
this.tab_picture.UseVisualStyleBackColor = true;
//
+ // PictureSettings
+ //
+ this.PictureSettings.BackColor = System.Drawing.Color.Transparent;
+ this.PictureSettings.CurrentlySelectedPreset = null;
+ this.PictureSettings.Enabled = false;
+ this.PictureSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.PictureSettings.Location = new System.Drawing.Point(0, 0);
+ this.PictureSettings.Name = "PictureSettings";
+ this.PictureSettings.PresetMaximumResolution = new System.Drawing.Size(0, 0);
+ this.PictureSettings.Size = new System.Drawing.Size(666, 279);
+ this.PictureSettings.SizeSet = false;
+ this.PictureSettings.TabIndex = 0;
+ //
// Check_ChapterMarkers
//
this.Check_ChapterMarkers.AutoSize = true;
@@ -981,6 +1010,15 @@ namespace Handbrake
this.tab_filters.Text = "Video Filters";
this.tab_filters.UseVisualStyleBackColor = true;
//
+ // Filters
+ //
+ this.Filters.BackColor = System.Drawing.Color.Transparent;
+ this.Filters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Filters.Location = new System.Drawing.Point(0, 0);
+ this.Filters.Name = "Filters";
+ this.Filters.Size = new System.Drawing.Size(713, 310);
+ this.Filters.TabIndex = 0;
+ //
// tab_subtitles
//
this.tab_subtitles.Controls.Add(this.Subtitles);
@@ -992,6 +1030,15 @@ namespace Handbrake
this.tab_subtitles.Text = "Subtitles";
this.tab_subtitles.UseVisualStyleBackColor = true;
//
+ // Subtitles
+ //
+ this.Subtitles.BackColor = System.Drawing.Color.Transparent;
+ this.Subtitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.Subtitles.Location = new System.Drawing.Point(0, 0);
+ this.Subtitles.Name = "Subtitles";
+ this.Subtitles.Size = new System.Drawing.Size(722, 310);
+ this.Subtitles.TabIndex = 0;
+ //
// tab_chapters
//
this.tab_chapters.BackColor = System.Drawing.Color.Transparent;
@@ -1031,6 +1078,26 @@ namespace Handbrake
this.tab_advanced.Text = "Advanced";
this.tab_advanced.UseVisualStyleBackColor = true;
//
+ // advancedEncoderOpts
+ //
+ this.advancedEncoderOpts.AdavancedQuery = "";
+ this.advancedEncoderOpts.BackColor = System.Drawing.Color.Transparent;
+ this.advancedEncoderOpts.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.advancedEncoderOpts.Location = new System.Drawing.Point(0, 0);
+ this.advancedEncoderOpts.Name = "advancedEncoderOpts";
+ this.advancedEncoderOpts.Size = new System.Drawing.Size(720, 209);
+ this.advancedEncoderOpts.TabIndex = 1;
+ //
+ // x264Panel
+ //
+ this.x264Panel.BackColor = System.Drawing.Color.Transparent;
+ this.x264Panel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
+ this.x264Panel.Location = new System.Drawing.Point(0, 0);
+ this.x264Panel.Name = "x264Panel";
+ this.x264Panel.Size = new System.Drawing.Size(720, 306);
+ this.x264Panel.TabIndex = 0;
+ this.x264Panel.X264Query = "";
+ //
// tab_query
//
this.tab_query.Controls.Add(this.btn_clear);
@@ -1718,72 +1785,6 @@ namespace Handbrake
//
this.File_ChapterImport.Filter = "CSV Files|*.csv";
//
- // PictureSettings
- //
- this.PictureSettings.BackColor = System.Drawing.Color.Transparent;
- this.PictureSettings.CurrentlySelectedPreset = null;
- this.PictureSettings.Enabled = false;
- this.PictureSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.PictureSettings.Location = new System.Drawing.Point(0, 0);
- this.PictureSettings.Name = "PictureSettings";
- this.PictureSettings.PresetMaximumResolution = new System.Drawing.Size(0, 0);
- this.PictureSettings.Size = new System.Drawing.Size(666, 279);
- this.PictureSettings.TabIndex = 0;
- //
- // Filters
- //
- this.Filters.BackColor = System.Drawing.Color.Transparent;
- this.Filters.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Filters.Location = new System.Drawing.Point(0, 0);
- this.Filters.Name = "Filters";
- this.Filters.Size = new System.Drawing.Size(713, 310);
- this.Filters.TabIndex = 0;
- //
- // AudioSettings
- //
- this.AudioSettings.BackColor = System.Drawing.Color.Transparent;
- this.AudioSettings.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.AudioSettings.Location = new System.Drawing.Point(0, 0);
- this.AudioSettings.Name = "AudioSettings";
- allowedPassthru1.AudioAllowAACPass = true;
- allowedPassthru1.AudioAllowAC3Pass = true;
- allowedPassthru1.AudioAllowDTSHDPass = true;
- allowedPassthru1.AudioAllowDTSPass = true;
- allowedPassthru1.AudioAllowMP3Pass = true;
- allowedPassthru1.AudioEncoderFallback = HandBrake.Interop.Model.Encoding.AudioEncoder.Ac3;
- this.AudioSettings.PassthruSettings = allowedPassthru1;
- this.AudioSettings.Size = new System.Drawing.Size(720, 310);
- this.AudioSettings.TabIndex = 0;
- //
- // Subtitles
- //
- this.Subtitles.BackColor = System.Drawing.Color.Transparent;
- this.Subtitles.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.Subtitles.Location = new System.Drawing.Point(0, 0);
- this.Subtitles.Name = "Subtitles";
- this.Subtitles.Size = new System.Drawing.Size(722, 310);
- this.Subtitles.TabIndex = 0;
- //
- // advancedEncoderOpts
- //
- this.advancedEncoderOpts.AdavancedQuery = "";
- this.advancedEncoderOpts.BackColor = System.Drawing.Color.Transparent;
- this.advancedEncoderOpts.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.advancedEncoderOpts.Location = new System.Drawing.Point(0, 0);
- this.advancedEncoderOpts.Name = "advancedEncoderOpts";
- this.advancedEncoderOpts.Size = new System.Drawing.Size(720, 209);
- this.advancedEncoderOpts.TabIndex = 1;
- //
- // x264Panel
- //
- this.x264Panel.BackColor = System.Drawing.Color.Transparent;
- this.x264Panel.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.x264Panel.Location = new System.Drawing.Point(0, 0);
- this.x264Panel.Name = "x264Panel";
- this.x264Panel.Size = new System.Drawing.Size(720, 306);
- this.x264Panel.TabIndex = 0;
- this.x264Panel.X264Query = "";
- //
// frmMain
//
this.AllowDrop = true;
diff --git a/win/CS/frmMain.cs b/win/CS/frmMain.cs
index 120902d2f..475b42019 100644
--- a/win/CS/frmMain.cs
+++ b/win/CS/frmMain.cs
@@ -2676,6 +2676,7 @@ namespace Handbrake
#endregion
+
// This is the END of the road ****************************************
}
} \ No newline at end of file
diff --git a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.XML b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.XML
new file mode 100644
index 000000000..8270f7326
--- /dev/null
+++ b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.XML
@@ -0,0 +1,270 @@
+<?xml version="1.0"?>
+<doc>
+ <assembly>
+ <name>GongSolutions.Wpf.DragDrop</name>
+ </assembly>
+ <members>
+ <member name="T:GongSolutions.Wpf.DragDrop.IDropTarget">
+ <summary>
+ Interface implemented by Drop Handlers.
+ </summary>
+ </member>
+ <member name="M:GongSolutions.Wpf.DragDrop.IDropTarget.DragOver(GongSolutions.Wpf.DragDrop.DropInfo)">
+ <summary>
+ Updates the current drag state.
+ </summary>
+
+ <param name="dropInfo">
+ Information about the drag.
+ </param>
+
+ <remarks>
+ To allow a drop at the current drag position, the <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.Effects"/> property on
+ <paramref name="dropInfo"/> should be set to a value other than <see cref="F:System.Windows.DragDropEffects.None"/>
+ and <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.Data"/> should be set to a non-null value.
+ </remarks>
+ </member>
+ <member name="M:GongSolutions.Wpf.DragDrop.IDropTarget.Drop(GongSolutions.Wpf.DragDrop.DropInfo)">
+ <summary>
+ Performs a drop.
+ </summary>
+
+ <param name="dropInfo">
+ Information about the drop.
+ </param>
+ </member>
+ <member name="T:GongSolutions.Wpf.DragDrop.DropInfo">
+ <summary>
+ Holds information about a the target of a drag drop operation.
+ </summary>
+
+ <remarks>
+ The <see cref="T:GongSolutions.Wpf.DragDrop.DropInfo"/> class holds all of the framework's information about the current
+ target of a drag. It is used by <see cref="M:GongSolutions.Wpf.DragDrop.IDropTarget.DragOver(GongSolutions.Wpf.DragDrop.DropInfo)"/> method to determine whether
+ the current drop target is valid, and by <see cref="M:GongSolutions.Wpf.DragDrop.IDropTarget.Drop(GongSolutions.Wpf.DragDrop.DropInfo)"/> to perform the drop.
+ </remarks>
+ </member>
+ <member name="M:GongSolutions.Wpf.DragDrop.DropInfo.#ctor(System.Object,System.Windows.DragEventArgs,GongSolutions.Wpf.DragDrop.DragInfo)">
+ <summary>
+ Initializes a new instance of the DropInfo class.
+ </summary>
+
+ <param name="sender">
+ The sender of the drag event.
+ </param>
+
+ <param name="e">
+ The drag event.
+ </param>
+
+ <param name="dragInfo">
+ Information about the source of the drag, if the drag came from within the framework.
+ </param>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.Data">
+ <summary>
+ Gets the drag data.
+ </summary>
+
+ <remarks>
+ If the drag came from within the framework, this will hold:
+
+ - The dragged data if a single item was dragged.
+ - A typed IEnumerable if multiple items were dragged.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DragInfo">
+ <summary>
+ Gets a <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.DragInfo"/> object holding information about the source of the drag,
+ if the drag came from within the framework.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DropTargetAdorner">
+ <summary>
+ Gets or sets the class of drop target to display.
+ </summary>
+
+ <remarks>
+ The standard drop target adorner classes are held in the <see cref="T:GongSolutions.Wpf.DragDrop.DropTargetAdorners"/>
+ class.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.Effects">
+ <summary>
+ Gets or sets the allowed effects for the drop.
+ </summary>
+
+ <remarks>
+ This must be set to a value other than <see cref="F:System.Windows.DragDropEffects.None"/> by a drop handler in order
+ for a drop to be possible.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.InsertIndex">
+ <summary>
+ Gets the current insert position within <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetCollection"/>.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetCollection">
+ <summary>
+ Gets the collection that the target ItemsControl is bound to.
+ </summary>
+
+ <remarks>
+ If the current drop target is unbound or not an ItemsControl, this will be null.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetItem">
+ <summary>
+ Gets the object that the current drop target is bound to.
+ </summary>
+
+ <remarks>
+ If the current drop target is unbound or not an ItemsControl, this will be null.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetGroup">
+ <summary>
+ Gets the current group target.
+ </summary>
+
+ <remarks>
+ If the drag is currently over an ItemsControl with groups, describes the group that
+ the drag is currently over.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTarget">
+ <summary>
+ Gets the control that is the current drop target.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTargetItem">
+ <summary>
+ Gets the item in an ItemsControl that is the current drop target.
+ </summary>
+
+ <remarks>
+ If the current drop target is unbound or not an ItemsControl, this will be null.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTargetOrientation">
+ <summary>
+ Gets th orientation of the current drop target.
+ </summary>
+ </member>
+ <member name="T:GongSolutions.Wpf.DragDrop.IDragSource">
+ <summary>
+ Interface implemented by Drag Handlers.
+ </summary>
+ </member>
+ <member name="M:GongSolutions.Wpf.DragDrop.IDragSource.StartDrag(GongSolutions.Wpf.DragDrop.DragInfo)">
+ <summary>
+ Queries whether a drag can be started.
+ </summary>
+
+ <param name="dragInfo">
+ Information about the drag.
+ </param>
+
+ <remarks>
+ To allow a drag to be started, the <see cref="P:GongSolutions.Wpf.DragDrop.DragInfo.Effects"/> property on <paramref name="dragInfo"/>
+ should be set to a value other than <see cref="!:DragDropEffects.None"/>.
+ </remarks>
+ </member>
+ <member name="T:GongSolutions.Wpf.DragDrop.DragInfo">
+ <summary>
+ Holds information about a the source of a drag drop operation.
+ </summary>
+
+ <remarks>
+ The <see cref="T:GongSolutions.Wpf.DragDrop.DragInfo"/> class holds all of the framework's information about the source
+ of a drag. It is used by <see cref="M:GongSolutions.Wpf.DragDrop.IDragSource.StartDrag(GongSolutions.Wpf.DragDrop.DragInfo)"/> to determine whether a drag
+ can start, and what the dragged data should be.
+ </remarks>
+ </member>
+ <member name="M:GongSolutions.Wpf.DragDrop.DragInfo.#ctor(System.Object,System.Windows.Input.MouseButtonEventArgs)">
+ <summary>
+ Initializes a new instance of the DragInfo class.
+ </summary>
+
+ <param name="sender">
+ The sender of the mouse event that initiated the drag.
+ </param>
+
+ <param name="e">
+ The mouse event that initiated the drag.
+ </param>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.Data">
+ <summary>
+ Gets or sets the drag data.
+ </summary>
+
+ <remarks>
+ This must be set by a drag handler in order for a drag to start.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.DragStartPosition">
+ <summary>
+ Gets the position of the click that initiated the drag, relative to <see cref="P:GongSolutions.Wpf.DragDrop.DragInfo.VisualSource"/>.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.Effects">
+ <summary>
+ Gets or sets the allowed effects for the drag.
+ </summary>
+
+ <remarks>
+ This must be set to a value other than <see cref="F:System.Windows.DragDropEffects.None"/> by a drag handler in order
+ for a drag to start.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.MouseButton">
+ <summary>
+ Gets the mouse button that initiated the drag.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.SourceCollection">
+ <summary>
+ Gets the collection that the source ItemsControl is bound to.
+ </summary>
+
+ <remarks>
+ If the control that initated the drag is unbound or not an ItemsControl, this will be null.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.SourceItem">
+ <summary>
+ Gets the object that a dragged item is bound to.
+ </summary>
+
+ <remarks>
+ If the control that initated the drag is unbound or not an ItemsControl, this will be null.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.SourceItems">
+ <summary>
+ Gets a collection of objects that the selected items in an ItemsControl are bound to.
+ </summary>
+
+ <remarks>
+ If the control that initated the drag is unbound or not an ItemsControl, this will be empty.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.VisualSource">
+ <summary>
+ Gets the control that initiated the drag.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.VisualSourceItem">
+ <summary>
+ Gets the item in an ItemsControl that started the drag.
+ </summary>
+
+ <remarks>
+ If the control that initiated the drag is an ItemsControl, this property will hold the item
+ container of the clicked item. For example, if <see cref="P:GongSolutions.Wpf.DragDrop.DragInfo.VisualSource"/> is a ListBox this
+ will hold a ListBoxItem.
+ </remarks>
+ </member>
+ </members>
+</doc>
diff --git a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll
new file mode 100644
index 000000000..237a45c09
--- /dev/null
+++ b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll
Binary files differ