1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
|
<UserControl x:Class="HandBrakeWPF.Views.AdvancedView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
xmlns:Properties="clr-namespace:HandBrakeWPF.Properties" xmlns:Helpers="clr-namespace:HandBrakeWPF.Helpers"
mc:Ignorable="d" x:Name="advancedView">
<UserControl.Resources>
<Converters:AdvancedVisibilityConverter x:Key="VisibilityConverter" />
<Converters:BooleanToVisibilityConverter x:Key="BooleanVisibilityConverter" />
<Style x:Key="AdvancedLabel" TargetType="Label">
<Setter Property="HorizontalAlignment" Value="Right" />
</Style>
<Style x:Key="LongToolTipHolder" TargetType="FrameworkElement">
<Setter Property="ToolTipService.ShowDuration" Value="20000" />
</Style>
<Style x:Key="LongToolTip" TargetType="TextBlock">
<Setter Property="Width" Value="400" />
<Setter Property="TextWrapping" Value="Wrap" />
</Style>
</UserControl.Resources>
<StackPanel Orientation="Vertical">
<!-- Other Encoders -->
<StackPanel Margin="10" Height="100" VerticalAlignment="Top"
Visibility="{Binding DisplayX264Options, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=true}">
<TextBlock Text="Advanced Query" Margin="0,0,0,5" FontWeight="Bold" VerticalAlignment="Center" />
<TextBox Text="{Binding AdvancedOptionsString}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="150" TextWrapping="Wrap" />
</StackPanel>
<!-- X264 -->
<Grid Visibility="{Binding DisplayX264Options, Converter={StaticResource BooleanVisibilityConverter}, ConverterParameter=false}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!--Left Column -->
<StackPanel Orientation="Vertical" Grid.Column="0" Grid.Row="0">
<!-- Encoding -->
<StackPanel Orientation="Vertical" >
<TextBlock Text="Encoding: " FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" />
<Grid HorizontalAlignment="Left" Margin="0,5,0,0" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="110" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Label Content="Reference Frames:" Grid.Row="0" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="0" Grid.Column="1" Height="22"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.ReferenceFrames}" DisplayMemberPath="Label"
SelectedItem="{Binding ReferenceFrames}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_ReferenceFramesToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Maximum B-Frames:" Grid.Row="1" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="1" Grid.Column="1" Height="22"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.BFrames}" DisplayMemberPath="Label"
SelectedItem="{Binding BFrames}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_BFramesToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="CABAC:" Height="28" Grid.Row="4" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<CheckBox Height="16" Grid.Row="4" Grid.Column="1" IsChecked="{Binding CabacEntropyCoding}" Style="{StaticResource LongToolTipHolder}">
<CheckBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_CabacToolTip}" Style="{StaticResource LongToolTip}" />
</CheckBox.ToolTip>
</CheckBox>
<Label Content="8x8 Transform:" Height="28" Grid.Row="5" Grid.Column="0"
Visibility="{Binding EightByEightDctVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource AdvancedLabel}" />
<CheckBox Height="16" Grid.Row="5" Grid.Column="1" IsChecked="{Binding EightByEightDct}"
Visibility="{Binding EightByEightDctVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource LongToolTipHolder}">
<CheckBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_EightByEightDctToolTip}" Style="{StaticResource LongToolTip}" />
</CheckBox.ToolTip>
</CheckBox>
<Label Content="Weighted P-Frames:" Grid.Row="6" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<CheckBox Grid.Row="6" Grid.Column="1" VerticalAlignment="Center" IsChecked="{Binding WeightedPFrames}" Style="{StaticResource LongToolTipHolder}">
<CheckBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_WeightPToolTip}" Style="{StaticResource LongToolTip}" />
</CheckBox.ToolTip>
</CheckBox>
<Label Content="Pyramidal B-Frames:" Grid.Row="7" Grid.Column="0"
Visibility="{Binding PyramidalBFramesVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="7" Grid.Column="1" Height="22" ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.PyramidalBFrames}" DisplayMemberPath="Label"
SelectedItem="{Binding PyramidalBFrames}"
Visibility="{Binding PyramidalBFramesVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_PyramidalBFramesToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
</Grid>
</StackPanel>
<!-- Psychvisual -->
<StackPanel Orientation="Vertical" >
<TextBlock Text="Psychvisual: " FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" />
<StackPanel Orientation="Horizontal">
<Label Content="No DCT-Decimate:" Width="110" HorizontalAlignment="Left" HorizontalContentAlignment="Right" VerticalAlignment="Center" />
<CheckBox VerticalAlignment="Center" HorizontalAlignment="Left" IsChecked="{Binding NoDctDecimate}"
Style="{StaticResource LongToolTipHolder}">
<CheckBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_NoDctDecimateToolTip}" Style="{StaticResource LongToolTip}" />
</CheckBox.ToolTip>
</CheckBox>
</StackPanel>
</StackPanel>
</StackPanel>
<!-- Analysis (Center Column)-->
<StackPanel Orientation="Vertical" Grid.Column="1" Grid.Row="0" >
<TextBlock Text="Analysis: " FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" />
<Grid HorizontalAlignment="Left" VerticalAlignment="Top">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Adaptive B-Frames:" Grid.Row="0" Grid.Column="0"
Visibility="{Binding BFramesOptionsVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="0" Grid.Column="1" Height="22" ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.AdaptiveBFrames}" DisplayMemberPath="Label"
SelectedItem="{Binding AdaptiveBFrames}" Visibility="{Binding BFramesOptionsVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource LongToolTipHolder}" MaxWidth="120" Width="120">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_AdaptiveBFramesToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Adaptive Direct Mode:" Grid.Row="1" Grid.Column="0"
Visibility="{Binding BFramesOptionsVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="1" Grid.Column="1" Height="22" MaxWidth="120" Width="120"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.DirectPrediction}" DisplayMemberPath="Label"
SelectedItem="{Binding DirectPrediction}"
Visibility="{Binding BFramesOptionsVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_AdaptiveDirectModeToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Motion Estimation Method:" Grid.Row="2" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="2" Grid.Column="1" Height="22" MaxWidth="120" Width="120"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.MotionEstimationMethod}" DisplayMemberPath="Label"
SelectedItem="{Binding MotionEstimationMethod}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_MotionEstimationMethodToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Subpixel Motion Estimation:" Grid.Row="3" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="3" Grid.Column="1" Height="22" MaxWidth="120" Width="120"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.SubpixelMotionEstimation}" DisplayMemberPath="Label"
SelectedItem="{Binding SubpixelMotionEstimation}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_SubpixelMotionEstimationToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Motion Estimation Range:" Grid.Row="4" Grid.Column="0"
Visibility="{Binding MotionEstimationRangeVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource AdvancedLabel}" />
<ComboBox Grid.Row="4" Grid.Column="1" Height="22" MaxWidth="120" Width="120"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.MotionEstimationRange}" DisplayMemberPath="Label"
SelectedItem="{Binding MotionEstimationRange}"
Visibility="{Binding MotionEstimationRangeVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_MotionEstimationRangeToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
</Grid>
<Grid Height="80" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Adaptive Quantization Strength:" Grid.Row="0" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<Slider Grid.Row="0" Grid.Column="1" Minimum="0.0" Maximum="2.0" TickPlacement="BottomRight"
TickFrequency="0.1" SmallChange="0.1" LargeChange="0.2" IsSnapToTickEnabled="True"
Value="{Binding AdaptiveQuantizationStrength}" Style="{StaticResource LongToolTipHolder}">
<Slider.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_AdaptiveQuantizationStrengthToolTip}" Style="{StaticResource LongToolTip}" />
</Slider.ToolTip>
</Slider>
<Label Content="Psychovisual Rate Distortion:" Grid.Row="1" Grid.Column="0" Style="{StaticResource AdvancedLabel}" />
<Slider Grid.Row="1" Grid.Column="1" Minimum="0.0" Maximum="2.0" TickPlacement="BottomRight"
TickFrequency="0.1" SmallChange="0.1" LargeChange="0.2" IsSnapToTickEnabled="True"
Value="{Binding PsychovisualRateDistortion}" Style="{StaticResource LongToolTipHolder}">
<Slider.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_PsychovisualRateDistortionToolTip}" Style="{StaticResource LongToolTip}" />
</Slider.ToolTip>
</Slider>
<Label Content="Psychovisual Trellis:" Grid.Row="2" Grid.Column="0" Style="{StaticResource AdvancedLabel}"
Visibility="{Binding PsychovisualTrellisVisible, Converter={StaticResource VisibilityConverter}}" />
<Slider Grid.Row="2" Grid.Column="1" Minimum="0.0" Maximum="1.0" TickPlacement="BottomRight"
TickFrequency="0.05" SmallChange="0.05" LargeChange="0.2" IsSnapToTickEnabled="True"
Value="{Binding PsychovisualTrellis}"
Visibility="{Binding PsychovisualTrellisVisible, Converter={StaticResource VisibilityConverter}}"
Style="{StaticResource LongToolTipHolder}">
<Slider.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_PsychovisualTrellisToolTip}" Style="{StaticResource LongToolTip}" />
</Slider.ToolTip>
</Slider>
</Grid>
</StackPanel>
<!-- Analysis (Right Column)-->
<StackPanel Orientation="Vertical" Grid.Column="2" Grid.Row="0">
<Grid Margin="0,20,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>
<Label Content="Partition Type:" Height="28" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="0" />
<ComboBox Height="23" HorizontalAlignment="Right" VerticalAlignment="Top" Width="100" MaxWidth="100"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Analysis}" DisplayMemberPath="Label" Grid.Column="1"
SelectedItem="{Binding Analysis}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_AnalysisToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Trellis:" Height="28" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="0" Grid.Row="1" />
<ComboBox Height="23" HorizontalAlignment="Right" VerticalAlignment="Top" Width="100" MaxWidth="100" Grid.Row="1"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.Trellis}" DisplayMemberPath="Label" Grid.Column="1"
SelectedItem="{Binding Trellis}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_TrellisToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<Label Content="Deblocking:" Height="28" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="0" Grid.Row="2" />
<ComboBox Height="23" HorizontalAlignment="Right" VerticalAlignment="Top" Width="100" MaxWidth="100"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.DeblockingStrength}" DisplayMemberPath="Label" Grid.Column="1" Grid.Row="2"
SelectedItem="{Binding DeblockingStrength}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
<ComboBox Height="23" HorizontalAlignment="Right" VerticalAlignment="Top" Width="100" MaxWidth="100" Grid.Column="1" Grid.Row="3"
ItemsSource="{x:Static Helpers:AdvancedChoicesHelper.DeblockingThreshold}" DisplayMemberPath="Label"
SelectedItem="{Binding DeblockingThreshold}" Style="{StaticResource LongToolTipHolder}">
<ComboBox.ToolTip>
<TextBlock Text="{x:Static Properties:Resources.Advanced_DeblockingToolTip}" Style="{StaticResource LongToolTip}" />
</ComboBox.ToolTip>
</ComboBox>
</Grid>
</StackPanel>
<!-- Query -->
<StackPanel Orientation="Vertical" Grid.Row="1" Grid.ColumnSpan="3" Margin="0,10,0,0" HorizontalAlignment="Stretch">
<TextBox Text="{Binding AdvancedOptionsString, UpdateSourceTrigger=PropertyChanged}" Height="35" MaxWidth="700"
HorizontalAlignment="Stretch" TextWrapping="Wrap" />
</StackPanel>
</Grid>
</StackPanel>
</UserControl>
|