mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[GUI] Add options to fix/generate subchannels on media dumping.
This commit is contained in:
@@ -154,6 +154,18 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
||||
bool _useSidecar;
|
||||
[ObservableProperty]
|
||||
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,
|
||||
[CanBeNull] ScsiInfo scsiInfo = null)
|
||||
@@ -171,17 +183,22 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
||||
Encodings = [];
|
||||
|
||||
// Defaults
|
||||
StopOnError = false;
|
||||
Force = false;
|
||||
Persistent = true;
|
||||
Resume = true;
|
||||
Track1Pregap = false;
|
||||
UseSidecar = true;
|
||||
Trim = true;
|
||||
ExistingMetadata = false;
|
||||
Retries = 5;
|
||||
Skipped = 512;
|
||||
CreateSidecar = true;
|
||||
StopOnError = false;
|
||||
Force = false;
|
||||
Persistent = true;
|
||||
Resume = true;
|
||||
Track1Pregap = false;
|
||||
UseSidecar = true;
|
||||
Trim = true;
|
||||
ExistingMetadata = false;
|
||||
Retries = 5;
|
||||
Skipped = 512;
|
||||
CreateSidecar = true;
|
||||
FixSubchannelPosition = true;
|
||||
RetrySubchannel = true;
|
||||
FixSubchannel = false;
|
||||
FixSubchannelCrc = false;
|
||||
GenerateSubchannels = false;
|
||||
|
||||
MediaType mediaType;
|
||||
|
||||
@@ -290,6 +307,8 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
||||
_ => false
|
||||
};
|
||||
|
||||
HasSubchannel = Track1PregapVisible;
|
||||
|
||||
_dev = device;
|
||||
_devicePath = devicePath;
|
||||
}
|
||||
@@ -690,13 +709,13 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
||||
DumpSubchannel.Any,
|
||||
0,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
FixSubchannelPosition,
|
||||
RetrySubchannel,
|
||||
FixSubchannel,
|
||||
FixSubchannelCrc,
|
||||
true,
|
||||
errorLog,
|
||||
false,
|
||||
GenerateSubchannels,
|
||||
64,
|
||||
true,
|
||||
true,
|
||||
@@ -778,7 +797,9 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
||||
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);
|
||||
}
|
||||
@@ -53,103 +53,127 @@
|
||||
<Grid Margin="12"
|
||||
RowSpacing="8"
|
||||
RowDefinitions="Auto, *, Auto">
|
||||
<StackPanel Grid.Row="0"
|
||||
Orientation="Vertical"
|
||||
IsVisible="{Binding OptionsVisible, Mode=OneWay}"
|
||||
Spacing="8">
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Output_format}"
|
||||
VerticalAlignment="Center" />
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding PluginsList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedPlugin, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsEnabled="{Binding FormatReadOnly, Mode=OneWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding DestinationCommand, Mode=OneWay}"
|
||||
IsEnabled="{Binding DestinationEnabled, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Choose}" />
|
||||
</Button>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Destination, Mode=OneWay}"
|
||||
IsReadOnly="True" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding StopOnError, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Stop_media_dump_on_first_error}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Force, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Continue_dumping_whatever_happens}" />
|
||||
</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Retry_passes}"
|
||||
VerticalAlignment="Center" />
|
||||
<NumericUpDown Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Value="{Binding Retries, Mode=TwoWay}"
|
||||
Increment="1"
|
||||
Minimum="0" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding Persistent, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Try_to_recover_partial_or_incorrect_data}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Resume, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Create_or_use_resume_mapfile}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Track1Pregap, Mode=TwoWay}"
|
||||
IsVisible="{Binding Track1PregapVisible, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Try_to_read_track_1_pregap}" />
|
||||
</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Skipped_sectors_on_error}"
|
||||
VerticalAlignment="Center" />
|
||||
<NumericUpDown Grid.Column="1"
|
||||
Increment="1"
|
||||
Minimum="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Value="{Binding Skipped, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding CreateSidecar, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Create_Aaru_Metadata_sidecar}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Trim, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Trim_errors_from_skipped_sectors}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding ExistingMetadata, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Take_metadata_from_existing_CICM_XML_sidecar}" />
|
||||
</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
IsVisible="{Binding EncodingVisible, Mode=OneWay}"
|
||||
ColumnSpacing="8">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Encoding_to_use_on_metadata_sidecar_creation}" />
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding Encodings, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedEncoding, Mode=TwoWay}"
|
||||
IsEnabled="{Binding EncodingEnabled, Mode=OneWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
<!-- TODO: Image options -->
|
||||
</StackPanel>
|
||||
<ScrollViewer Grid.Row="0"
|
||||
IsVisible="{Binding OptionsVisible, Mode=OneWay}">
|
||||
<StackPanel Orientation="Vertical"
|
||||
Spacing="8">
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Output_format}"
|
||||
VerticalAlignment="Center" />
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding PluginsList, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedPlugin, Mode=TwoWay}"
|
||||
HorizontalAlignment="Stretch"
|
||||
IsEnabled="{Binding FormatReadOnly, Mode=OneWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</Grid>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<Button Grid.Column="0"
|
||||
Command="{Binding DestinationCommand, Mode=OneWay}"
|
||||
IsEnabled="{Binding DestinationEnabled, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Choose}" />
|
||||
</Button>
|
||||
<TextBox Grid.Column="1"
|
||||
Text="{Binding Destination, Mode=OneWay}"
|
||||
IsReadOnly="True" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding StopOnError, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Stop_media_dump_on_first_error}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Force, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Continue_dumping_whatever_happens}" />
|
||||
</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Retry_passes}"
|
||||
VerticalAlignment="Center" />
|
||||
<NumericUpDown Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Value="{Binding Retries, Mode=TwoWay}"
|
||||
Increment="1"
|
||||
Minimum="0" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding Persistent, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Try_to_recover_partial_or_incorrect_data}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Resume, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Create_or_use_resume_mapfile}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Track1Pregap, Mode=TwoWay}"
|
||||
IsVisible="{Binding Track1PregapVisible, Mode=OneWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Try_to_read_track_1_pregap}" />
|
||||
</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
ColumnSpacing="8">
|
||||
<TextBlock Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Skipped_sectors_on_error}"
|
||||
VerticalAlignment="Center" />
|
||||
<NumericUpDown Grid.Column="1"
|
||||
Increment="1"
|
||||
Minimum="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Value="{Binding Skipped, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<CheckBox IsChecked="{Binding CreateSidecar, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Create_Aaru_Metadata_sidecar}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding Trim, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Trim_errors_from_skipped_sectors}" />
|
||||
</CheckBox>
|
||||
<CheckBox IsChecked="{Binding ExistingMetadata, Mode=TwoWay}">
|
||||
<TextBlock Text="{x:Static localization:UI.Take_metadata_from_existing_CICM_XML_sidecar}" />
|
||||
</CheckBox>
|
||||
<Grid ColumnDefinitions="Auto, *"
|
||||
IsVisible="{Binding EncodingVisible, Mode=OneWay}"
|
||||
ColumnSpacing="8">
|
||||
<TextBox Grid.Column="0"
|
||||
Text="{x:Static localization:UI.Encoding_to_use_on_metadata_sidecar_creation}" />
|
||||
<ComboBox Grid.Column="1"
|
||||
ItemsSource="{Binding Encodings, Mode=OneWay}"
|
||||
SelectedItem="{Binding SelectedEncoding, Mode=TwoWay}"
|
||||
IsEnabled="{Binding EncodingEnabled, Mode=OneWay}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
</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 -->
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
<Grid Grid.Row="1"
|
||||
RowDefinitions="Auto,Auto,*,Auto,Auto"
|
||||
VerticalAlignment="Stretch"
|
||||
|
||||
Reference in New Issue
Block a user