Skip to content

Commit d0b7da1

Browse files
author
RandomEngy
committed
Add option for the minimum title length to scan.
1 parent d6a6d68 commit d0b7da1

10 files changed

Lines changed: 68 additions & 8 deletions

Lib/x64/HandBrakeInterop.dll

0 Bytes
Binary file not shown.

Lib/x64/HandBrakeInterop.pdb

0 Bytes
Binary file not shown.

Lib/x86/HandBrakeInterop.dll

0 Bytes
Binary file not shown.

Lib/x86/HandBrakeInterop.pdb

2 KB
Binary file not shown.

VidCoder/Properties/Settings.Designer.cs

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

VidCoder/Properties/Settings.settings

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,5 +158,8 @@
158158
<Setting Name="EnableLibDvdNav" Type="System.Boolean" Scope="User">
159159
<Value Profile="(Default)">True</Value>
160160
</Setting>
161+
<Setting Name="MinimumTitleLengthSeconds" Type="System.Int32" Scope="User">
162+
<Value Profile="(Default)">10</Value>
163+
</Setting>
161164
</Settings>
162165
</SettingsFile>

VidCoder/View/OptionsDialog.xaml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Window x:Class="VidCoder.View.OptionsDialog"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Model="clr-namespace:VidCoder.Model" Title="Options" Height="415" Width="571"
4-
Style="{StaticResource NormalWindow}" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Closing="Window_Closing">
4+
Style="{StaticResource NormalWindow}" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" Closing="Window_Closing" xmlns:my="clr-namespace:VidCoder.Controls">
55
<Window.Resources>
66
<Style x:Key="EmphasizedTitle" TargetType="TextBlock">
77
<Setter Property="VerticalAlignment" Value="Center" />
@@ -133,6 +133,15 @@
133133
</TabItem>
134134
<TabItem Header="Advanced">
135135
<Grid>
136+
<Grid.RowDefinitions>
137+
<RowDefinition Height="Auto" />
138+
<RowDefinition Height="22" />
139+
<RowDefinition Height="22" />
140+
<RowDefinition Height="22" />
141+
<RowDefinition Height="Auto" />
142+
<RowDefinition Height="24" />
143+
<RowDefinition Height="Auto" />
144+
</Grid.RowDefinitions>
136145
<Label Content="Number of picture previews to scan:" Height="28" HorizontalAlignment="Left" Margin="6,6,0,0" Name="label3" VerticalAlignment="Top" />
137146
<ComboBox
138147
Height="23" HorizontalAlignment="Left" Margin="211,8,0,0" Name="comboBox1" VerticalAlignment="Top" Width="61"
@@ -145,24 +154,40 @@
145154
<ComboBoxItem>30</ComboBoxItem>
146155
</ComboBox>
147156
<CheckBox
157+
Grid.Row="1"
148158
Content="Allow setting custom name on audio tracks (limited player support)"
149159
IsChecked="{Binding ShowAudioTrackNameField}"
150-
Height="16" HorizontalAlignment="Left" Margin="15,40,0,0" VerticalAlignment="Top" />
160+
Height="16" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Center" />
151161
<CheckBox
162+
Grid.Row="2"
152163
Content="Enable LibDVDNav (change requires program restart)"
153164
IsChecked="{Binding EnableLibDvdNav}"
154-
Height="16" HorizontalAlignment="Left" Margin="15,62,0,0" VerticalAlignment="Top" />
165+
Height="16" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Center" />
155166
<CheckBox
167+
Grid.Row="3"
156168
Content="Keep scans after completion (allows editing completed items)"
157169
IsChecked="{Binding KeepScansAfterCompletion}"
158-
Height="16" HorizontalAlignment="Left" Margin="15,84,0,0" VerticalAlignment="Top" />
159-
<Label Content="Logging Verbosity:" Height="28" HorizontalAlignment="Left" Margin="6,108,0,0" VerticalAlignment="Top" />
160-
<ComboBox Height="23" HorizontalAlignment="Left" Margin="121,111,0,0" SelectedValue="{Binding LogVerbosity}" SelectedValuePath="Content" VerticalAlignment="Top" Width="42">
170+
Height="16" HorizontalAlignment="Left" Margin="15,0,0,0" VerticalAlignment="Center" />
171+
<Label
172+
Grid.Row="4"
173+
Content="Logging Verbosity:" Height="28" HorizontalAlignment="Left" Margin="6,0,0,0" VerticalAlignment="Center" />
174+
<ComboBox
175+
Grid.Row="4"
176+
Height="23" HorizontalAlignment="Left" Margin="121,0,0,0" SelectedValue="{Binding LogVerbosity}" SelectedValuePath="Content" VerticalAlignment="Center" Width="42">
161177
<ComboBoxItem Content="0" />
162178
<ComboBoxItem Content="1" />
163179
<ComboBoxItem Content="2" />
164180
</ComboBox>
165-
<TextBlock Height="40" HorizontalAlignment="Left" Margin="182,113,0,0" Text="Log verbosity will take effect on next scan or program restart." TextWrapping="Wrap" VerticalAlignment="Top" Visibility="{Binding LogVerbosityWarningVisible, Converter={StaticResource VisibilityConverter}}" />
181+
<TextBlock
182+
Grid.Row="4"
183+
HorizontalAlignment="Left" Margin="182,0,0,0" Text="Log verbosity will take effect on next scan or program restart." TextWrapping="Wrap" VerticalAlignment="Center" Visibility="{Binding LogVerbosityWarningVisible, Converter={StaticResource VisibilityConverter}}" />
184+
185+
<TextBlock
186+
Grid.Row="5"
187+
Height="23" HorizontalAlignment="Left" Margin="11,5,0,0" Text="Minimum length of title to scan (seconds):" VerticalAlignment="Center" />
188+
<my:NumberBox
189+
Grid.Row="5" HorizontalAlignment="Left" Margin="243,2,0,0" VerticalAlignment="Top" AllowEmpty="False" Width="45"
190+
Number="{Binding MinimumTitleLengthSeconds, Mode=TwoWay}" Minimum="0" />
166191
</Grid>
167192
</TabItem>
168193
</TabControl>

VidCoder/ViewModel/MainViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,7 +2045,7 @@ private void StartScan(string path, EncodeJobViewModel jobVM = null)
20452045
this.ScanError = false;
20462046
this.ScanningSource = true;
20472047
this.scanCancelledFlag = false;
2048-
this.scanInstance.StartScan(path, Settings.Default.PreviewCount);
2048+
this.scanInstance.StartScan(path, Settings.Default.PreviewCount, TimeSpan.FromSeconds(Settings.Default.MinimumTitleLengthSeconds));
20492049
}
20502050

20512051
private void UpdateFromNewVideoSource()

VidCoder/ViewModel/OptionsDialogViewModel.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public OptionsDialogViewModel(IUpdater updateService)
6363
this.showAudioTrackNameField = Settings.Default.ShowAudioTrackNameField;
6464
this.keepScansAfterCompletion = Settings.Default.KeepScansAfterCompletion;
6565
this.enableLibDvdNav = Settings.Default.EnableLibDvdNav;
66+
this.minimumTitleLengthSeconds = Settings.Default.MinimumTitleLengthSeconds;
6667
this.autoPauseProcesses = new ObservableCollection<string>();
6768
StringCollection autoPauseStringCollection = Settings.Default.AutoPauseProcesses;
6869
if (autoPauseStringCollection != null)
@@ -419,6 +420,21 @@ public bool LogVerbosityWarningVisible
419420
}
420421
}
421422

423+
private int minimumTitleLengthSeconds;
424+
public int MinimumTitleLengthSeconds
425+
{
426+
get
427+
{
428+
return this.minimumTitleLengthSeconds;
429+
}
430+
431+
set
432+
{
433+
this.minimumTitleLengthSeconds = value;
434+
this.RaisePropertyChanged(() => this.MinimumTitleLengthSeconds);
435+
}
436+
}
437+
422438
private RelayCommand saveSettingsCommand;
423439
public RelayCommand SaveSettingsCommand
424440
{
@@ -454,6 +470,7 @@ public RelayCommand SaveSettingsCommand
454470
Settings.Default.ShowAudioTrackNameField = this.ShowAudioTrackNameField;
455471
Settings.Default.EnableLibDvdNav = this.EnableLibDvdNav;
456472
Settings.Default.KeepScansAfterCompletion = this.KeepScansAfterCompletion;
473+
Settings.Default.MinimumTitleLengthSeconds = this.MinimumTitleLengthSeconds;
457474
Settings.Default.Save();
458475

459476
Messenger.Default.Send(new OptionsChangedMessage());

VidCoder/app.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@
165165
<setting name="EnableLibDvdNav" serializeAs="String">
166166
<value>True</value>
167167
</setting>
168+
<setting name="MinimumTitleLengthSeconds" serializeAs="String">
169+
<value>10</value>
170+
</setting>
168171
</VidCoder.Properties.Settings>
169172
</userSettings>
170173
</configuration>

0 commit comments

Comments
 (0)