mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 11:14:25 +00:00
44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
using System;
|
|
using Aaru.CommonTypes.Enums;
|
|
using Aaru.CommonTypes.Interfaces;
|
|
using Aaru.Localization;
|
|
|
|
namespace Aaru.Core.Image;
|
|
|
|
public partial class Convert
|
|
{
|
|
/// <summary>
|
|
/// Validates tape image format compatibility
|
|
/// Checks if input is tape-based but output format doesn't support tape images
|
|
/// </summary>
|
|
/// <returns>Error if unsupported media type combination detected</returns>
|
|
ErrorNumber ValidateTapeImage(ITapeImage inputTape, IWritableTapeImage outputTape)
|
|
{
|
|
if(_aborted || inputTape?.IsTape != true || outputTape is not null) return ErrorNumber.NoError;
|
|
|
|
StoppingErrorMessage?.Invoke(UI.Input_format_contains_a_tape_image_and_is_not_supported_by_output_format);
|
|
|
|
return ErrorNumber.UnsupportedMedia;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Configures output format for tape image handling
|
|
/// Calls SetTape() on output to initialize tape mode if both input and output support tapes
|
|
/// </summary>
|
|
/// <returns>Error if tape mode initialization fails</returns>
|
|
ErrorNumber SetupTapeImage(ITapeImage inputTape, IWritableTapeImage outputTape)
|
|
{
|
|
if(_aborted || inputTape?.IsTape != true || outputTape == null) return ErrorNumber.NoError;
|
|
|
|
bool ret = outputTape.SetTape();
|
|
|
|
// Cannot set image to tape mode
|
|
if(ret) return ErrorNumber.NoError;
|
|
|
|
StoppingErrorMessage?.Invoke(UI.Error_setting_output_image_in_tape_mode +
|
|
Environment.NewLine +
|
|
_outputImage.ErrorMessage);
|
|
|
|
return ErrorNumber.WriteError;
|
|
}
|
|
} |