Skip to content

Commit 73a5b3b

Browse files
author
RandomEngy
committed
Added tooltip to quality slider and fixed problem with the preview image not getting updated on the first change after saving.
1 parent 611d465 commit 73a5b3b

5 files changed

Lines changed: 72 additions & 27 deletions

File tree

VidCoder/Properties/Resources.Designer.cs

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

VidCoder/Properties/Resources.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,4 +303,7 @@ Higher values take more bits away from edges and complex areas to improve areas
303303
<data name="QueueEtaToolTip" xml:space="preserve">
304304
<value>Estimated time remaining for all jobs in the queue to complete.</value>
305305
</data>
306+
<data name="Video_QualityTargetToolTip" xml:space="preserve">
307+
<value>Set the desired quality factor. The scale used by each video encoder is different.</value>
308+
</data>
306309
</root>

VidCoder/View/Panels/VideoPanel.xaml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
<UserControl
22
x:Class="VidCoder.View.VideoPanel"
3-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
77
xmlns:controls="clr-namespace:VidCoder.Controls"
88
xmlns:converters="clr-namespace:VidCoder.Converters"
9-
mc:Ignorable="d"
10-
d:DesignHeight="330" d:DesignWidth="622">
9+
xmlns:resx="clr-namespace:VidCoder.Properties"
10+
mc:Ignorable="d"
11+
d:DesignHeight="330" d:DesignWidth="622">
1112
<UserControl.Resources>
1213
<converters:FramerateDisplayConverter x:Key="FramerateDisplayConverter" />
14+
<Style x:Key="LargeToolTip" TargetType="TextBlock">
15+
<Setter Property="Width" Value="400" />
16+
<Setter Property="TextWrapping" Value="Wrap" />
17+
</Style>
1318
</UserControl.Resources>
14-
<Grid>
19+
<Grid>
1520
<Grid.ColumnDefinitions>
1621
<ColumnDefinition Width="270" />
1722
<ColumnDefinition />
@@ -115,16 +120,29 @@
115120

116121
<RadioButton
117122
Height="16" Margin="20,99,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="120" GroupName="VideoQuality"
118-
IsChecked="{Binding VideoEncodeRateType, Converter={StaticResource EnumBoolConverter}, ConverterParameter=ConstantQuality}">Constant Quality</RadioButton>
123+
IsChecked="{Binding VideoEncodeRateType, Converter={StaticResource EnumBoolConverter}, ConverterParameter=ConstantQuality}">
124+
<RadioButton.ToolTip>
125+
<TextBlock Text="{x:Static resx:Resources.Video_QualityTargetToolTip}" Style="{StaticResource LargeToolTip}" />
126+
</RadioButton.ToolTip>
127+
Constant Quality
128+
</RadioButton>
119129
<controls:DoubleNumberBox
120130
Height="23" HorizontalAlignment="Left" Margin="146,94,0,0" VerticalAlignment="Top" Width="49"
121131
Number="{Binding Quality, Mode=TwoWay}" Minimum="0" Maximum="51"
122-
Visibility="{Binding VideoEncodeRateType, Converter={StaticResource EnumVisibilityConverter}, ConverterParameter=ConstantQuality}"/>
132+
Visibility="{Binding VideoEncodeRateType, Converter={StaticResource EnumVisibilityConverter}, ConverterParameter=ConstantQuality}">
133+
<controls:DoubleNumberBox.ToolTip>
134+
<TextBlock Text="{x:Static resx:Resources.Video_QualityTargetToolTip}" Style="{StaticResource LargeToolTip}" />
135+
</controls:DoubleNumberBox.ToolTip>
136+
</controls:DoubleNumberBox>
123137
<Slider
124138
Height="22" Margin="20,121,6,0" VerticalAlignment="Top"
125139
TickPlacement="BottomRight" Minimum="{Binding QualitySliderMin}" Maximum="{Binding QualitySliderMax}" TickFrequency="1" IsSnapToTickEnabled="True"
126140
Value="{Binding Quality}"
127-
Visibility="{Binding VideoEncodeRateType, Converter={StaticResource EnumVisibilityConverter}, ConverterParameter=ConstantQuality}"/>
141+
Visibility="{Binding VideoEncodeRateType, Converter={StaticResource EnumVisibilityConverter}, ConverterParameter=ConstantQuality}">
142+
<Slider.ToolTip>
143+
<TextBlock Text="{x:Static resx:Resources.Video_QualityTargetToolTip}" Style="{StaticResource LargeToolTip}" />
144+
</Slider.ToolTip>
145+
</Slider>
128146
<TextBlock
129147
Height="21" Margin="20.2,149,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="90.8" TextAlignment="Left"
130148
Text="{Binding QualitySliderLeftText}"

VidCoder/ViewModel/Panels/PicturePanelViewModel.cs

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ public int Width
137137
}
138138
}
139139

140-
this.UpdatePreviewWindow();
141140
this.RefreshOutputSize();
142141
this.IsModified = true;
142+
this.UpdatePreviewWindow();
143143
}
144144
}
145145
}
@@ -190,9 +190,9 @@ public int Height
190190
}
191191
}
192192

193-
this.UpdatePreviewWindow();
194193
this.RefreshOutputSize();
195194
this.IsModified = true;
195+
this.UpdatePreviewWindow();
196196
}
197197
}
198198
}
@@ -223,9 +223,10 @@ public int MaxWidth
223223
{
224224
this.Profile.MaxWidth = value;
225225
this.NotifyPropertyChanged("MaxWidth");
226-
this.UpdatePreviewWindow();
227226
this.RefreshOutputSize();
227+
228228
this.IsModified = true;
229+
this.UpdatePreviewWindow();
229230
}
230231
}
231232
}
@@ -243,9 +244,10 @@ public int MaxHeight
243244
{
244245
this.Profile.MaxHeight = value;
245246
this.NotifyPropertyChanged("MaxHeight");
246-
this.UpdatePreviewWindow();
247247
this.RefreshOutputSize();
248+
248249
this.IsModified = true;
250+
this.UpdatePreviewWindow();
249251
}
250252
}
251253
}
@@ -268,7 +270,6 @@ public bool KeepDisplayAspect
268270
this.NotifyPropertyChanged("KeepDisplayAspect");
269271
this.NotifyPropertyChanged("PixelAspectVisibile");
270272
this.RefreshOutputSize();
271-
this.UpdatePreviewWindow();
272273
if (this.Anamorphic == Anamorphic.Custom)
273274
{
274275
if (value && !this.UseDisplayWidth)
@@ -283,6 +284,7 @@ public bool KeepDisplayAspect
283284
}
284285

285286
this.IsModified = true;
287+
this.UpdatePreviewWindow();
286288
}
287289
}
288290

@@ -328,9 +330,10 @@ public Anamorphic Anamorphic
328330
this.NotifyPropertyChanged("KeepDisplayAspectEnabled");
329331
this.NotifyPropertyChanged("WidthEnabled");
330332
this.NotifyPropertyChanged("HeightEnabled");
331-
this.UpdatePreviewWindow();
332333
this.RefreshOutputSize();
334+
333335
this.IsModified = true;
336+
this.UpdatePreviewWindow();
334337
}
335338
}
336339

@@ -352,8 +355,10 @@ public int Modulus
352355
set
353356
{
354357
this.Profile.Modulus = value;
355-
this.UpdatePreviewWindow();
356358
this.NotifyPropertyChanged("Modulus");
359+
360+
this.IsModified = true;
361+
this.UpdatePreviewWindow();
357362
}
358363
}
359364

@@ -379,9 +384,10 @@ public bool UseDisplayWidth
379384
this.NotifyPropertyChanged("UseDisplayWidth");
380385
this.NotifyPropertyChanged("KeepDisplayAspect");
381386
this.NotifyPropertyChanged("KeepDisplayAspectEnabled");
382-
this.UpdatePreviewWindow();
383387
this.RefreshOutputSize();
388+
384389
this.IsModified = true;
390+
this.UpdatePreviewWindow();
385391
}
386392
}
387393

@@ -397,8 +403,9 @@ public int DisplayWidth
397403
this.Profile.DisplayWidth = value;
398404
this.NotifyPropertyChanged("DisplayWidth");
399405
this.RefreshOutputSize();
400-
this.UpdatePreviewWindow();
406+
401407
this.IsModified = true;
408+
this.UpdatePreviewWindow();
402409
}
403410
}
404411

@@ -429,8 +436,9 @@ public int PixelAspectX
429436
this.Profile.PixelAspectX = value;
430437
this.NotifyPropertyChanged("PixelAspectX");
431438
this.RefreshOutputSize();
432-
this.UpdatePreviewWindow();
439+
433440
this.IsModified = true;
441+
this.UpdatePreviewWindow();
434442
}
435443
}
436444
}
@@ -449,8 +457,9 @@ public int PixelAspectY
449457
this.Profile.PixelAspectY = value;
450458
this.NotifyPropertyChanged("PixelAspectY");
451459
this.RefreshOutputSize();
452-
this.UpdatePreviewWindow();
460+
453461
this.IsModified = true;
462+
this.UpdatePreviewWindow();
454463
}
455464
}
456465
}
@@ -471,9 +480,10 @@ public bool CustomCropping
471480
this.NotifyPropertyChanged("CropTop");
472481
this.NotifyPropertyChanged("CropRight");
473482
this.NotifyPropertyChanged("CropBottom");
474-
this.UpdatePreviewWindow();
475483
this.RefreshOutputSize();
484+
476485
this.IsModified = true;
486+
this.UpdatePreviewWindow();
477487
}
478488
}
479489

@@ -498,9 +508,10 @@ public int CropLeft
498508
{
499509
this.Profile.Cropping.Left = value;
500510
this.NotifyPropertyChanged("CropLeft");
501-
this.UpdatePreviewWindow();
502511
this.RefreshOutputSize();
512+
503513
this.IsModified = true;
514+
this.UpdatePreviewWindow();
504515
}
505516
}
506517

@@ -525,9 +536,10 @@ public int CropTop
525536
{
526537
this.Profile.Cropping.Top = value;
527538
this.NotifyPropertyChanged("CropTop");
528-
this.UpdatePreviewWindow();
529539
this.RefreshOutputSize();
540+
530541
this.IsModified = true;
542+
this.UpdatePreviewWindow();
531543
}
532544
}
533545

@@ -552,9 +564,10 @@ public int CropRight
552564
{
553565
this.Profile.Cropping.Right = value;
554566
this.NotifyPropertyChanged("CropRight");
555-
this.UpdatePreviewWindow();
556567
this.RefreshOutputSize();
568+
557569
this.IsModified = true;
570+
this.UpdatePreviewWindow();
558571
}
559572
}
560573

@@ -579,9 +592,10 @@ public int CropBottom
579592
{
580593
this.Profile.Cropping.Bottom = value;
581594
this.NotifyPropertyChanged("CropBottom");
582-
this.UpdatePreviewWindow();
583595
this.RefreshOutputSize();
596+
584597
this.IsModified = true;
598+
this.UpdatePreviewWindow();
585599
}
586600
}
587601

VidCoder/ViewModel/Panels/VideoFiltersPanelViewModel.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ public Deinterlace Deinterlace
6969

7070
this.NotifyPropertyChanged("Deinterlace");
7171
this.NotifyPropertyChanged("CustomDeinterlaceVisible");
72-
this.UpdatePreviewWindow();
72+
7373
this.IsModified = true;
74+
this.UpdatePreviewWindow();
7475
}
7576
}
7677

0 commit comments

Comments
 (0)