Skip to content

Commit d6a6d68

Browse files
author
RandomEngy
committed
Adding option to disable LibDVDNav and fall back to libdvdread.
1 parent dab113a commit d6a6d68

10 files changed

Lines changed: 53 additions & 9 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

0 Bytes
Binary file not shown.

VidCoder/App.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,19 @@ protected override void OnStartup(StartupEventArgs e)
8080
}
8181
else
8282
{
83+
this.GlobalInitialize();
84+
8385
var mainVM = new MainViewModel();
8486
WindowManager.OpenWindow(mainVM);
8587
mainVM.OnLoaded();
8688
}
8789
}
8890

91+
private void GlobalInitialize()
92+
{
93+
HandBrakeUtils.SetDvdNav(Settings.Default.EnableLibDvdNav);
94+
}
95+
8996
private void OnDispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
9097
{
9198
var exceptionDialog = new ExceptionDialog(e.Exception);

VidCoder/Properties/Settings.Designer.cs

Lines changed: 13 additions & 1 deletion
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
@@ -155,5 +155,8 @@
155155
<Setting Name="QueueTitlesDialogPlacement2" Type="System.String" Scope="User">
156156
<Value Profile="(Default)" />
157157
</Setting>
158+
<Setting Name="EnableLibDvdNav" Type="System.Boolean" Scope="User">
159+
<Value Profile="(Default)">True</Value>
160+
</Setting>
158161
</Settings>
159162
</SettingsFile>

VidCoder/View/OptionsDialog.xaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,10 @@
5656
<Label Height="28" HorizontalAlignment="Left" Margin="5,63,0,0" VerticalAlignment="Top" Width="76.8">File format:</Label>
5757
<RadioButton
5858
Height="16" Margin="94,70,265,0" VerticalAlignment="Top"
59-
IsChecked="{Binding CustomFormat, Converter={StaticResource InverseBoolConverter}}"
60-
GroupName="format">Default format</RadioButton>
59+
IsChecked="{Binding CustomFormat, Converter={StaticResource InverseBoolConverter}}">Default format</RadioButton>
6160
<RadioButton
6261
Height="16" Margin="94,92,265,0" VerticalAlignment="Top"
63-
IsChecked="{Binding CustomFormat}"
64-
GroupName="format">Custom format:</RadioButton>
62+
IsChecked="{Binding CustomFormat}">Custom format:</RadioButton>
6563
<TextBox
6664
Margin="110,114,6,0" Height="22.959" VerticalAlignment="Top"
6765
Text="{Binding CustomFormatString}"
@@ -150,17 +148,21 @@
150148
Content="Allow setting custom name on audio tracks (limited player support)"
151149
IsChecked="{Binding ShowAudioTrackNameField}"
152150
Height="16" HorizontalAlignment="Left" Margin="15,40,0,0" VerticalAlignment="Top" />
151+
<CheckBox
152+
Content="Enable LibDVDNav (change requires program restart)"
153+
IsChecked="{Binding EnableLibDvdNav}"
154+
Height="16" HorizontalAlignment="Left" Margin="15,62,0,0" VerticalAlignment="Top" />
153155
<CheckBox
154156
Content="Keep scans after completion (allows editing completed items)"
155157
IsChecked="{Binding KeepScansAfterCompletion}"
156-
Height="16" HorizontalAlignment="Left" Margin="15,62,0,0" VerticalAlignment="Top" />
157-
<Label Content="Logging Verbosity:" Height="28" HorizontalAlignment="Left" Margin="6,86,0,0" VerticalAlignment="Top" />
158-
<ComboBox Height="23" HorizontalAlignment="Left" Margin="121,89,0,0" SelectedValue="{Binding LogVerbosity}" SelectedValuePath="Content" VerticalAlignment="Top" Width="42">
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">
159161
<ComboBoxItem Content="0" />
160162
<ComboBoxItem Content="1" />
161163
<ComboBoxItem Content="2" />
162164
</ComboBox>
163-
<TextBlock Height="40" HorizontalAlignment="Left" Margin="182,91,0,0" Text="Log verbosity will take effect on next scan or program restart." TextWrapping="Wrap" VerticalAlignment="Top" Visibility="{Binding LogVerbosityWarningVisible, Converter={StaticResource VisibilityConverter}}" />
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}}" />
164166
</Grid>
165167
</TabItem>
166168
</TabControl>

VidCoder/ViewModel/OptionsDialogViewModel.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public OptionsDialogViewModel(IUpdater updateService)
6262
this.previewCount = Settings.Default.PreviewCount;
6363
this.showAudioTrackNameField = Settings.Default.ShowAudioTrackNameField;
6464
this.keepScansAfterCompletion = Settings.Default.KeepScansAfterCompletion;
65+
this.enableLibDvdNav = Settings.Default.EnableLibDvdNav;
6566
this.autoPauseProcesses = new ObservableCollection<string>();
6667
StringCollection autoPauseStringCollection = Settings.Default.AutoPauseProcesses;
6768
if (autoPauseStringCollection != null)
@@ -380,6 +381,21 @@ public bool ShowAudioTrackNameField
380381
}
381382
}
382383

384+
private bool enableLibDvdNav;
385+
public bool EnableLibDvdNav
386+
{
387+
get
388+
{
389+
return this.enableLibDvdNav;
390+
}
391+
392+
set
393+
{
394+
this.enableLibDvdNav = value;
395+
this.RaisePropertyChanged(() => this.EnableLibDvdNav);
396+
}
397+
}
398+
383399
private bool keepScansAfterCompletion;
384400
public bool KeepScansAfterCompletion
385401
{
@@ -436,6 +452,7 @@ public RelayCommand SaveSettingsCommand
436452
Settings.Default.AutoPauseProcesses = autoPauseStringCollection;
437453
Settings.Default.PreviewCount = this.PreviewCount;
438454
Settings.Default.ShowAudioTrackNameField = this.ShowAudioTrackNameField;
455+
Settings.Default.EnableLibDvdNav = this.EnableLibDvdNav;
439456
Settings.Default.KeepScansAfterCompletion = this.KeepScansAfterCompletion;
440457
Settings.Default.Save();
441458

VidCoder/app.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@
162162
<setting name="QueueTitlesDialogPlacement2" serializeAs="String">
163163
<value />
164164
</setting>
165+
<setting name="EnableLibDvdNav" serializeAs="String">
166+
<value>True</value>
167+
</setting>
165168
</VidCoder.Properties.Settings>
166169
</userSettings>
167170
</configuration>

0 commit comments

Comments
 (0)