/// </summary>\r
public enum VideoScaler\r
{\r
- [Display(Name = "Lanczos")]\r
+ [Display(Name = "Lanczos (default)")]\r
Lanczos = 0,\r
\r
// [Display(Name = "Bicubic")]\r
+++ /dev/null
-// --------------------------------------------------------------------------------------------------------------------\r
-// <copyright file="DriveMenu.cs" company="HandBrake Project (http://handbrake.fr)">\r
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.\r
-// </copyright>\r
-// <summary>\r
-// The drive menu.\r
-// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------\r
-\r
-namespace HandBrakeWPF.AttachedProperties\r
-{\r
- using System;\r
- using System.Collections.Generic;\r
- using System.Linq;\r
- using System.Windows;\r
- using System.Windows.Controls;\r
-\r
- using HandBrake.ApplicationServices.Exceptions;\r
- using HandBrake.ApplicationServices.Utilities;\r
-\r
- using HandBrakeWPF.Commands;\r
- using HandBrakeWPF.Model;\r
- using HandBrakeWPF.ViewModels;\r
-\r
- /// <summary>\r
- /// The drive menu.\r
- /// </summary>\r
- public class DriveMenu\r
- {\r
- /// <summary>\r
- /// The show available drives property.\r
- /// </summary>\r
- public static readonly DependencyProperty ShowAvailableDrivesProperty = DependencyProperty.RegisterAttached(\r
- "ShowAvailableDrives",\r
- typeof(bool),\r
- typeof(DriveMenu),\r
- new PropertyMetadata(false, OnShowAvailableDrivesChanged));\r
-\r
- /// <summary>\r
- /// The get show available drives.\r
- /// </summary>\r
- /// <param name="element">\r
- /// The element.\r
- /// </param>\r
- /// <returns>\r
- /// The <see cref="bool"/>.\r
- /// </returns>\r
- public static Boolean GetShowAvailableDrives(MenuItem element)\r
- {\r
- bool result;\r
- return bool.TryParse(element.GetValue(ShowAvailableDrivesProperty).ToString(), out result) && result;\r
- }\r
-\r
- /// <summary>\r
- /// The set show available drives.\r
- /// </summary>\r
- /// <param name="element">\r
- /// The element.\r
- /// </param>\r
- /// <param name="value">\r
- /// The value.\r
- /// </param>\r
- public static void SetShowAvailableDrives(MenuItem element, Boolean value)\r
- {\r
- element.SetValue(ShowAvailableDrivesProperty, value);\r
- }\r
-\r
- /// <summary>\r
- /// The on show available drives changed.\r
- /// </summary>\r
- /// <param name="d">\r
- /// The d.\r
- /// </param>\r
- /// <param name="e">\r
- /// The e.\r
- /// </param>\r
- private static void OnShowAvailableDrivesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r
- {\r
- MenuItem menu = d as MenuItem;\r
- if (menu != null)\r
- {\r
- menu.SubmenuOpened -= MenuMouseDown;\r
- menu.SubmenuOpened += MenuMouseDown;\r
- }\r
- }\r
-\r
- /// <summary>\r
- /// The menu_ mouse down.\r
- /// </summary>\r
- /// <param name="sender">\r
- /// The sender.\r
- /// </param>\r
- /// <param name="e">\r
- /// The e.\r
- /// </param>\r
- private static void MenuMouseDown(object sender, RoutedEventArgs e)\r
- {\r
- MenuItem menu = sender as MenuItem;\r
- MenuItem childMenuItem = e.OriginalSource as MenuItem;\r
- if (childMenuItem != null && "Title Specific Scan".Equals(childMenuItem.Header))\r
- {\r
- return; // Skip, it's just a child menu.\r
- }\r
-\r
- if (menu != null)\r
- {\r
- MainViewModel mvm = menu.DataContext as MainViewModel;\r
- if (mvm != null)\r
- {\r
- List<SourceMenuItem> remove = mvm.SourceMenu.Where(s => s.IsDrive).ToList();\r
- foreach (var item in remove)\r
- {\r
- mvm.SourceMenu.Remove(item);\r
- }\r
-\r
- foreach (SourceMenuItem menuItem in from item in GeneralUtilities.GetDrives()\r
- let driveInformation = item\r
- select new SourceMenuItem\r
- {\r
- Text = string.Format("{0} ({1})", item.RootDirectory, item.VolumeLabel),\r
- Command = new SourceMenuCommand(() => mvm.ProcessDrive(driveInformation)),\r
- Tag = item,\r
- IsDrive = true\r
- })\r
- {\r
- mvm.SourceMenu.Add(menuItem);\r
- }\r
- }\r
- else\r
- {\r
- throw new GeneralApplicationException(\r
- "DEBUG - Datacontext wasn't set!", "Please report this on the forum.", null);\r
- }\r
- }\r
- else\r
- {\r
- throw new GeneralApplicationException(\r
- "DEBUG - Source Menu wasn't set!", "Please report this on the forum.", null);\r
- }\r
- }\r
- }\r
-}\r
</Grid.RowDefinitions>\r
\r
\r
- <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="5,10,0,0">\r
+ <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="5,8,0,0">\r
<TextBlock Text="Source Selection" FontSize="14" FontWeight="Bold" /> \r
</StackPanel>\r
\r
<!-- Title Specific Scan -->\r
- <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Left" Margin="5,10,0,0">\r
+ <StackPanel Grid.Row="1" Orientation="Vertical" HorizontalAlignment="Left" Margin="5,5,0,0">\r
<StackPanel Orientation="Horizontal">\r
<TextBlock Text="Optionally choose a specific title: " />\r
\r
<controls:NumberBox Width="60" Height="24" Margin="10,0,0,0"\r
- Minimum="0" Maximum="1000" Number="{Binding SelectedTitle, Mode=TwoWay}" />\r
+ Minimum="0" Maximum="1000" Number="{Binding TitleSpecificScan, Mode=TwoWay}" />\r
</StackPanel>\r
\r
<TextBlock Text="Then choose your source: " Margin="0,10,0,0" />\r
</StackPanel>\r
\r
<!-- Source Type -->\r
- <StackPanel Grid.Row="2" Orientation="Vertical" HorizontalAlignment="Left" Margin="5,10,0,0">\r
+ <StackPanel Grid.Row="2" Orientation="Vertical" HorizontalAlignment="Left" Margin="5,5,0,0">\r
\r
+ <!-- Ctrl + R -->\r
<Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" cal:Message.Attach="[Event Click] = [Action FolderScan]"\r
Margin="0,0,0,7" Padding="8" HorizontalAlignment="Left">\r
+ \r
<StackPanel Orientation="Horizontal" MinWidth="100">\r
<Image Source="../Views/Images/folder32.png" Width="32" />\r
<StackPanel Orientation="Vertical">\r
</StackPanel>\r
</Button>\r
\r
+ <!--Ctrl + F-->\r
<Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" cal:Message.Attach="[Event Click] = [Action FileScan]"\r
Margin="0,0,0,7" Padding="8" HorizontalAlignment="Left">\r
<StackPanel Orientation="Horizontal" MinWidth="100">\r
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,10,10,10">\r
<Button cal:Message.Attach="[Event Click] = [Action CloseSourceSelection]" Content="Cancel" Padding="8,2" />\r
</StackPanel>\r
- \r
- <StackPanel Grid.Row="4" />\r
- \r
- <StackPanel Grid.Row="5" VerticalAlignment="Bottom" Orientation="Vertical">\r
- <TextBlock Text="This is an experimental replacement for the source selection menu. Feedback welcome on the forum." Margin="10,0,10,0"\r
- MaxWidth="300" TextWrapping="Wrap" />\r
- </StackPanel>\r
\r
</Grid>\r
</UserControl>\r
<SubType>Designer</SubType>\r
</ApplicationDefinition>\r
<Compile Include="AppArguments.cs" />\r
- <Compile Include="AttachedProperties\DriveMenu.cs" />\r
<Compile Include="AttachedProperties\MenuItemExtensions.cs" />\r
<Compile Include="Commands\CancelScanCommand.cs" />\r
<Compile Include="Commands\Interfaces\IAdvancedEncoderOptionsCommand.cs" />\r
///Hexagon: performs a somewhat more effective but slightly slower search using a hexagon pattern.\r
///\r
///Uneven Multi-Hex: performs a very wide search using a variety of patterns, more accurately capturing complex motion.\r
- ///\r /// [rest of string was truncated]";.\r
+ ///\r
+ /// [rest of string was truncated]";.\r
/// </summary>\r
public static string Advanced_MotionEstimationMethodToolTip {\r
get {\r
}\r
\r
/// <summary>\r
- /// Looks up a localized string similar to Please note, this option is suitable only for slower systems. It will cause a bottleneck on faster systems.\r
- ///Accelerates H.264, MPEG-4, VC1 and WMV3 only. .\r
+ /// Looks up a localized string similar to Accelerates H.264, MPEG-4, VC1 and WMV3 only. \r
+ ///This can provide a small to modest improvement on slow hardware..\r
/// </summary>\r
public static string Video_DxvaDecode {\r
get {\r
}\r
\r
/// <summary>\r
- /// Looks up a localized string similar to Lanczos - This is HandBrakes default scaler. It provides the best quality downscaling.\r
- ///Bicubic OpenCL - A hardware accelerated version of the CPU based Bicubic scaler. \r
- /// This can be around 5~7% faster than software bicubic on a fast modern graphics card.\r
- /// If OpenCL is unavailable, it will fallback to a software scaler. .\r
+ /// Looks up a localized string similar to OpenCL Scaling is only available for modern graphics cards that support OpenCL 1.1 or later. It will fallback to Lanczos software scaling when it is not available for use. Performance gain up to 5%. Minor decrease in quality in some cases..\r
/// </summary>\r
public static string Video_ScalingModes {\r
get {\r
<value>Placebo Quality |</value>\r
</data>\r
<data name="Video_DxvaDecode" xml:space="preserve">\r
- <value>Please note, this option is suitable only for slower systems. It will cause a bottleneck on faster systems.\r
-Accelerates H.264, MPEG-4, VC1 and WMV3 only. </value>\r
+ <value>Accelerates H.264, MPEG-4, VC1 and WMV3 only. \r
+This can provide a small to modest improvement on slow hardware.</value>\r
</data>\r
<data name="Video_QuickSyncNotAvailable" xml:space="preserve">\r
<value>QuickSync hardware not detected! \r
- Note that in multi-GPU enviroments, you may need to use 3rd party tools and workarounds to active the hardware.</value>\r
</data>\r
<data name="Video_ScalingModes" xml:space="preserve">\r
- <value>Lanczos - This is HandBrakes default scaler. It provides the best quality downscaling.\r
-Bicubic OpenCL - A hardware accelerated version of the CPU based Bicubic scaler. \r
- This can be around 5~7% faster than software bicubic on a fast modern graphics card.\r
- If OpenCL is unavailable, it will fallback to a software scaler. </value>\r
+ <value>OpenCL Scaling is only available for modern graphics cards that support OpenCL 1.1 or later. It will fallback to Lanczos software scaling when it is not available for use. Performance gain up to 5%. Minor decrease in quality in some cases.</value>\r
</data>\r
</root>
\ No newline at end of file
/// </summary>\r
private EncodeTask queueEditTask;\r
\r
- /// <summary>\r
- /// The Source Menu Backing Field\r
- /// </summary>\r
- private BindingList<SourceMenuItem> sourceMenu;\r
-\r
/// <summary>\r
/// The last percentage complete value.\r
/// </summary>\r
}\r
}\r
\r
- /// <summary>\r
- /// Gets or sets the source menu.\r
- /// </summary>\r
- public BindingList<SourceMenuItem> SourceMenu\r
- {\r
- get\r
- {\r
- return this.sourceMenu;\r
- }\r
- set\r
- {\r
- this.sourceMenu = value;\r
- this.NotifyOfPropertyChange(() => SourceMenu);\r
- }\r
- }\r
-\r
/// <summary>\r
/// Gets or sets Presets.\r
/// </summary>\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Gets or sets the title specific scan.\r
+ /// </summary>\r
+ public int TitleSpecificScan { get; set; }\r
+\r
/// <summary>\r
/// Gets or sets the Source Label\r
/// This indicates the status of scans.\r
{\r
this.Drives.Add(menuItem);\r
}\r
+\r
+ this.TitleSpecificScan = 0;\r
+ this.NotifyOfPropertyChange(() => this.TitleSpecificScan);\r
}\r
}\r
}\r
\r
this.SelectedPreset = this.presetService.DefaultPreset;\r
\r
- // Populate the Source menu with drives.\r
- if (!AppArguments.IsInstantHandBrake)\r
- {\r
- this.SourceMenu = new BindingList<SourceMenuItem>(this.GenerateSourceMenu());\r
- }\r
-\r
// Log Cleaning\r
if (userSettingService.GetUserSetting<bool>(UserSettingConstants.ClearOldLogs))\r
{\r
\r
ShowSourceSelection = false;\r
\r
- this.StartScan(dialog.SelectedPath, 0);\r
+ this.StartScan(dialog.SelectedPath, this.TitleSpecificScan);\r
}\r
\r
/// <summary>\r
\r
ShowSourceSelection = false;\r
\r
- this.StartScan(dialog.FileName, 0);\r
- }\r
-\r
- /// <summary>\r
- /// Folder Scan\r
- /// </summary>\r
- public void FolderScanTitleSpecific()\r
- {\r
- VistaFolderBrowserDialog dialog = new VistaFolderBrowserDialog { Description = "Please select a folder.", UseDescriptionForTitle = true };\r
- dialog.ShowDialog();\r
-\r
- if (string.IsNullOrEmpty(dialog.SelectedPath))\r
- {\r
- return;\r
- }\r
-\r
- ITitleSpecificViewModel titleSpecificView = IoC.Get<ITitleSpecificViewModel>();\r
- this.WindowManager.ShowDialog(titleSpecificView);\r
-\r
- if (titleSpecificView.SelectedTitle.HasValue)\r
- {\r
- this.StartScan(dialog.SelectedPath, titleSpecificView.SelectedTitle.Value);\r
- }\r
- }\r
-\r
- /// <summary>\r
- /// File Scan\r
- /// </summary>\r
- public void FileScanTitleSpecific()\r
- {\r
- OpenFileDialog dialog = new OpenFileDialog { Filter = "All files (*.*)|*.*" };\r
- dialog.ShowDialog();\r
-\r
- if (string.IsNullOrEmpty(dialog.FileName))\r
- {\r
- return;\r
- }\r
-\r
- ITitleSpecificViewModel titleSpecificView = IoC.Get<ITitleSpecificViewModel>();\r
- this.WindowManager.ShowDialog(titleSpecificView);\r
-\r
- if (titleSpecificView.SelectedTitle.HasValue)\r
- {\r
- this.StartScan(dialog.FileName, titleSpecificView.SelectedTitle.Value);\r
- }\r
+ this.StartScan(dialog.FileName, this.TitleSpecificScan);\r
}\r
\r
/// <summary>\r
}\r
}\r
\r
- /// <summary>\r
- /// The generate source menu.\r
- /// </summary>\r
- /// <returns>\r
- /// The System.Collections.Generic.IEnumerable`1[T -> HandBrakeWPF.Model.SourceMenuItem].\r
- /// </returns>\r
- private IList<SourceMenuItem> GenerateSourceMenu()\r
- {\r
- List<SourceMenuItem> menuItems = new List<SourceMenuItem>();\r
-\r
- SourceMenuItem folderScan = new SourceMenuItem\r
- {\r
- IsOpenFolder = true,\r
- Text = "Open Folder",\r
- Command = new SourceMenuCommand(this.FolderScan),\r
- IsDrive = false,\r
- InputGestureText = "Ctrl + R"\r
- };\r
- SourceMenuItem fileScan = new SourceMenuItem\r
- {\r
- IsOpenFolder = false,\r
- Text = "Open File",\r
- Command = new SourceMenuCommand(this.FileScan),\r
- IsDrive = false,\r
- InputGestureText = "Ctrl + F"\r
- };\r
-\r
- SourceMenuItem titleSpecific = new SourceMenuItem { Text = "Title Specific Scan" };\r
- SourceMenuItem folderScanTitle = new SourceMenuItem\r
- {\r
- IsOpenFolder = true,\r
- Text = "Open Folder",\r
- Command = new SourceMenuCommand(this.FolderScanTitleSpecific),\r
- IsDrive = false\r
- };\r
- SourceMenuItem fileScanTitle = new SourceMenuItem\r
- {\r
- IsOpenFolder = false,\r
- Text = "Open File",\r
- Command = new SourceMenuCommand(this.FileScanTitleSpecific),\r
- IsDrive = false\r
- };\r
- titleSpecific.Children.Add(folderScanTitle);\r
- titleSpecific.Children.Add(fileScanTitle);\r
-\r
- menuItems.Add(folderScan);\r
- menuItems.Add(fileScan);\r
- menuItems.Add(titleSpecific);\r
-\r
- // Drives\r
- menuItems.AddRange(\r
- from item in GeneralUtilities.GetDrives()\r
- let driveInformation = item\r
- select\r
- new SourceMenuItem\r
- {\r
- Text = string.Format("{0} ({1})", item.RootDirectory, item.VolumeLabel),\r
- Command = new SourceMenuCommand(() => this.ProcessDrive(driveInformation)),\r
- Tag = item,\r
- IsDrive = true\r
- });\r
-\r
- return menuItems;\r
- }\r
-\r
/// <summary>\r
/// Allows the main window to respond to setting changes.\r
/// </summary>\r
/// </summary>\r
private bool addForeignAudioScanTrack;\r
\r
+ /// <summary>\r
+ /// The is cl scaling.\r
+ /// </summary>\r
+ private bool isClScaling;\r
+\r
#endregion\r
\r
#region Constructors and Destructors\r
set\r
{\r
this.selectedScalingMode = value;\r
+ this.IsClScaling = value == VideoScaler.BicubicCl;\r
}\r
}\r
\r
return new BindingList<VideoScaler>(EnumHelper<VideoScaler>.GetEnumList().ToList());\r
}\r
}\r
+\r
+ /// <summary>\r
+ /// Gets or sets a value indicating whether is cl scaling.\r
+ /// </summary>\r
+ public bool IsClScaling\r
+ {\r
+ get\r
+ {\r
+ return this.isClScaling;\r
+ }\r
+ set\r
+ {\r
+ if (value.Equals(this.isClScaling))\r
+ {\r
+ return;\r
+ }\r
+ this.isClScaling = value;\r
+ this.NotifyOfPropertyChange(() => this.IsClScaling);\r
+ }\r
+ }\r
+\r
#endregion\r
\r
#endregion\r
/>\r
</StackPanel>\r
</Button>\r
- \r
- \r
- <Menu Background="Transparent" Visibility="Collapsed">\r
- <MenuItem ItemsSource="{Binding SourceMenu}" attachedProperties:DriveMenu.ShowAvailableDrives="true">\r
- <MenuItem.Header>\r
- <StackPanel Orientation="Horizontal">\r
- <Image Width="32"\r
- Height="32"\r
- Source="Images/Movies.png"\r
- />\r
- <Label Margin="8,0,0,0"\r
- VerticalAlignment="Center"\r
- Content="Source"\r
- />\r
- </StackPanel>\r
- </MenuItem.Header>\r
- \r
- <MenuItem.Resources>\r
- <Image x:Key="Movie" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/file.png" />\r
- <Image x:Key="Folder" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/folder.png" />\r
- <Image x:Key="Disc" x:Shared="False" MaxWidth="16" SnapsToDevicePixels="True" Source="Images/disc_small.png" />\r
- </MenuItem.Resources>\r
- <MenuItem.ItemContainerStyle>\r
- <Style TargetType="{x:Type MenuItem}" x:Shared="True">\r
- <Setter Property="Header" Value="{Binding Text}" />\r
- <Setter Property="Command" Value="{Binding Command}"/>\r
- <Setter Property="ItemsSource" Value="{Binding Children}" />\r
- <Setter Property="InputGestureText" Value="{Binding InputGestureText}" />\r
- <Setter Property="Tag" Value="{Binding}" />\r
-\r
- <Style.Triggers>\r
- <DataTrigger Binding="{Binding Path=IsDrive}" Value="true">\r
- <Setter Property="Icon" Value="{StaticResource Disc}"/>\r
- </DataTrigger>\r
- <DataTrigger Binding="{Binding Path=IsOpenFolder}" Value="true">\r
- <Setter Property="Icon" Value="{StaticResource Folder}"/>\r
- </DataTrigger>\r
- <DataTrigger Binding="{Binding Path=IsOpenFile}" Value="true">\r
- <Setter Property="Icon" Value="{StaticResource Movie}"/>\r
- </DataTrigger>\r
- </Style.Triggers>\r
- </Style>\r
- </MenuItem.ItemContainerStyle>\r
- </MenuItem>\r
- </Menu>\r
-\r
+ \r
<Separator />\r
\r
<Button Name="Start"\r
\r
<StackPanel Orientation="Vertical" Margin="20,0,0,0" >\r
<CheckBox Content="Enable DXVA Hardware Accelerated Decoding" IsChecked="{Binding EnableDxvaDecoding}" />\r
- <TextBlock Text="{x:Static Properties:Resources.Video_DxvaDecode}" Margin="17,2,0,0" />\r
+ <TextBlock Text="{x:Static Properties:Resources.Video_DxvaDecode}" Margin="17,2,0,0" />\r
\r
</StackPanel>\r
\r
</StackPanel>\r
\r
<StackPanel Orientation="Vertical" Margin="26,2,0,0" >\r
- <TextBlock Text="{x:Static Properties:Resources.Video_ScalingModes}" TextWrapping="Wrap "/>\r
+ <TextBlock Text="{x:Static Properties:Resources.Video_ScalingModes}" TextWrapping="Wrap "\r
+ Visibility="{Binding IsClScaling, Converter={StaticResource boolToVisConverter}}" />\r
</StackPanel>\r
\r
</StackPanel>\r