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;
|
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)
|
||||||
@@ -171,17 +183,22 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
|
|||||||
Encodings = [];
|
Encodings = [];
|
||||||
|
|
||||||
// Defaults
|
// Defaults
|
||||||
StopOnError = false;
|
StopOnError = false;
|
||||||
Force = false;
|
Force = false;
|
||||||
Persistent = true;
|
Persistent = true;
|
||||||
Resume = true;
|
Resume = true;
|
||||||
Track1Pregap = false;
|
Track1Pregap = false;
|
||||||
UseSidecar = true;
|
UseSidecar = true;
|
||||||
Trim = true;
|
Trim = true;
|
||||||
ExistingMetadata = false;
|
ExistingMetadata = false;
|
||||||
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);
|
||||||
}
|
}
|
||||||
@@ -53,103 +53,127 @@
|
|||||||
<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">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
Text="{x:Static localization:UI.Output_format}"
|
Text="{x:Static localization:UI.Output_format}"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
<ComboBox Grid.Column="1"
|
<ComboBox Grid.Column="1"
|
||||||
ItemsSource="{Binding PluginsList, Mode=OneWay}"
|
ItemsSource="{Binding PluginsList, Mode=OneWay}"
|
||||||
SelectedItem="{Binding SelectedPlugin, Mode=TwoWay}"
|
SelectedItem="{Binding SelectedPlugin, Mode=TwoWay}"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
IsEnabled="{Binding FormatReadOnly, Mode=OneWay}">
|
IsEnabled="{Binding FormatReadOnly, Mode=OneWay}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid ColumnDefinitions="Auto, *"
|
<Grid ColumnDefinitions="Auto, *"
|
||||||
ColumnSpacing="8">
|
ColumnSpacing="8">
|
||||||
<Button Grid.Column="0"
|
<Button Grid.Column="0"
|
||||||
Command="{Binding DestinationCommand, Mode=OneWay}"
|
Command="{Binding DestinationCommand, Mode=OneWay}"
|
||||||
IsEnabled="{Binding DestinationEnabled, Mode=OneWay}">
|
IsEnabled="{Binding DestinationEnabled, Mode=OneWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Choose}" />
|
<TextBlock Text="{x:Static localization:UI.ButtonLabel_Choose}" />
|
||||||
</Button>
|
</Button>
|
||||||
<TextBox Grid.Column="1"
|
<TextBox Grid.Column="1"
|
||||||
Text="{Binding Destination, Mode=OneWay}"
|
Text="{Binding Destination, Mode=OneWay}"
|
||||||
IsReadOnly="True" />
|
IsReadOnly="True" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<CheckBox IsChecked="{Binding StopOnError, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding StopOnError, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Stop_media_dump_on_first_error}" />
|
<TextBlock Text="{x:Static localization:UI.Stop_media_dump_on_first_error}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding Force, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding Force, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Continue_dumping_whatever_happens}" />
|
<TextBlock Text="{x:Static localization:UI.Continue_dumping_whatever_happens}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<Grid ColumnDefinitions="Auto, *"
|
<Grid ColumnDefinitions="Auto, *"
|
||||||
ColumnSpacing="8">
|
ColumnSpacing="8">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
Text="{x:Static localization:UI.Retry_passes}"
|
Text="{x:Static localization:UI.Retry_passes}"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
<NumericUpDown Grid.Column="1"
|
<NumericUpDown Grid.Column="1"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Value="{Binding Retries, Mode=TwoWay}"
|
Value="{Binding Retries, Mode=TwoWay}"
|
||||||
Increment="1"
|
Increment="1"
|
||||||
Minimum="0" />
|
Minimum="0" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<CheckBox IsChecked="{Binding Persistent, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding Persistent, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Try_to_recover_partial_or_incorrect_data}" />
|
<TextBlock Text="{x:Static localization:UI.Try_to_recover_partial_or_incorrect_data}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding Resume, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding Resume, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Create_or_use_resume_mapfile}" />
|
<TextBlock Text="{x:Static localization:UI.Create_or_use_resume_mapfile}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding Track1Pregap, Mode=TwoWay}"
|
<CheckBox IsChecked="{Binding Track1Pregap, Mode=TwoWay}"
|
||||||
IsVisible="{Binding Track1PregapVisible, Mode=OneWay}">
|
IsVisible="{Binding Track1PregapVisible, Mode=OneWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Try_to_read_track_1_pregap}" />
|
<TextBlock Text="{x:Static localization:UI.Try_to_read_track_1_pregap}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<Grid ColumnDefinitions="Auto, *"
|
<Grid ColumnDefinitions="Auto, *"
|
||||||
ColumnSpacing="8">
|
ColumnSpacing="8">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
Text="{x:Static localization:UI.Skipped_sectors_on_error}"
|
Text="{x:Static localization:UI.Skipped_sectors_on_error}"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
<NumericUpDown Grid.Column="1"
|
<NumericUpDown Grid.Column="1"
|
||||||
Increment="1"
|
Increment="1"
|
||||||
Minimum="1"
|
Minimum="1"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Value="{Binding Skipped, Mode=TwoWay}" />
|
Value="{Binding Skipped, Mode=TwoWay}" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<CheckBox IsChecked="{Binding CreateSidecar, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding CreateSidecar, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Create_Aaru_Metadata_sidecar}" />
|
<TextBlock Text="{x:Static localization:UI.Create_Aaru_Metadata_sidecar}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding Trim, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding Trim, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Trim_errors_from_skipped_sectors}" />
|
<TextBlock Text="{x:Static localization:UI.Trim_errors_from_skipped_sectors}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<CheckBox IsChecked="{Binding ExistingMetadata, Mode=TwoWay}">
|
<CheckBox IsChecked="{Binding ExistingMetadata, Mode=TwoWay}">
|
||||||
<TextBlock Text="{x:Static localization:UI.Take_metadata_from_existing_CICM_XML_sidecar}" />
|
<TextBlock Text="{x:Static localization:UI.Take_metadata_from_existing_CICM_XML_sidecar}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<Grid ColumnDefinitions="Auto, *"
|
<Grid ColumnDefinitions="Auto, *"
|
||||||
IsVisible="{Binding EncodingVisible, Mode=OneWay}"
|
IsVisible="{Binding EncodingVisible, Mode=OneWay}"
|
||||||
ColumnSpacing="8">
|
ColumnSpacing="8">
|
||||||
<TextBox Grid.Column="0"
|
<TextBox Grid.Column="0"
|
||||||
Text="{x:Static localization:UI.Encoding_to_use_on_metadata_sidecar_creation}" />
|
Text="{x:Static localization:UI.Encoding_to_use_on_metadata_sidecar_creation}" />
|
||||||
<ComboBox Grid.Column="1"
|
<ComboBox Grid.Column="1"
|
||||||
ItemsSource="{Binding Encodings, Mode=OneWay}"
|
ItemsSource="{Binding Encodings, Mode=OneWay}"
|
||||||
SelectedItem="{Binding SelectedEncoding, Mode=TwoWay}"
|
SelectedItem="{Binding SelectedEncoding, Mode=TwoWay}"
|
||||||
IsEnabled="{Binding EncodingEnabled, Mode=OneWay}">
|
IsEnabled="{Binding EncodingEnabled, Mode=OneWay}">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
<TextBlock Text="{Binding Name, Mode=OneWay}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
<!-- TODO: Image options -->
|
<StackPanel Orientation="Vertical"
|
||||||
</StackPanel>
|
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"
|
<Grid Grid.Row="1"
|
||||||
RowDefinitions="Auto,Auto,*,Auto,Auto"
|
RowDefinitions="Auto,Auto,*,Auto,Auto"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
|
|||||||
Reference in New Issue
Block a user