diff options
Diffstat (limited to 'win')
35 files changed, 629 insertions, 284 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs b/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs index e47a76115..6e738351a 100644 --- a/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs +++ b/win/CS/HandBrake.ApplicationServices/Factories/PlistPresetFactory.cs @@ -127,10 +127,10 @@ namespace HandBrake.ApplicationServices.Factories preset.Task.Cropping.Right = kvp.Value;
break;
case "PictureHeight":
- preset.Task.Height = kvp.Value;
+ preset.Task.Height = kvp.Value == null || kvp.Value == 0 ? null : kvp.Value;
break;
case "PictureWidth":
- preset.Task.Width = kvp.Value;
+ preset.Task.Width = kvp.Value == null || kvp.Value == 0 ? null : kvp.Value;
break;
case "PictureKeepRatio":
preset.Task.KeepDisplayAspect = kvp.Value == 1;
@@ -138,6 +138,9 @@ namespace HandBrake.ApplicationServices.Factories case "PicturePAR":
preset.Task.Anamorphic = (Anamorphic)kvp.Value;
break;
+ case "PictureModulus":
+ preset.Task.Modulus = kvp.Value;
+ break;
// Filters
case "PictureDeblock":
diff --git a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs index 172fe7291..a442dc5ce 100644 --- a/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs +++ b/win/CS/HandBrake.ApplicationServices/Services/QueueProcessor.cs @@ -215,7 +215,7 @@ namespace HandBrake.ApplicationServices.Services /// </returns>
public bool CheckForDestinationPathDuplicates(string destination)
{
- return this.queue.Any(checkItem => checkItem.Task.Destination.Contains(destination.Replace("\\\\", "\\")));
+ return this.queue.Any(job => job.Task != null && job.Task.Destination.Contains(destination.Replace("\\\\", "\\")));
}
/// <summary>
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs index e22345134..2a11914b8 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/PlistUtility.cs @@ -33,7 +33,7 @@ namespace HandBrake.ApplicationServices.Utilities /// The preset.
/// </param>
/// <param name="build">
- /// The build.
+ /// The build.PictureModulusPictureModulus
/// </param>
public static void Export(string path, Preset preset, string build)
{
@@ -268,7 +268,7 @@ namespace HandBrake.ApplicationServices.Utilities AddEncodeElement(xmlWriter, "VideoAvgBitrate", "string", parsed.VideoBitrate.ToString());
AddEncodeElement(xmlWriter, "VideoEncoder", "string", EnumHelper<VideoEncoder>.GetDisplay(parsed.VideoEncoder));
AddEncodeElement(xmlWriter, "VideoFramerate", "string", parsed.Framerate == null ? "Same as source" : parsed.Framerate.ToString());
- AddEncodeElement(xmlWriter, "VideFrameratePFR", "integer", parsed.FramerateMode == FramerateMode.PFR ? "1" : "0");
+ AddEncodeElement(xmlWriter, "VideoFramerateMode", "string", parsed.FramerateMode.ToString().ToLower());
AddEncodeElement(xmlWriter, "VideoGrayScale", "integer", parsed.Grayscale ? "1" : "0");
AddEncodeElement(xmlWriter, "VideoQualitySlider", "real", parsed.Quality.ToString());
AddEncodeElement(xmlWriter, "h264Level", "string", parsed.H264Level);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs index 1dc2a1e74..e7f172e32 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Converters.cs @@ -17,10 +17,10 @@ namespace HandBrake.Interop using HandBrake.Interop.SourceData;
using HandBrake.Interop.Model;
- /// <summary>
- /// The converters.
- /// </summary>
- public static class Converters
+ /// <summary>
+ /// Converters for various encoding values.
+ /// </summary>
+ public static class Converters
{
/// <summary>
/// Video Frame Rates
@@ -35,7 +35,7 @@ namespace HandBrake.Interop {24, 1125000},
{25, 1080000},
{29.97, 900900},
- {30, 900000},
+ {30, 900000},
{50, 540000},
{59.94, 450450},
{60, 450000}
@@ -94,8 +94,8 @@ namespace HandBrake.Interop return NativeConstants.HB_ACODEC_DCA_HD_PASS;
case AudioEncoder.Vorbis:
return NativeConstants.HB_ACODEC_VORBIS;
- case AudioEncoder.ffflac:
- return NativeConstants.HB_ACODEC_FFFLAC;
+ case AudioEncoder.ffflac:
+ return NativeConstants.HB_ACODEC_FFFLAC;
}
return 0;
@@ -128,8 +128,8 @@ namespace HandBrake.Interop case NativeConstants.HB_ACODEC_CA_AAC:
case NativeConstants.HB_ACODEC_CA_HAAC:
return AudioCodec.Aac;
- case NativeConstants.HB_ACODEC_FFFLAC:
- return AudioCodec.Flac;
+ case NativeConstants.HB_ACODEC_FFFLAC:
+ return AudioCodec.Flac;
default:
return AudioCodec.Other;
}
@@ -204,11 +204,31 @@ namespace HandBrake.Interop public static HBMixdown NativeToMixdown(hb_mixdown_s mixdown)
{
return new HBMixdown
- {
+ {
Id = mixdown.amixdown,
ShortName = mixdown.short_name,
DisplayName = mixdown.human_readable_name
- };
+ };
+ }
+
+ /// <summary>
+ /// Converts the PTS amount to a TimeSpan. There may be some accuracy loss here.
+ /// </summary>
+ /// <param name="pts">The PTS to convert.</param>
+ /// <returns>The timespan for it.</returns>
+ public static TimeSpan PtsToTimeSpan(ulong pts)
+ {
+ return TimeSpan.FromTicks((long)((pts * 10000000) / 90000));
+ }
+
+ /// <summary>
+ /// Converts the PTS amount to seconds.
+ /// </summary>
+ /// <param name="pts">The PTS to convert.</param>
+ /// <returns>The corresponding number of seconds.</returns>
+ public static double PtsToSeconds(ulong pts)
+ {
+ return (double)pts / 90000;
}
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs index b342c8f12..56c3c116a 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/EventArgs/ScanProgressEventArgs.cs @@ -9,21 +9,36 @@ namespace HandBrake.Interop.EventArgs
{
- using System;
+ using System;
- /// <summary>
- /// The Scan Progress Event Args
- /// </summary>
- public class ScanProgressEventArgs : EventArgs
+ /// <summary>
+ /// The Scan Progress Event Args
+ /// </summary>
+ public class ScanProgressEventArgs : EventArgs
{
- /// <summary>
- /// Gets or sets CurrentTitle.
- /// </summary>
- public int CurrentTitle { get; set; }
+ /// <summary>
+ /// Gets or sets the total progress fraction for the scan.
+ /// </summary>
+ public float Progress { get; set; }
- /// <summary>
- /// Gets or sets Titles.
- /// </summary>
- public int Titles { get; set; }
+ /// <summary>
+ /// Gets or sets the current preview being processed on the scan.
+ /// </summary>
+ public int CurrentPreview { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total number of previews to process.
+ /// </summary>
+ public int Previews { get; set; }
+
+ /// <summary>
+ /// Gets or sets the current title being processed on the scan.
+ /// </summary>
+ public int CurrentTitle { get; set; }
+
+ /// <summary>
+ /// Gets or sets the total number of titles to process.
+ /// </summary>
+ public int Titles { get; set; }
}
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs index ecfc79ebf..864d148b1 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeInstance.cs @@ -110,6 +110,11 @@ namespace HandBrake.Interop private List<IntPtr> encodeAllocatedMemory;
/// <summary>
+ /// A value indicating whether this object has been disposed or not.
+ /// </summary>
+ private bool disposed;
+
+ /// <summary>
/// Finalizes an instance of the HandBrakeInstance class.
/// </summary>
~HandBrakeInstance()
@@ -427,8 +432,8 @@ namespace HandBrake.Interop if (!string.IsNullOrEmpty(profile.X264Profile))
{
- nativeJob.x264_profile = Marshal.StringToHGlobalAnsi(profile.X264Profile);
- this.encodeAllocatedMemory.Add(nativeJob.x264_profile);
+ nativeJob.h264_profile = Marshal.StringToHGlobalAnsi(profile.X264Profile);
+ this.encodeAllocatedMemory.Add(nativeJob.h264_profile);
}
if (!string.IsNullOrEmpty(profile.X264Preset))
@@ -600,6 +605,11 @@ namespace HandBrake.Interop /// </summary>
public void Dispose()
{
+ if (this.disposed)
+ {
+ return;
+ }
+
this.Dispose(true);
GC.SuppressFinalize(this);
}
@@ -620,6 +630,8 @@ namespace HandBrake.Interop Marshal.WriteIntPtr(handlePtr, this.hbHandle);
HBFunctions.hb_close(handlePtr);
Marshal.FreeHGlobal(handlePtr);
+
+ this.disposed = true;
}
/// <summary>
@@ -754,9 +766,16 @@ namespace HandBrake.Interop {
if (this.ScanProgress != null)
{
- int currentTitle = state.param.scanning.title_cur;
- int totalTitles = state.param.scanning.title_count;
- this.ScanProgress(this, new ScanProgressEventArgs { CurrentTitle = currentTitle, Titles = totalTitles });
+ hb_state_scanning_anon scanningState = state.param.scanning;
+
+ this.ScanProgress(this, new ScanProgressEventArgs
+ {
+ Progress = scanningState.progress,
+ CurrentPreview = scanningState.preview_cur,
+ Previews = scanningState.preview_count,
+ CurrentTitle = scanningState.title_cur,
+ Titles = scanningState.title_count
+ });
}
}
else if (state.state == NativeConstants.HB_STATE_SCANDONE)
@@ -930,8 +949,9 @@ namespace HandBrake.Interop {
switch (job.RangeType)
{
+ case VideoRangeType.All:
+ break;
case VideoRangeType.Chapters:
-
if (job.ChapterStart > 0 && job.ChapterEnd > 0)
{
nativeJob.chapter_start = job.ChapterStart;
@@ -950,9 +970,13 @@ namespace HandBrake.Interop throw new ArgumentException("Seconds range " + job.SecondsStart + "-" + job.SecondsEnd + " is invalid.", "job");
}
- // For some reason "pts_to_stop" actually means the number of pts to stop AFTER the start point.
- nativeJob.pts_to_start = (int)(job.SecondsStart * 90000);
- nativeJob.pts_to_stop = (int)((job.SecondsEnd - job.SecondsStart) * 90000);
+ // If they've selected the "full" title duration, leave off the arguments to make it clean
+ if (job.SecondsStart > 0 || job.SecondsEnd < title.Duration.TotalSeconds)
+ {
+ // For some reason "pts_to_stop" actually means the number of pts to stop AFTER the start point.
+ nativeJob.pts_to_start = (int) (job.SecondsStart * 90000);
+ nativeJob.pts_to_stop = (int) ((job.SecondsEnd - job.SecondsStart) * 90000);
+ }
break;
case VideoRangeType.Frames:
if (job.FramesStart < 0 || job.FramesEnd < 0 || job.FramesStart >= job.FramesEnd)
@@ -1005,7 +1029,7 @@ namespace HandBrake.Interop nativeJob.crop[2] = crop.Left;
nativeJob.crop[3] = crop.Right;
- var filterList = new List<IntPtr>();
+ var filterList = new List<hb_filter_object_s>();
// FILTERS: These must be added in the correct order since we cannot depend on the automatic ordering in hb_add_filter . Ordering is determined
// by the order they show up in the filters enum.
@@ -1115,7 +1139,7 @@ namespace HandBrake.Interop }
string vfrSettings = string.Format(CultureInfo.InvariantCulture, "{0}:{1}:{2}", nativeJob.cfr, nativeJob.vrate, nativeJob.vrate_base);
- this.AddFilter(filterList, (int) hb_filter_ids.HB_FILTER_VFR, vfrSettings, allocatedMemory);
+ this.AddFilter(filterList, (int)hb_filter_ids.HB_FILTER_VFR, vfrSettings, allocatedMemory);
// Deblock
if (profile.Deblock > 0)
@@ -1296,12 +1320,9 @@ namespace HandBrake.Interop nativeJob.crop[1],
nativeJob.crop[2],
nativeJob.crop[3]);
- this.AddFilter(filterList, (int) hb_filter_ids.HB_FILTER_CROP_SCALE, cropScaleSettings, allocatedMemory);
+ this.AddFilter(filterList, (int)hb_filter_ids.HB_FILTER_CROP_SCALE, cropScaleSettings, allocatedMemory);
+
- // Construct final filter list
- NativeList filterListNative = InteropUtilities.CreateIntPtrList(filterList);
- nativeJob.list_filter = filterListNative.ListPtr;
- allocatedMemory.AddRange(filterListNative.AllocatedMemory);
@@ -1432,8 +1453,17 @@ namespace HandBrake.Interop }
}
}
+
+ bool hasBurnedSubtitle = job.Subtitles.SourceSubtitles.Any(s => s.BurnedIn);
+ if (hasBurnedSubtitle)
+ {
+ this.AddFilter(filterList, (int)hb_filter_ids.HB_FILTER_RENDER_SUB, string.Format(CultureInfo.InvariantCulture, "{0}:{1}:{2}:{3}", crop.Top, crop.Bottom, crop.Left, crop.Right), allocatedMemory);
+ }
}
+ // Construct final filter list
+ nativeJob.list_filter = this.ConvertFilterListToNative(filterList, allocatedMemory).ListPtr;
+
if (profile.OutputFormat == Container.Mp4)
{
nativeJob.mux = NativeConstants.HB_MUX_MP4;
@@ -1528,18 +1558,42 @@ namespace HandBrake.Interop /// <param name="filterType">The type of filter.</param>
/// <param name="settings">Settings for the filter.</param>
/// <param name="allocatedMemory">The list of allocated memory.</param>
- private void AddFilter(List<IntPtr> filterList, int filterType, string settings, List<IntPtr> allocatedMemory)
+ private void AddFilter(List<hb_filter_object_s> filterList, int filterType, string settings, List<IntPtr> allocatedMemory)
{
IntPtr settingsNativeString = Marshal.StringToHGlobalAnsi(settings);
hb_filter_object_s filter = InteropUtilities.ReadStructure<hb_filter_object_s>(HBFunctions.hb_filter_init(filterType));
filter.settings = settingsNativeString;
- IntPtr filterPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_filter_object_s)));
- Marshal.StructureToPtr(filter, filterPtr, false);
-
- filterList.Add(filterPtr);
allocatedMemory.Add(settingsNativeString);
- allocatedMemory.Add(filterPtr);
+ filterList.Add(filter);
+ }
+
+ /// <summary>
+ /// Converts the given filter list to a native list.
+ /// </summary>
+ /// <remarks>Sorts the list by filter ID before converting to a native list, as HB expects it that way.
+ /// The list memory itself will be added to the allocatedMemory list.</remarks>
+ /// <param name="filterList">The filter list to convert.</param>
+ /// <param name="allocatedMemory">The list of allocated memory to add to.</param>
+ /// <returns>The converted list.</returns>
+ private NativeList ConvertFilterListToNative(List<hb_filter_object_s> filterList, List<IntPtr> allocatedMemory)
+ {
+ var filterPtrList = new List<IntPtr>();
+
+ var sortedList = filterList.OrderBy(f => f.id);
+ foreach (var filter in sortedList)
+ {
+ IntPtr filterPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(hb_filter_object_s)));
+ Marshal.StructureToPtr(filter, filterPtr, false);
+
+ allocatedMemory.Add(filterPtr);
+ filterPtrList.Add(filterPtr);
+ }
+
+ NativeList filterListNative = InteropUtilities.CreateIntPtrList(filterPtrList);
+ allocatedMemory.AddRange(filterListNative.AllocatedMemory);
+
+ return filterListNative;
}
/// <summary>
@@ -1684,7 +1738,8 @@ namespace HandBrake.Interop Playlist = title.playlist,
Resolution = new Size(title.width, title.height),
ParVal = new Size(title.pixel_aspect_width, title.pixel_aspect_height),
- Duration = TimeSpan.FromSeconds(title.duration / 90000),
+ Duration = Converters.PtsToTimeSpan(title.duration),
+ DurationPts = title.duration,
AutoCropDimensions = new Cropping
{
Top = title.crop[0],
@@ -1796,7 +1851,8 @@ namespace HandBrake.Interop var newChapter = new Chapter
{
ChapterNumber = chapter.index,
- Duration = TimeSpan.FromSeconds(((double)chapter.duration) / 90000)
+ Duration = Converters.PtsToTimeSpan(chapter.duration),
+ DurationPts = chapter.duration
};
newTitle.Chapters.Add(newChapter);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs index 568e41a31..6833dfc36 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HandBrakeUtils.cs @@ -197,7 +197,8 @@ namespace HandBrake.Interop throw new ArgumentException("height must be positive.");
}
- return HBFunctions.hb_x264_param_unparse(
+ HBFunctions.hb_init(0, 0);
+ IntPtr ptr = HBFunctions.hb_x264_param_unparse(
preset,
string.Join(",", tunes),
extraOptions,
@@ -205,6 +206,11 @@ namespace HandBrake.Interop level,
width,
height);
+
+ string x264Settings = Marshal.PtrToStringAnsi(ptr);
+
+
+ return x264Settings;
}
/// <summary>
@@ -217,6 +223,8 @@ namespace HandBrake.Interop {
switch (job.RangeType)
{
+ case VideoRangeType.All:
+ return title.Duration.TotalSeconds;
case VideoRangeType.Chapters:
TimeSpan duration = TimeSpan.Zero;
for (int i = job.ChapterStart; i <= job.ChapterEnd; i++)
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs index cd4ca877d..00130a902 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/HbFunctions.cs @@ -338,7 +338,7 @@ namespace HandBrake.Interop.HbLib public static extern int hb_check_h264_level([In] [MarshalAs(UnmanagedType.LPStr)] string level, int width, int height, int fps_num, int fps_den, int interlaced, int fake_interlaced);
[DllImport("hb.dll", EntryPoint = "hb_x264_param_unparse", CallingConvention = CallingConvention.Cdecl)]
- public static extern string hb_x264_param_unparse(
+ public static extern IntPtr hb_x264_param_unparse(
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_preset,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_tune,
[In] [MarshalAs(UnmanagedType.LPStr)] string x264_encopts,
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs index fd464b7c8..c34f5daf5 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/Misc.cs @@ -145,6 +145,12 @@ namespace HandBrake.Interop.HbLib [StructLayout(LayoutKind.Sequential)]
public struct hb_state_scanning_anon
{
+ public float progress;
+
+ public int preview_cur;
+
+ public int preview_count;
+
/// int
public int title_cur;
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs index e7a841251..23181e7fe 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/NativeConstants.cs @@ -12,7 +12,7 @@ namespace HandBrake.Interop.HbLib {
public partial class NativeConstants
{
- public const uint HB_ACODEC_MASK = 0x001FFF00;
+ public const uint HB_ACODEC_MASK = 0x00FFFF00;
public const uint HB_ACODEC_FAAC = 0x00000100;
public const uint HB_ACODEC_LAME = 0x00000200;
public const uint HB_ACODEC_VORBIS = 0x00000400;
@@ -26,7 +26,9 @@ namespace HandBrake.Interop.HbLib public const uint HB_ACODEC_DCA_HD = 0x00040000;
public const uint HB_ACODEC_MP3 = 0x00080000;
public const uint HB_ACODEC_FFFLAC = 0x00100000;
- public const uint HB_ACODEC_FF_MASK = 0x001f2000;
+ public const uint HB_ACODEC_FDK_AAC = 0x00400000;
+ public const uint HB_ACODEC_FDK_HAAC = 0x00800000;
+ public const uint HB_ACODEC_FF_MASK = 0x00FF2000;
public const uint HB_ACODEC_PASS_FLAG = 0x40000000;
public const uint HB_ACODEC_PASS_MASK = (HB_ACODEC_MP3 | HB_ACODEC_FFAAC | HB_ACODEC_DCA_HD | HB_ACODEC_AC3 | HB_ACODEC_DCA);
public const uint HB_ACODEC_AUTO_PASS = (HB_ACODEC_PASS_MASK | HB_ACODEC_PASS_FLAG);
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs index 26b836094..a219c3db9 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_audio.cs @@ -69,6 +69,8 @@ namespace HandBrake.Interop.HbLib public int normalize_mix_level;
+ public int dither_method;
+
public IntPtr name;
}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs index 562531083..751fc821e 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/HbLib/hb_job_s.cs @@ -92,14 +92,14 @@ namespace HandBrake.Interop.HbLib public int fastfirstpass;
- public IntPtr advanced_opts;
-
- public IntPtr x264_profile;
-
public IntPtr x264_preset;
public IntPtr x264_tune;
+ public IntPtr advanced_opts;
+
+ public IntPtr h264_profile;
+
public IntPtr h264_level;
/// int
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs index a99005e77..afde441e5 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Model/VideoRangeType.cs @@ -9,29 +9,35 @@ namespace HandBrake.Interop.Model
{
- using System.ComponentModel.DataAnnotations;
+ using System.ComponentModel.DataAnnotations;
- /// <summary>
- /// The video range type.
- /// </summary>
- public enum VideoRangeType
- {
- /// <summary>
- /// The chapters.
- /// </summary>
- [Display(Name = "Chapters")]
- Chapters,
+ /// <summary>
+ /// The video range type.
+ /// </summary>
+ public enum VideoRangeType
+ {
+ /// <summary>
+ /// The entire title.
+ /// </summary>
+ [Display(Name = "All")]
+ All,
- /// <summary>
- /// The seconds.
- /// </summary>
- [Display(Name = "Seconds")]
- Seconds,
+ /// <summary>
+ /// A chapter range.
+ /// </summary>
+ [Display(Name = "Chapters")]
+ Chapters,
- /// <summary>
- /// The frames.
- /// </summary>
- [Display(Name = "Frames")]
- Frames
- }
+ /// <summary>
+ /// A timespan range in seconds.
+ /// </summary>
+ [Display(Name = "Seconds")]
+ Seconds,
+
+ /// <summary>
+ /// A frame range.
+ /// </summary>
+ [Display(Name = "Frames")]
+ Frames
+ }
}
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs index 7536fd261..936eb0fa9 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.35.0.0")]
-[assembly: AssemblyFileVersion("1.35.0.0")]
+[assembly: AssemblyVersion("1.40.0.0")]
+[assembly: AssemblyFileVersion("1.40.0.0")]
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs index efec79d75..411a8d851 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Chapter.cs @@ -23,11 +23,16 @@ namespace HandBrake.Interop.SourceData public int ChapterNumber { get; set; }
/// <summary>
- /// Gets or sets the length in time this Chapter spans
+ /// Gets or sets the duration of this chapter.
/// </summary>
public TimeSpan Duration { get; set; }
/// <summary>
+ /// Gets or sets the duration of this chapter in PTS.
+ /// </summary>
+ public ulong DurationPts { get; set; }
+
+ /// <summary>
/// Override of the ToString method to make this object easier to use in the UI
/// </summary>
/// <returns>A string formatted as: {chapter #}</returns>
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs index 57201e847..8c7d65412 100644 --- a/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs +++ b/win/CS/HandBrake.Interop/HandBrakeInterop/SourceData/Title.cs @@ -84,11 +84,16 @@ namespace HandBrake.Interop.SourceData public int Playlist { get; set; }
/// <summary>
- /// Gets or sets the length in time of this Title
+ /// Gets or sets the duration of this title.
/// </summary>
public TimeSpan Duration { get; set; }
/// <summary>
+ /// Gets or sets the duration of the title in PTS.
+ /// </summary>
+ public ulong DurationPts { get; set; }
+
+ /// <summary>
/// Gets or sets the resolution (width/height) of this Title
/// </summary>
public Size Resolution { get; set; }
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs index e2ccbcbda..7db59a4d0 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs +++ b/win/CS/HandBrakeWPF/Properties/Resources.Designer.cs @@ -386,7 +386,8 @@ namespace HandBrakeWPF.Properties { }
/// <summary>
- /// Looks up a localized string similar to The full x264 list of parameters: {0}.
+ /// Looks up a localized string similar to The full x264 list of parameters:
+ ///{0}.
/// </summary>
public static string Video_x264ExtraArgs {
get {
diff --git a/win/CS/HandBrakeWPF/Properties/Resources.resx b/win/CS/HandBrakeWPF/Properties/Resources.resx index b39ace5a5..fed5d3923 100644 --- a/win/CS/HandBrakeWPF/Properties/Resources.resx +++ b/win/CS/HandBrakeWPF/Properties/Resources.resx @@ -238,7 +238,8 @@ may have problems with Weighted P-frame prediction: the Apple TV is completely i <value>..\Resources\logo64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Video_x264ExtraArgs" xml:space="preserve">
- <value>The full x264 list of parameters: {0}</value>
+ <value>The full x264 list of parameters:
+{0}</value>
</data>
<data name="Video_x264FastDecode" xml:space="preserve">
<value>Reduce decoder CPU usage.
diff --git a/win/CS/HandBrakeWPF/UserSettingConstants.cs b/win/CS/HandBrakeWPF/UserSettingConstants.cs index a90094cb5..1f4c02fce 100644 --- a/win/CS/HandBrakeWPF/UserSettingConstants.cs +++ b/win/CS/HandBrakeWPF/UserSettingConstants.cs @@ -196,6 +196,11 @@ namespace HandBrakeWPF /// </summary>
public const string LastPreviewDuration = "LastPreviewDuration";
+ /// <summary>
+ /// Disable LibHb Features
+ /// </summary>
+ public const string DisableLibHbFeatures = "DisableLibHbFeatures";
+
#endregion
}
}
\ No newline at end of file diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs index aa447e2e2..f4f496fcb 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs @@ -12,8 +12,6 @@ namespace HandBrakeWPF.ViewModels using System.Collections.Generic;
using System.Windows;
- using Caliburn.Micro;
-
using HandBrake.ApplicationServices.Model;
using HandBrake.ApplicationServices.Services;
using HandBrake.ApplicationServices.Services.Interfaces;
@@ -27,6 +25,8 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public class AddPresetViewModel : ViewModelBase, IAddPresetViewModel
{
+ /* TODO this window is up for redesign. Quite a few nippy edge cases that can cause odd behaviour with importing presets. */
+
/// <summary>
/// Backing field for the Preset Service
/// </summary>
@@ -50,16 +50,13 @@ namespace HandBrakeWPF.ViewModels /// <summary>
/// Initializes a new instance of the <see cref="AddPresetViewModel"/> class.
/// </summary>
- /// <param name="windowManager">
- /// The window manager.
- /// </param>
/// <param name="presetService">
/// The Preset Service
/// </param>
/// <param name="errorService">
/// The Error Service
/// </param>
- public AddPresetViewModel(IWindowManager windowManager, IPresetService presetService, IErrorService errorService)
+ public AddPresetViewModel(IPresetService presetService, IErrorService errorService)
{
this.presetService = presetService;
this.errorService = errorService;
@@ -151,6 +148,12 @@ namespace HandBrakeWPF.ViewModels }
}
+ if (this.SelectedPictureSettingMode == PresetPictureSettingsMode.SourceMaximum && (this.Preset.Task.Width == null || this.Preset.Task.Width == 0))
+ {
+ this.errorService.ShowMessageBox("You must first scan a source to use the 'Source Maximum' Option.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
+ return;
+ }
+
this.Preset.UsePictureFilters = this.Preset.UsePictureFilters;
this.Preset.PictureSettingsMode = this.SelectedPictureSettingMode;
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs index 516fc7642..2146b1c6c 100644 --- a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs @@ -9,6 +9,7 @@ namespace HandBrakeWPF.ViewModels
{
+ using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
@@ -37,6 +38,8 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private IEnumerable<Audio> sourceTracks;
+ private Preset currentPreset;
+
#region Constructors and Destructors
/// <summary>
@@ -196,6 +199,7 @@ namespace HandBrakeWPF.ViewModels public void SetPreset(Preset preset, EncodeTask task)
{
this.Task = task;
+ this.currentPreset = preset;
if (preset != null && preset.Task != null)
{
@@ -357,7 +361,7 @@ namespace HandBrakeWPF.ViewModels return;
}
- // Default all the language tracks to the preferred or first language of this source.
+ // We've changed source, so lets try reset the language, description and formats as close as possible to the previous track.
foreach (AudioTrack track in this.Task.AudioTracks)
{
track.ScannedTrack = this.GetPreferredAudioTrack();
@@ -365,6 +369,14 @@ namespace HandBrakeWPF.ViewModels // Handle the default selection behaviour.
int mode = this.UserSettingService.GetUserSetting<int>(UserSettingConstants.DubModeAudio);
+ if (mode == 1 || mode == 2)
+ {
+ // First, we'll clear out all current tracks and go back to what the current preset has.
+ // This will alteast provide a consistent behavior when switching tracks.
+ this.Task.AudioTracks.Clear();
+ this.AddTracksFromPreset(this.currentPreset);
+ }
+
switch (mode)
{
case 1: // Adding all remaining audio tracks
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs index 04d466062..b36da2e65 100644 --- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs @@ -1122,6 +1122,11 @@ namespace HandBrakeWPF.ViewModels return;
}
+ if (this.CurrentTask != null && this.CurrentTask.SubtitleTracks != null && this.CurrentTask.SubtitleTracks.Count > 0)
+ {
+ this.errorService.ShowMessageBox("Warning: It is not currently possible to use this feature if you require specific subtitle or audio tracks that the automatic selection feature (see options) doesn't support! Tracks are reset with every new source / title selected.", "Warning", MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+
foreach (Title title in this.ScannedSource.Titles)
{
this.SelectedTitle = title;
@@ -1546,15 +1551,27 @@ namespace HandBrakeWPF.ViewModels /// </summary>
public void PresetExport()
{
- VistaSaveFileDialog savefiledialog = new VistaSaveFileDialog { Filter = "plist|*.plist", CheckPathExists = true, AddExtension = true };
+ VistaSaveFileDialog savefiledialog = new VistaSaveFileDialog
+ {
+ Filter = "plist|*.plist",
+ CheckPathExists = true,
+ AddExtension = true,
+ DefaultExt = ".plist",
+ OverwritePrompt = true,
+ FilterIndex = 0
+ };
if (this.selectedPreset != null)
{
savefiledialog.ShowDialog();
string filename = savefiledialog.FileName;
- if (filename != null)
+ if (!string.IsNullOrEmpty(filename))
{
- PlistUtility.Export(savefiledialog.FileName, this.selectedPreset, userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild).ToString(CultureInfo.InvariantCulture));
+ PlistUtility.Export(
+ savefiledialog.FileName,
+ this.selectedPreset,
+ userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild)
+ .ToString(CultureInfo.InvariantCulture));
}
}
else
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs index af4dce85b..8156aa806 100644 --- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs @@ -142,6 +142,11 @@ namespace HandBrakeWPF.ViewModels private bool disableLibdvdNav;
/// <summary>
+ /// The disable libhb features
+ /// </summary>
+ private bool disableLibhbFeatures;
+
+ /// <summary>
/// The disable p reset update check notification.
/// </summary>
private bool disablePresetUpdateCheckNotification;
@@ -1342,6 +1347,24 @@ namespace HandBrakeWPF.ViewModels }
}
+ /// <summary>
+ /// Gets or sets a value indicating whether DisableLibdvdNav.
+ /// </summary>
+ public bool DisableLibHbFeatures
+ {
+ get
+ {
+ return this.disableLibhbFeatures;
+ }
+
+ set
+ {
+ this.disableLibhbFeatures = value;
+ this.NotifyOfPropertyChange("DisableLibHbFeatures");
+ }
+ }
+
+
#endregion
#endregion
@@ -1636,6 +1659,9 @@ namespace HandBrakeWPF.ViewModels this.EnableProcessIsolation = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableProcessIsolation);
this.EnableDebugFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableDebugFeatures);
this.EnableLibHb = userSettingService.GetUserSetting<bool>(UserSettingConstants.EnableLibHb);
+
+ // LibHbFeatures
+ this.DisableLibHbFeatures = userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures);
}
/// <summary>
@@ -1840,6 +1866,7 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(ASUserSettingConstants.PreviewScanCount, this.SelectedPreviewCount);
userSettingService.SetUserSetting(UserSettingConstants.X264Step, double.Parse(this.SelectedGranulairty, CultureInfo.InvariantCulture));
userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);
+ userSettingService.SetUserSetting(UserSettingConstants.ShowAdvancedTab, this.ShowAdvancedTab);
int value;
if (int.TryParse(this.MinLength.ToString(CultureInfo.InvariantCulture), out value))
@@ -1851,7 +1878,7 @@ namespace HandBrakeWPF.ViewModels userSettingService.SetUserSetting(UserSettingConstants.EnableProcessIsolation, this.EnableProcessIsolation);
userSettingService.SetUserSetting(UserSettingConstants.ServerPort, this.ServerPort.ToString());
userSettingService.SetUserSetting(UserSettingConstants.EnableDebugFeatures, this.EnableDebugFeatures);
- userSettingService.SetUserSetting(UserSettingConstants.EnableLibHb, this.EnableLibHb);
+ userSettingService.SetUserSetting(UserSettingConstants.DisableLibHbFeatures, this.DisableLibHbFeatures);
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs index 4c01f8f35..1a6c90538 100644 --- a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs @@ -33,6 +33,7 @@ namespace HandBrakeWPF.ViewModels * - We are not handling cropping correctly within the UI.
* - The Height is not correctly set when using no Anamorphic
* - Maintain Aspect ratio needs corrected.
+ * - Custom Anamorphic.
*
*/
#region Constants and Fields
@@ -92,6 +93,11 @@ namespace HandBrakeWPF.ViewModels /// </summary>
private int maxWidth;
+ /// <summary>
+ /// The show keep ar backing field.
+ /// </summary>
+ private bool showKeepAr = true;
+
#endregion
#region Constructors and Destructors
@@ -560,6 +566,22 @@ namespace HandBrakeWPF.ViewModels }
}
+ /// <summary>
+ /// Gets or sets a value indicating whether show keep ar.
+ /// </summary>
+ public bool ShowKeepAR
+ {
+ get
+ {
+ return this.showKeepAr;
+ }
+ set
+ {
+ this.showKeepAr = value;
+ this.NotifyOfPropertyChange(() => this.ShowKeepAR);
+ }
+ }
+
#endregion
#region Implemented Interfaces
@@ -780,6 +802,7 @@ namespace HandBrakeWPF.ViewModels this.CalculateAnamorphicSizes().Height);
this.ShowDisplaySize = true;
+ this.ShowKeepAR = true;
switch (this.SelectedAnamorphicMode)
{
case Anamorphic.None:
@@ -788,6 +811,7 @@ namespace HandBrakeWPF.ViewModels this.ShowCustomAnamorphicControls = false;
this.ShowModulus = true;
this.ShowDisplaySize = false;
+ this.ShowKeepAR = true;
this.SelectedModulus = 16; // Reset
this.Width = this.sourceResolution.Width;
this.SetDisplaySize();
@@ -798,6 +822,7 @@ namespace HandBrakeWPF.ViewModels this.ShowCustomAnamorphicControls = false;
this.ShowModulus = false;
this.SelectedModulus = 16; // Reset
+ this.ShowKeepAR = false;
this.Width = 0;
this.Height = 0;
@@ -811,6 +836,7 @@ namespace HandBrakeWPF.ViewModels this.ShowModulus = true;
this.Width = this.sourceResolution.Width;
this.Height = 0;
+ this.ShowKeepAR = false;
this.SetDisplaySize();
break;
@@ -819,8 +845,10 @@ namespace HandBrakeWPF.ViewModels this.WidthControlEnabled = true;
this.HeightControlEnabled = true;
this.ShowCustomAnamorphicControls = true;
- this.MaintainAspectRatio = true;
+ this.MaintainAspectRatio = false; // TODO Fix when implementing custom
this.ShowModulus = true;
+ this.ShowDisplaySize = false; // Disabled for Custom until we implement it properly. TODO
+ this.ShowKeepAR = false;
// Ignore any of the users current settings and reset to source to make things easier.
this.Width = this.sourceResolution.Width;
@@ -834,7 +862,7 @@ namespace HandBrakeWPF.ViewModels this.DisplayWidth = (this.Width * this.ParWidth / this.ParHeight);
}
- this.SetDisplaySize();
+ //this.SetDisplaySize();
break;
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs index cb0f0986c..90dae495f 100644 --- a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs @@ -382,7 +382,7 @@ namespace HandBrakeWPF.ViewModels SourceTrack = source,
};
- if (source.SubtitleType == SubtitleType.PGS &&
+ if ((source.SubtitleType == SubtitleType.PGS || source.SubtitleType == SubtitleType.VobSub) &&
this.Task != null &&
(this.Task.OutputFormat == OutputFormat.Mp4 || this.Task.OutputFormat == OutputFormat.M4V))
{
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs index a59105084..514b45d5d 100644 --- a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs +++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs @@ -28,6 +28,7 @@ namespace HandBrakeWPF.ViewModels using HandBrakeWPF.Commands.Interfaces;
using HandBrakeWPF.Model;
+ using HandBrakeWPF.Properties;
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -497,6 +498,7 @@ namespace HandBrakeWPF.ViewModels {
this.Task.ExtraAdvancedArguments = value;
this.NotifyOfPropertyChange(() => this.ExtraArguments);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -514,6 +516,7 @@ namespace HandBrakeWPF.ViewModels {
this.displayX264Options = value;
this.NotifyOfPropertyChange(() => this.DisplayX264Options);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
@@ -533,6 +536,7 @@ namespace HandBrakeWPF.ViewModels this.x264PresetValue = value;
this.X264Preset = this.X264Presets[value];
this.NotifyOfPropertyChange(() => this.x264PresetValue);
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -553,6 +557,7 @@ namespace HandBrakeWPF.ViewModels this.Task.X264Preset = value;
this.NotifyOfPropertyChange(() => this.X264Preset);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -574,6 +579,7 @@ namespace HandBrakeWPF.ViewModels this.Task.H264Profile = value;
this.NotifyOfPropertyChange(() => this.H264Profile);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -594,6 +600,7 @@ namespace HandBrakeWPF.ViewModels this.Task.H264Level = value;
this.NotifyOfPropertyChange(() => this.H264Level);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -614,6 +621,7 @@ namespace HandBrakeWPF.ViewModels this.Task.X264Tune = value;
this.NotifyOfPropertyChange(() => this.X264Tune);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -634,6 +642,7 @@ namespace HandBrakeWPF.ViewModels this.Task.FastDecode = value;
this.NotifyOfPropertyChange(() => this.FastDecode);
ResetAdvancedTab();
+ this.NotifyOfPropertyChange(() => FullOptionsTooltip);
}
}
}
@@ -665,7 +674,7 @@ namespace HandBrakeWPF.ViewModels {
get
{
- return "You can provide additional arguments using the standard x264 format"; // string.Format(Resources.Video_x264ExtraArgs, this.GetActualx264Query());
+ return string.Format(Resources.Video_x264ExtraArgs, this.GetActualx264Query()); // "You can provide additional arguments using the standard x264 format";
}
}
@@ -897,13 +906,18 @@ namespace HandBrakeWPF.ViewModels /// </returns>
private string GetActualx264Query()
{
- string preset = EnumHelper<x264Preset>.GetDisplay(this.X264Preset);
- string profile = EnumHelper<x264Profile>.GetDisplay(this.H264Profile);
+ if (this.userSettingService.GetUserSetting<bool>(UserSettingConstants.DisableLibHbFeatures))
+ {
+ return string.Empty; // Feature is disabled.
+ }
+
+ string preset = EnumHelper<x264Preset>.GetDisplay(this.X264Preset).ToLower().Replace(" ", string.Empty);
+ string profile = EnumHelper<x264Profile>.GetDisplay(this.H264Profile).ToLower();
List<string> tunes = new List<string>();
if (X264Tune != x264Tune.None)
{
- tunes.Add(EnumHelper<x264Tune>.GetDisplay(this.X264Tune));
+ tunes.Add(this.X264Tune.ToString().ToLower().Replace(" ", string.Empty)); // TODO tidy this sillyness up.
}
if (this.FastDecode)
{
@@ -914,6 +928,16 @@ namespace HandBrakeWPF.ViewModels int width = this.Task.Width.HasValue ? this.Task.Width.Value : 720;
int height = this.Task.Height.HasValue ? this.Task.Height.Value : 576;
+ if (height == 0)
+ {
+ height = 576;
+ }
+
+ if (width == 0)
+ {
+ width = 720;
+ }
+
// TODO figure out what is wrong with this??
return HandBrakeUtils.CreateX264OptionsString(preset, tunes, this.ExtraArguments, profile, this.H264Level, width, height);
}
diff --git a/win/CS/HandBrakeWPF/Views/OptionsView.xaml b/win/CS/HandBrakeWPF/Views/OptionsView.xaml index 0394adbff..c2e88150d 100644 --- a/win/CS/HandBrakeWPF/Views/OptionsView.xaml +++ b/win/CS/HandBrakeWPF/Views/OptionsView.xaml @@ -294,6 +294,7 @@ <CheckBox Content="Disable built-in preset update notification" IsChecked="{Binding DisablePresetUpdateCheckNotification}" />
<CheckBox Content="Always clear completed queue items after an encode completes" IsChecked="{Binding ClearQueueOnEncodeCompleted}" />
<CheckBox Content="Show Advanced Tab" IsChecked="{Binding ShowAdvancedTab}" />
+ <CheckBox Content="Disable LibHB Features" IsChecked="{Binding DisableLibHbFeatures}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
<TextBlock Text="Number of picture previews to scan:" VerticalAlignment="Center" Width="250" />
<ComboBox Name="numberOfPreviews" ItemsSource="{Binding PreviewPicturesToScan}" SelectedItem="{Binding SelectedPreviewCount}" Width="120" />
@@ -365,7 +366,7 @@ <StackPanel Orientation="Vertical" Grid.Column="1" Margin="20,0,0,0">
- <CheckBox Content="Enable LibHB (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
+ <CheckBox Content="Enable LibHB Scanning and Encoding (uses hb.dll instead of HandBrakeCLI.exe)" Margin="0,5,0,0" IsChecked="{Binding EnableLibHb}" />
<CheckBox Content="Enable Process Isolation (Run Scans and Encodes via an intermediate service)" Margin="20,10,0,0" IsChecked="{Binding EnableProcessIsolation}" />
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Column="1">
<TextBlock Text="Server Port:" VerticalAlignment="Center" />
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml index e7f5bbb35..c9aa0d69b 100644 --- a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml +++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml @@ -7,6 +7,7 @@ <UserControl.Resources>
<Converters:BooleanConverter x:Key="boolConverter" />
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
+ <Converters:BooleanToHiddenVisibilityConverter x:Key="boolToVisHiddenConverter" />
<Style TargetType="controls:NumberBox">
<Setter Property="Height" Value="24" />
</Style>
@@ -32,7 +33,9 @@ <Label Content="Height:" Grid.Row="1" Grid.Column="2" />
<controls:NumberBox Number="{Binding Height, Mode=TwoWay}" IsEnabled="{Binding HeightControlEnabled}" Modulus="{Binding SelectedModulus, Mode=OneWay}"
Minimum="0" Grid.Row="1" Grid.Column="3" Width="60" />
- <CheckBox Content="Keep Aspect Ratio" IsChecked="{Binding MaintainAspectRatio}" VerticalAlignment="Center" Margin="5,0,0,0" />
+ <CheckBox Content="Keep Aspect Ratio" IsChecked="{Binding MaintainAspectRatio}"
+ Visibility="{Binding ShowKeepAR, Converter={StaticResource boolToVisHiddenConverter}}"
+ VerticalAlignment="Center" Margin="5,0,0,0" />
</StackPanel>
<!-- Row 3-->
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml index 313216def..9e098596a 100644 --- a/win/CS/HandBrakeWPF/Views/VideoView.xaml +++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml @@ -17,6 +17,16 @@ <Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
</Style>
+
+ <Style TargetType="ToolTip">
+ <Setter Property="ContentTemplate">
+ <Setter.Value>
+ <DataTemplate>
+ <TextBlock TextWrapping="Wrap" Width="450" Text="{Binding}" />
+ </DataTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
</UserControl.Resources>
<Grid Margin="10,5,0,0">
@@ -177,7 +187,7 @@ <TextBlock Text="Extra Options:" Grid.Row="4" Grid.Column="0" Margin="0,10,0,0" VerticalAlignment="Center" HorizontalAlignment="Left" />
<TextBox Text="{Binding ExtraArguments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Height="30" MaxLines="2" Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="3" Margin="5,10,0,0" VerticalAlignment="Center"
- ToolTip="{Binding FullOptionsTooltip}"/>
+ ToolTip="{Binding FullOptionsTooltip}" Style="{StaticResource LongToolTipHolder}" />
</Grid>
diff --git a/win/CS/HandBrakeWPF/defaultsettings.xml b/win/CS/HandBrakeWPF/defaultsettings.xml index 690930721..d14f6f7f3 100644 --- a/win/CS/HandBrakeWPF/defaultsettings.xml +++ b/win/CS/HandBrakeWPF/defaultsettings.xml @@ -440,4 +440,12 @@ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:int" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">30</anyType>
</value>
</item>
+ <item>
+ <key>
+ <string>DisableLibHbFeatures</string>
+ </key>
+ <value>
+ <anyType xmlns:q1="http://www.w3.org/2001/XMLSchema" d4p1:type="q1:boolean" xmlns:d4p1="http://www.w3.org/2001/XMLSchema-instance">false</anyType>
+ </value>
+ </item>
</dictionary>
\ 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 index 37d4ff9b9..297f4bf28 100644 --- a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.XML +++ b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.XML @@ -4,6 +4,34 @@ <name>GongSolutions.Wpf.DragDrop</name>
</assembly>
<members>
+ <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.IDragInfo)">
+ <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="M:GongSolutions.Wpf.DragDrop.IDragSource.Dropped(GongSolutions.Wpf.DragDrop.IDropInfo)">
+ <summary>
+ Notifies the drag handler that a drop has occurred.
+ </summary>
+
+ <param name="dropInfo">
+ Information about the drop.
+ </param>
+ </member>
<member name="T:GongSolutions.Wpf.DragDrop.IDropTarget">
<summary>
Interface implemented by Drop Handlers.
@@ -33,130 +61,197 @@ Information about the drop.
</param>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.Data">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.Data">
<summary>
- Gets the drag data.
+ Gets or sets the drag data.
</summary>
<remarks>
- If the drag came from within the framework, this will hold:
+ This must be set by a drag handler in order for a drag to start.
+ </remarks>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.DragStartPosition">
+ <summary>
+ Gets the position of the click that initiated the drag, relative to <see cref="P:GongSolutions.Wpf.DragDrop.IDragInfo.VisualSource"/>.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.PositionInDraggedItem">
+ <summary>
+ Gets the point where the cursor was relative to the item being dragged when the drag was started.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.Effects">
+ <summary>
+ Gets or sets the allowed effects for the drag.
+ </summary>
- - The dragged data if a single item was dragged.
- - A typed IEnumerable if multiple items were dragged.
+ <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.IDropInfo.DragInfo">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.MouseButton">
<summary>
- Gets a <see cref="P:GongSolutions.Wpf.DragDrop.IDropInfo.DragInfo"/> object holding information about the source of the drag,
- if the drag came from within the framework.
+ Gets the mouse button that initiated the drag.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.DropPosition">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.SourceCollection">
<summary>
- Gets the mouse position relative to the VisualTarget
+ 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.IDropInfo.DropTargetAdorner">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.SourceItem">
<summary>
- Gets or sets the class of drop target to display.
+ Gets the object that a dragged item is bound to.
</summary>
<remarks>
- The standard drop target adorner classes are held in the <see cref="T:GongSolutions.Wpf.DragDrop.DropTargetAdorners"/>
- class.
+ 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.IDropInfo.Effects">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.SourceItems">
<summary>
- Gets or sets the allowed effects for the drop.
+ Gets a collection of objects that the selected items in an ItemsControl are bound to.
</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.
+ 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.IDropInfo.InsertIndex">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.VisualSource">
<summary>
- Gets the current insert position within <see cref="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetCollection"/>.
+ Gets the control that initiated the drag.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetCollection">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.VisualSourceItem">
<summary>
- Gets the collection that the target ItemsControl is bound to.
+ Gets the item in an ItemsControl that started the drag.
</summary>
<remarks>
- If the current drop target is unbound or not an ItemsControl, this will be null.
+ 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.IDragInfo.VisualSource"/> is a ListBox this
+ will hold a ListBoxItem.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetItem">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.DataObject">
<summary>
- Gets the object that the current drop target is bound to.
+ Gets the <see cref="T:System.Windows.IDataObject"/> which is used by the drag and drop operation. Set it to
+ a custom instance if custom drag and drop behavior is needed.
+ </summary>
+ </member>
+ <member name="T:GongSolutions.Wpf.DragDrop.DragInfo">
+ <summary>
+ Holds information about a the source of a drag drop operation.
</summary>
<remarks>
- If the current drop target is unbound or not an ItemsControl, this will be null.
+ 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.IDragInfo)"/> to determine whether a drag
+ can start, and what the dragged data should be.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetGroup">
+ <member name="M:GongSolutions.Wpf.DragDrop.DragInfo.#ctor(System.Object,System.Windows.Input.MouseButtonEventArgs)">
<summary>
- Gets the current group target.
+ 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>
- If the drag is currently over an ItemsControl with groups, describes the group that
- the drag is currently over.
+ This must be set by a drag handler in order for a drag to start.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.VisualTarget">
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.DragStartPosition">
<summary>
- Gets the control that is the current drop target.
+ 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.IDropInfo.VisualTargetItem">
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.PositionInDraggedItem">
<summary>
- Gets the item in an ItemsControl that is the current drop target.
+ Gets the point where the cursor was relative to the item being dragged when the drag was started.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.Effects">
+ <summary>
+ Gets or sets the allowed effects for the drag.
</summary>
<remarks>
- If the current drop target is unbound or not an ItemsControl, this will be null.
+ 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.IDropInfo.VisualTargetOrientation">
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.MouseButton">
<summary>
- Gets th orientation of the current drop target.
+ Gets the mouse button that initiated the drag.
</summary>
</member>
- <member name="T:GongSolutions.Wpf.DragDrop.DropInfo">
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.SourceCollection">
<summary>
- Holds information about a the target of a drag drop operation.
+ Gets the collection that the source ItemsControl is bound to.
</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.IDropInfo)"/> method to determine whether
- the current drop target is valid, and by <see cref="M:GongSolutions.Wpf.DragDrop.IDropTarget.Drop(GongSolutions.Wpf.DragDrop.IDropInfo)"/> to perform the drop.
+ If the control that initated the drag is unbound or not an ItemsControl, this will be null.
</remarks>
</member>
- <member name="M:GongSolutions.Wpf.DragDrop.DropInfo.#ctor(System.Object,System.Windows.DragEventArgs,GongSolutions.Wpf.DragDrop.DragInfo)">
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.SourceItem">
<summary>
- Initializes a new instance of the DropInfo class.
+ Gets the object that a dragged item is bound to.
</summary>
- <param name="sender">
- The sender of the drag event.
- </param>
+ <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>
- <param name="e">
- The drag event.
- </param>
+ <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>
- <param name="dragInfo">
- Information about the source of the drag, if the drag came from within the framework.
- </param>
+ <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>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.Data">
+ <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.DataObject">
+ <summary>
+ Gets the <see cref="T:System.Windows.IDataObject"/> which is used by the drag and drop operation. Set it to
+ a custom instance if custom drag and drop behavior is needed.
+ </summary>
+ </member>
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.Data">
<summary>
Gets the drag data.
</summary>
@@ -168,18 +263,18 @@ - A typed IEnumerable if multiple items were dragged.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DragInfo">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.DragInfo">
<summary>
- Gets a <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.DragInfo"/> object holding information about the source of the drag,
+ Gets a <see cref="P:GongSolutions.Wpf.DragDrop.IDropInfo.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.DropPosition">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.DropPosition">
<summary>
Gets the mouse position relative to the VisualTarget
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DropTargetAdorner">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.DropTargetAdorner">
<summary>
Gets or sets the class of drop target to display.
</summary>
@@ -189,7 +284,7 @@ class.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.Effects">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.Effects">
<summary>
Gets or sets the allowed effects for the drop.
</summary>
@@ -199,12 +294,12 @@ for a drop to be possible.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.InsertIndex">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.InsertIndex">
<summary>
- Gets the current insert position within <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetCollection"/>.
+ Gets the current insert position within <see cref="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetCollection"/>.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetCollection">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetCollection">
<summary>
Gets the collection that the target ItemsControl is bound to.
</summary>
@@ -213,7 +308,7 @@ 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">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetItem">
<summary>
Gets the object that the current drop target is bound to.
</summary>
@@ -222,7 +317,7 @@ 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">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.TargetGroup">
<summary>
Gets the current group target.
</summary>
@@ -232,12 +327,12 @@ the drag is currently over.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTarget">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.VisualTarget">
<summary>
Gets the control that is the current drop target.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTargetItem">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.VisualTargetItem">
<summary>
Gets the item in an ItemsControl that is the current drop target.
</summary>
@@ -246,206 +341,187 @@ 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">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.VisualTargetOrientation">
<summary>
- Gets th orientation of the current drop target.
+ Gets the orientation of the current drop target.
</summary>
</member>
- <member name="T:GongSolutions.Wpf.DragDrop.IDragSource">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.VisualTargetFlowDirection">
<summary>
- Interface implemented by Drag Handlers.
+ Gets the FlowDirection of the current drop target.
</summary>
</member>
- <member name="M:GongSolutions.Wpf.DragDrop.IDragSource.StartDrag(GongSolutions.Wpf.DragDrop.IDragInfo)">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.DestinationText">
<summary>
- Queries whether a drag can be started.
+ Gets and sets the text displayed in the DropDropEffects adorner.
</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="M:GongSolutions.Wpf.DragDrop.IDragSource.Dropped(GongSolutions.Wpf.DragDrop.IDropInfo)">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.InsertPosition">
<summary>
- Notifies the drag handler that a drop has occurred.
+ Gets the relative position the item will be inserted to compared to the TargetItem
</summary>
-
- <param name="dropInfo">
- Information about the drop.
- </param>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.Data">
+ <member name="P:GongSolutions.Wpf.DragDrop.IDropInfo.KeyStates">
<summary>
- Gets or sets the drag data.
+ Gets a flag enumeration indicating the current state of the SHIFT, CTRL, and ALT keys, as well as the state of the mouse buttons.
+ </summary>
+ </member>
+ <member name="T:GongSolutions.Wpf.DragDrop.DropInfo">
+ <summary>
+ Holds information about a the target of a drag drop operation.
</summary>
<remarks>
- This must be set by a drag handler in order for a drag to start.
+ 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.IDropInfo)"/> method to determine whether
+ the current drop target is valid, and by <see cref="M:GongSolutions.Wpf.DragDrop.IDropTarget.Drop(GongSolutions.Wpf.DragDrop.IDropInfo)"/> to perform the drop.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.DragStartPosition">
+ <member name="M:GongSolutions.Wpf.DragDrop.DropInfo.#ctor(System.Object,System.Windows.DragEventArgs,GongSolutions.Wpf.DragDrop.DragInfo)">
<summary>
- Gets the position of the click that initiated the drag, relative to <see cref="P:GongSolutions.Wpf.DragDrop.IDragInfo.VisualSource"/>.
+ 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.IDragInfo.Effects">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.Data">
<summary>
- Gets or sets the allowed effects for the drag.
+ Gets the drag data.
</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.
+ 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.IDragInfo.MouseButton">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DragInfo">
<summary>
- Gets the mouse button that initiated the drag.
+ 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.IDragInfo.SourceCollection">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DropPosition">
<summary>
- Gets the collection that the source ItemsControl is bound to.
+ Gets the mouse position relative to the VisualTarget
</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.IDragInfo.SourceItem">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DropTargetAdorner">
<summary>
- Gets the object that a dragged item is bound to.
+ Gets or sets the class of drop target to display.
</summary>
<remarks>
- If the control that initated the drag is unbound or not an ItemsControl, this will be null.
+ 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.IDragInfo.SourceItems">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.Effects">
<summary>
- Gets a collection of objects that the selected items in an ItemsControl are bound to.
+ Gets or sets the allowed effects for the drop.
</summary>
<remarks>
- If the control that initated the drag is unbound or not an ItemsControl, this will be empty.
+ 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.IDragInfo.VisualSource">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.InsertIndex">
<summary>
- Gets the control that initiated the drag.
+ Gets the current insert position within <see cref="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetCollection"/>.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.IDragInfo.VisualSourceItem">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetCollection">
<summary>
- Gets the item in an ItemsControl that started the drag.
+ Gets the collection that the target ItemsControl is bound to.
</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.IDragInfo.VisualSource"/> is a ListBox this
- will hold a ListBoxItem.
+ If the current drop target is unbound or not an ItemsControl, this will be null.
</remarks>
</member>
- <member name="T:GongSolutions.Wpf.DragDrop.DragInfo">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetItem">
<summary>
- Holds information about a the source of a drag drop operation.
+ Gets the object that the current drop target is bound to.
</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.IDragInfo)"/> to determine whether a drag
- can start, and what the dragged data should be.
+ If the current drop target is unbound or not an ItemsControl, this will be null.
</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">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.TargetGroup">
<summary>
- Gets or sets the drag data.
+ Gets the current group target.
</summary>
<remarks>
- This must be set by a drag handler in order for a drag to start.
+ 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.DragInfo.DragStartPosition">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTarget">
<summary>
- Gets the position of the click that initiated the drag, relative to <see cref="P:GongSolutions.Wpf.DragDrop.DragInfo.VisualSource"/>.
+ Gets the control that is the current drop target.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.Effects">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTargetItem">
<summary>
- Gets or sets the allowed effects for the drag.
+ Gets the item in an ItemsControl that is the current drop target.
</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.
+ If the current drop target is unbound or not an ItemsControl, this will be null.
</remarks>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.MouseButton">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTargetOrientation">
<summary>
- Gets the mouse button that initiated the drag.
+ Gets the orientation of the current drop target.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.SourceCollection">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.VisualTargetFlowDirection">
<summary>
- Gets the collection that the source ItemsControl is bound to.
+ Gets the orientation of the current drop target.
</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">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.DestinationText">
<summary>
- Gets the object that a dragged item is bound to.
+ Gets and sets the text displayed in the DropDropEffects adorner.
</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">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.InsertPosition">
<summary>
- Gets a collection of objects that the selected items in an ItemsControl are bound to.
+ Gets the relative position the item will be inserted to compared to the TargetItem
</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">
+ <member name="P:GongSolutions.Wpf.DragDrop.DropInfo.KeyStates">
<summary>
- Gets the control that initiated the drag.
+ Gets a flag enumeration indicating the current state of the SHIFT, CTRL, and ALT keys, as well as the state of the mouse buttons.
</summary>
</member>
- <member name="P:GongSolutions.Wpf.DragDrop.DragInfo.VisualSourceItem">
+ <member name="T:GongSolutions.Wpf.DragDrop.Icons.IconFactory">
<summary>
- Gets the item in an ItemsControl that started the drag.
+ Static class to provide access to standard application images
</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>
+ <member name="M:GongSolutions.Wpf.DragDrop.Icons.IconFactory.GetImage(System.String,System.Int32)">
+ <summary>
+ Loads an image based on the name and size required.
+ Images need to be marked as 'Resource' in the project for them be loaded.
+ </summary>
+ <param name="iconName">Name of the icon</param>
+ <param name="size">The size of the icon</param>
+ <returns>The image to be displayed</returns>
</member>
</members>
</doc>
diff --git a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll Binary files differindex 5617d91b9..3e9615082 100644 --- a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll +++ b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.dll diff --git a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.pdb b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.pdb Binary files differindex ce74a4036..997730460 100644 --- a/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.pdb +++ b/win/CS/libraries/WPFDragDrop/GongSolutions.Wpf.DragDrop.pdb diff --git a/win/CS/libraries/WPFDragDrop/SourceModifications.zip b/win/CS/libraries/WPFDragDrop/SourceModifications.zip Binary files differdeleted file mode 100644 index 9d050d455..000000000 --- a/win/CS/libraries/WPFDragDrop/SourceModifications.zip +++ /dev/null diff --git a/win/CS/libraries/WPFDragDrop/notes.txt b/win/CS/libraries/WPFDragDrop/notes.txt new file mode 100644 index 000000000..4d3071ad0 --- /dev/null +++ b/win/CS/libraries/WPFDragDrop/notes.txt @@ -0,0 +1 @@ +https://github.com/punker76/gong-wpf-dragdrop
|