[GUI] Add options to fix/generate subchannels on media dumping.

This commit is contained in:
2025-11-21 19:30:00 +00:00
parent 19e03d3614
commit fa7b047eae
2 changed files with 160 additions and 115 deletions

View File

@@ -154,6 +154,18 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
bool _useSidecar; bool _useSidecar;
[ObservableProperty] [ObservableProperty]
bool _createSidecar; bool _createSidecar;
[ObservableProperty]
bool _hasSubchannel;
[ObservableProperty]
bool _fixSubchannelPosition;
[ObservableProperty]
bool _retrySubchannel;
[ObservableProperty]
bool _fixSubchannel;
[ObservableProperty]
bool _fixSubchannelCrc;
[ObservableProperty]
bool _generateSubchannels;
public MediaDumpViewModel(Device device, string devicePath, DeviceInfo deviceInfo, Window view, public MediaDumpViewModel(Device device, string devicePath, DeviceInfo deviceInfo, Window view,
[CanBeNull] ScsiInfo scsiInfo = null) [CanBeNull] ScsiInfo scsiInfo = null)
@@ -182,6 +194,11 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
Retries = 5; Retries = 5;
Skipped = 512; Skipped = 512;
CreateSidecar = true; CreateSidecar = true;
FixSubchannelPosition = true;
RetrySubchannel = true;
FixSubchannel = false;
FixSubchannelCrc = false;
GenerateSubchannels = false;
MediaType mediaType; MediaType mediaType;
@@ -290,6 +307,8 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
_ => false _ => false
}; };
HasSubchannel = Track1PregapVisible;
_dev = device; _dev = device;
_devicePath = devicePath; _devicePath = devicePath;
} }
@@ -690,13 +709,13 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
DumpSubchannel.Any, DumpSubchannel.Any,
0, 0,
false, false,
false, FixSubchannelPosition,
false, RetrySubchannel,
false, FixSubchannel,
false, FixSubchannelCrc,
true, true,
errorLog, errorLog,
false, GenerateSubchannels,
64, 64,
true, true,
true, true,
@@ -778,7 +797,9 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
await WorkFinishedAsync(); await WorkFinishedAsync();
}); });
async void ErrorMessage(string text) => await Dispatcher.UIThread.InvokeAsync(() => Log += text + Environment.NewLine); async void ErrorMessage(string text) =>
await Dispatcher.UIThread.InvokeAsync(() => Log += text + Environment.NewLine);
async void UpdateStatus(string text) => await Dispatcher.UIThread.InvokeAsync(() => Log += text + Environment.NewLine); async void UpdateStatus(string text) =>
await Dispatcher.UIThread.InvokeAsync(() => Log += text + Environment.NewLine);
} }

View File

@@ -53,9 +53,9 @@
<Grid Margin="12" <Grid Margin="12"
RowSpacing="8" RowSpacing="8"
RowDefinitions="Auto, *, Auto"> RowDefinitions="Auto, *, Auto">
<StackPanel Grid.Row="0" <ScrollViewer Grid.Row="0"
Orientation="Vertical" IsVisible="{Binding OptionsVisible, Mode=OneWay}">
IsVisible="{Binding OptionsVisible, Mode=OneWay}" <StackPanel Orientation="Vertical"
Spacing="8"> Spacing="8">
<Grid ColumnDefinitions="Auto, *" <Grid ColumnDefinitions="Auto, *"
ColumnSpacing="8"> ColumnSpacing="8">
@@ -148,8 +148,32 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
</Grid> </Grid>
<StackPanel Orientation="Vertical"
IsVisible="{Binding HasSubchannel, Mode=OneWay}">
<CheckBox IsChecked="{Binding FixSubchannelPosition, Mode=TwoWay}">
<TextBlock Text="{x:Static localization:UI.Fix_subchannel_position_help}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox IsChecked="{Binding RetrySubchannel, Mode=TwoWay}">
<TextBlock Text="{x:Static localization:UI.Retry_subchannel_help}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox IsChecked="{Binding FixSubchannel, Mode=TwoWay}">
<TextBlock Text="{x:Static localization:UI.Fix_subchannel_help}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox IsChecked="{Binding FixSubchannelCrc, Mode=TwoWay}">
<TextBlock Text="{x:Static localization:UI.Fix_subchannel_crc_help}"
TextWrapping="Wrap" />
</CheckBox>
<CheckBox IsChecked="{Binding GenerateSubchannels, Mode=TwoWay}">
<TextBlock Text="{x:Static localization:UI.Generate_subchannels_dump_help}"
TextWrapping="Wrap" />
</CheckBox>
</StackPanel>
<!-- TODO: Image options --> <!-- TODO: Image options -->
</StackPanel> </StackPanel>
</ScrollViewer>
<Grid Grid.Row="1" <Grid Grid.Row="1"
RowDefinitions="Auto,Auto,*,Auto,Auto" RowDefinitions="Auto,Auto,*,Auto,Auto"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"