Colorify device information display

This commit is contained in:
2025-08-17 19:53:32 +01:00
parent bd91d8bebc
commit 91ebdd60a0
4 changed files with 221 additions and 121 deletions

View File

@@ -64,12 +64,16 @@ public static class PrintScsiModePages
{ {
if(page.Subpage != 0) if(page.Subpage != 0)
{ {
AaruLogging.WriteLine(Localization.Core.Found_unknown_vendor_mode_page_0_subpage_1, AaruLogging
page.Page, .WriteLine($"[red]{Localization.Core.Found_unknown_vendor_mode_page_0_subpage_1}[/]",
page.Subpage); $"[teal]{page.Page}[/]",
$"[teal]{page.Subpage}[/]");
} }
else else
AaruLogging.WriteLine(Localization.Core.Found_unknown_vendor_mode_page_0, page.Page); {
AaruLogging.WriteLine($"[red]{Localization.Core.Found_unknown_vendor_mode_page_0}[/]",
$"[teal]{page.Page}[/]");
}
} }
break; break;
@@ -376,12 +380,15 @@ public static class PrintScsiModePages
{ {
if(page.Subpage != 0) if(page.Subpage != 0)
{ {
AaruLogging.WriteLine(Localization.Core.Found_unknown_mode_page_0_subpage_1, AaruLogging.WriteLine($"[red]{Localization.Core.Found_unknown_mode_page_0_subpage_1}[/]",
page.Page, $"[teal]{page.Page}[/]",
page.Subpage); $"[teal]{page.Subpage}[/]");
} }
else else
AaruLogging.WriteLine(Localization.Core.Found_unknown_mode_page_0, page.Page); {
AaruLogging.WriteLine($"[red]{Localization.Core.Found_unknown_mode_page_0}[/]",
$"[teal]{page.Page}[/]");
}
break; break;
} }

View File

@@ -6075,5 +6075,29 @@ namespace Aaru.Localization {
return ResourceManager.GetString("List_devices_command", resourceCulture); return ResourceManager.GetString("List_devices_command", resourceCulture);
} }
} }
public static string CD_reading_offset_not_found_in_database {
get {
return ResourceManager.GetString("CD_reading_offset_not_found_in_database", resourceCulture);
}
}
public static string CD_reading_offset_is_0_samples_1_bytes {
get {
return ResourceManager.GetString("CD_reading_offset_is_0_samples_1_bytes", resourceCulture);
}
}
public static string Could_not_get_any_kind_of_information_from_the_device {
get {
return ResourceManager.GetString("Could_not_get_any_kind_of_information_from_the_device", resourceCulture);
}
}
public static string Optimal_multiple_read_is_0_sectors {
get {
return ResourceManager.GetString("Optimal_multiple_read_is_0_sectors", resourceCulture);
}
}
} }
} }

View File

@@ -3114,4 +3114,16 @@ Do you want to continue?</value>
<data name="List_devices_command" xml:space="preserve"> <data name="List_devices_command" xml:space="preserve">
<value>List devices</value> <value>List devices</value>
</data> </data>
<data name="CD_reading_offset_not_found_in_database" xml:space="preserve">
<value>CD reading offset not found in database.</value>
</data>
<data name="CD_reading_offset_is_0_samples_1_bytes" xml:space="preserve">
<value>CD reading offset is {0} samples ({1} bytes).</value>
</data>
<data name="Could_not_get_any_kind_of_information_from_the_device" xml:space="preserve">
<value>Could not get any kind of information from the device !!!</value>
</data>
<data name="Optimal_multiple_read_is_0_sectors" xml:space="preserve">
<value>Optimal multiple read is {0} sectors.</value>
</data>
</root> </root>

View File

@@ -115,21 +115,41 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
{ {
table = new Table table = new Table
{ {
Title = new TableTitle($"[bold]{UI.Title_USB_device}[/]") Title = new TableTitle($"[bold][blue]{UI.Title_USB_device}[/][/]")
}; };
AaruLogging.Information(UI.Title_USB_device);
table.HideHeaders(); table.HideHeaders();
table.AddColumn(""); table.AddColumn("");
table.AddColumn(""); table.AddColumn("");
table.Columns[0].RightAligned(); table.Columns[0].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
if(dev.UsbDescriptors != null) table.AddRow(UI.Title_Descriptor_size, $"{dev.UsbDescriptors.Length}"); if(dev.UsbDescriptors != null)
{
table.AddRow($"[bold][slateblue1]{UI.Title_Descriptor_size}[/][/]",
$"[lime]{dev.UsbDescriptors.Length}[/]");
}
table.AddRow(UI.Title_Vendor_ID, $"{dev.UsbVendorId:X4}"); table.AddRow($"[bold][slateblue1]{UI.Title_Vendor_ID}[/][/]", $"[lime]{dev.UsbVendorId:X4}[/]");
table.AddRow(UI.Title_Product_ID, $"{dev.UsbProductId:X4}"); table.AddRow($"[bold][slateblue1]{UI.Title_Product_ID}[/][/]", $"[lime]{dev.UsbProductId:X4}[/]");
table.AddRow(UI.Title_Manufacturer, Markup.Escape(dev.UsbManufacturerString ?? ""));
table.AddRow(UI.Title_Product, Markup.Escape(dev.UsbProductString ?? "")); table.AddRow($"[bold][slateblue1]{UI.Title_Manufacturer}[/][/]",
table.AddRow(UI.Title_Serial_number, Markup.Escape(dev.UsbSerialString ?? "")); $"[purple]{Markup.Escape(dev.UsbManufacturerString ?? "")}[/]");
table.AddRow($"[bold][slateblue1]{UI.Title_Product}[/][/]",
$"[purple]{Markup.Escape(dev.UsbProductString ?? "")}[/]");
table.AddRow($"[bold][slateblue1]{UI.Title_Serial_number}[/][/]",
$"[aqua]{Markup.Escape(dev.UsbSerialString ?? "")}[/]");
AaruLogging.Information($"{UI.Title_Vendor_ID}: {dev.UsbVendorId:X4}");
AaruLogging.Information($"{UI.Title_Product_ID}: {dev.UsbProductId:X4}");
AaruLogging.Information($"{UI.Title_Manufacturer}: {dev.UsbManufacturerString}");
AaruLogging.Information($"{UI.Title_Product}: {dev.UsbProductString}");
AaruLogging.Information($"{UI.Title_Serial_number}: {dev.UsbSerialString}");
AnsiConsole.Write(table); AnsiConsole.Write(table);
AaruLogging.WriteLine(); AaruLogging.WriteLine();
@@ -142,16 +162,31 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
Title = new TableTitle($"[bold]{UI.Title_FireWire_device}[/]") Title = new TableTitle($"[bold]{UI.Title_FireWire_device}[/]")
}; };
AaruLogging.Information(UI.Title_FireWire_device);
table.HideHeaders(); table.HideHeaders();
table.AddColumn(""); table.AddColumn("");
table.AddColumn(""); table.AddColumn("");
table.Columns[0].RightAligned(); table.Columns[0].RightAligned();
table.Border(TableBorder.Rounded);
table.BorderColor(Color.Yellow);
table.AddRow(UI.Title_Vendor_ID, $"{dev.FireWireVendor:X6}"); table.AddRow($"[bold][slateblue1]{UI.Title_Vendor_ID}[/][/]", $"[lime]{dev.FireWireVendor:X6}[/]");
table.AddRow(UI.Title_Model_ID, $"{dev.FireWireModel:X6}"); table.AddRow($"[bold][slateblue1]{UI.Title_Model_ID}[/][/]", $"[lime]{dev.FireWireModel:X6}[/]");
table.AddRow(UI.Title_Vendor, $"{Markup.Escape(dev.FireWireVendorName ?? "")}");
table.AddRow(UI.Title_Model, $"{Markup.Escape(dev.FireWireModelName ?? "")}"); table.AddRow($"[bold][slateblue1]{UI.Title_Vendor}[/][/]",
table.AddRow(UI.Title_GUID, $"{dev.FireWireGuid:X16}"); $"[purple]{Markup.Escape(dev.FireWireVendorName ?? "")}[/]");
table.AddRow($"[bold][slateblue1]{UI.Title_Model}[/][/]",
$"[purple]{Markup.Escape(dev.FireWireModelName ?? "")}[/]");
table.AddRow($"[bold][slateblue1]{UI.Title_GUID}[/][/]", $"[lime]{dev.FireWireGuid:X16}[/]");
AaruLogging.Information($"{UI.Title_Vendor_ID}: {dev.FireWireVendor:X6}");
AaruLogging.Information($"{UI.Title_Model_ID}: {dev.FireWireModel:X6}");
AaruLogging.Information($"{UI.Title_Vendor}: {dev.FireWireVendorName}");
AaruLogging.Information($"{UI.Title_Model}: {dev.FireWireModelName}");
AaruLogging.Information($"{UI.Title_GUID}: {dev.FireWireGuid:X16}");
AnsiConsole.Write(table); AnsiConsole.Write(table);
AaruLogging.WriteLine(); AaruLogging.WriteLine();
@@ -359,16 +394,21 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
switch(page.Key) switch(page.Key)
{ {
case >= 0x01 and <= 0x7F: case >= 0x01 and <= 0x7F:
AaruLogging.WriteLine(Localization.Core.ASCII_Page_0_1, AaruLogging.WriteLine($"[bold][blue]{Localization.Core.ASCII_Page_0_1}[/][/]",
page.Key, $"[italic][teal]{page.Key}[/][/]",
EVPD.DecodeASCIIPage(page.Value)); Markup.Escape(EVPD.DecodeASCIIPage(page.Value)));
DataFile.WriteTo(MODULE_NAME, settings.OutputPrefix, page.Value); DataFile.WriteTo(MODULE_NAME, settings.OutputPrefix, page.Value);
break; break;
case 0x80: case 0x80:
AaruLogging.WriteLine(Localization.Core.Unit_Serial_Number_0, string decoded = EVPD.DecodePage80(page.Value);
EVPD.DecodePage80(page.Value));
if(decoded != null)
{
AaruLogging.WriteLine($"[bold][blue]{Localization.Core.Unit_Serial_Number_0}[/][/]",
$"[italic][teal]{Markup.Escape(EVPD.DecodePage80(page.Value))}[/][/]");
}
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
settings.OutputPrefix, settings.OutputPrefix,
@@ -388,7 +428,8 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
break; break;
case 0x82: case 0x82:
AaruLogging.WriteLine(Localization.Core.ASCII_implemented_operating_definitions_0, AaruLogging
.WriteLine($"[bold][blue]{Localization.Core.ASCII_implemented_operating_definitions_0}[/][/]",
EVPD.DecodePage82(page.Value)); EVPD.DecodePage82(page.Value));
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
@@ -459,8 +500,9 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
break; break;
case 0xB1: case 0xB1:
AaruLogging.WriteLine(Localization.Core.Manufacturer_assigned_Serial_Number_0, AaruLogging
EVPD.DecodePageB1(page.Value)); .WriteLine($"[bold][blue]{Localization.Core.Manufacturer_assigned_Serial_Number_0}[/][/]",
Markup.Escape(EVPD.DecodePageB1(page.Value)));
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
settings.OutputPrefix, settings.OutputPrefix,
@@ -470,7 +512,8 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
break; break;
case 0xB2: case 0xB2:
AaruLogging.WriteLine(Localization.Core.TapeAlert_Supported_Flags_Bitmap_0, AaruLogging
.WriteLine($"[bold][blue]{Localization.Core.TapeAlert_Supported_Flags_Bitmap_0}[/][/]",
EVPD.DecodePageB2(page.Value)); EVPD.DecodePageB2(page.Value));
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
@@ -481,8 +524,9 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
break; break;
case 0xB3: case 0xB3:
AaruLogging.WriteLine(Localization.Core.Automation_Device_Serial_Number_0, AaruLogging
EVPD.DecodePageB3(page.Value)); .WriteLine($"[bold][blue]{Localization.Core.Automation_Device_Serial_Number_0}[/][/]",
Markup.Escape(EVPD.DecodePageB3(page.Value)));
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
settings.OutputPrefix, settings.OutputPrefix,
@@ -492,8 +536,9 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
break; break;
case 0xB4: case 0xB4:
AaruLogging.WriteLine(Localization.Core.Data_Transfer_Device_Element_Address_0, AaruLogging
EVPD.DecodePageB4(page.Value)); .WriteLine($"[bold][blue]{Localization.Core.Data_Transfer_Device_Element_Address_0}[/][/]",
Markup.Escape(EVPD.DecodePageB4(page.Value)));
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
settings.OutputPrefix, settings.OutputPrefix,
@@ -613,9 +658,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
{ {
if(page.Key == 0x00) continue; if(page.Key == 0x00) continue;
AaruLogging.Debug(MODULE_NAME, AaruLogging.Debug(MODULE_NAME, Localization.Core.Found_undecoded_SCSI_VPD_page_0, page.Key);
Localization.Core.Found_undecoded_SCSI_VPD_page_0,
page.Key);
DataFile.WriteTo(MODULE_NAME, DataFile.WriteTo(MODULE_NAME,
settings.OutputPrefix, settings.OutputPrefix,
@@ -664,9 +707,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
Features.SeparatedFeatures ftr = Features.Separate(devInfo.MmcConfiguration); Features.SeparatedFeatures ftr = Features.Separate(devInfo.MmcConfiguration);
AaruLogging.Debug(MODULE_NAME, AaruLogging.Debug(MODULE_NAME, Localization.Core.GET_CONFIGURATION_length_is_0, ftr.DataLength);
Localization.Core.GET_CONFIGURATION_length_is_0,
ftr.DataLength);
AaruLogging.Debug(MODULE_NAME, AaruLogging.Debug(MODULE_NAME,
Localization.Core.GET_CONFIGURATION_current_profile_is_0, Localization.Core.GET_CONFIGURATION_current_profile_is_0,
@@ -922,10 +963,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
} }
} }
else else
{ AaruLogging.Debug(MODULE_NAME, Localization.Core.GET_CONFIGURATION_returned_no_feature_descriptors);
AaruLogging.Debug(MODULE_NAME,
Localization.Core.GET_CONFIGURATION_returned_no_feature_descriptors);
}
} }
if(devInfo.RPC != null) AaruLogging.WriteLine(CSS_CPRM.PrettifyRegionalPlaybackControlState(devInfo.RPC)); if(devInfo.RPC != null) AaruLogging.WriteLine(CSS_CPRM.PrettifyRegionalPlaybackControlState(devInfo.RPC));
@@ -938,24 +976,24 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
"PLEXTOR READ EEPROM", "PLEXTOR READ EEPROM",
devInfo.PlextorFeatures.Eeprom); devInfo.PlextorFeatures.Eeprom);
AaruLogging.WriteLine(Localization.Core.Drive_has_loaded_a_total_of_0_discs, AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_has_loaded_a_total_of_0_discs}[/]",
devInfo.PlextorFeatures.Discs); $"[teal]{devInfo.PlextorFeatures.Discs}[/]");
AaruLogging.WriteLine(Localization.Core.Drive_has_spent_0_reading_CDs, AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_has_spent_0_reading_CDs}[/]",
devInfo.PlextorFeatures.CdReadTime.Seconds().Humanize(minUnit: TimeUnit.Second)); $"[aqua]{devInfo.PlextorFeatures.CdReadTime.Seconds().Humanize(minUnit: TimeUnit.Second)}[/]");
AaruLogging.WriteLine(Localization.Core.Drive_has_spent_0_writing_CDs, AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_has_spent_0_writing_CDs}[/]",
devInfo.PlextorFeatures.CdWriteTime.Seconds().Humanize(minUnit: TimeUnit.Second)); $"[aqua]{devInfo.PlextorFeatures.CdWriteTime.Seconds().Humanize(minUnit: TimeUnit.Second)}[/]");
if(devInfo.PlextorFeatures.IsDvd) if(devInfo.PlextorFeatures.IsDvd)
{ {
AaruLogging.WriteLine(Localization.Core.Drive_has_spent_0_reading_DVDs, AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_has_spent_0_reading_DVDs}[/]",
devInfo.PlextorFeatures.DvdReadTime.Seconds() $"[aqua]{devInfo.PlextorFeatures.DvdReadTime.Seconds()
.Humanize(minUnit: TimeUnit.Second)); .Humanize(minUnit: TimeUnit.Second)}[/]");
AaruLogging.WriteLine(Localization.Core.Drive_has_spent_0_writing_DVDs, AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_has_spent_0_writing_DVDs}[/]",
devInfo.PlextorFeatures.DvdWriteTime.Seconds() $"[aqua]{devInfo.PlextorFeatures.DvdWriteTime.Seconds()
.Humanize(minUnit: TimeUnit.Second)); .Humanize(minUnit: TimeUnit.Second)}[/]");
} }
} }
@@ -965,147 +1003,162 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
{ {
if(devInfo.PlextorFeatures.PoweRecRecommendedSpeed > 0) if(devInfo.PlextorFeatures.PoweRecRecommendedSpeed > 0)
{ {
AaruLogging.WriteLine(Localization.Core.Drive_supports_PoweRec_is_enabled_and_recommends_0, AaruLogging
devInfo.PlextorFeatures.PoweRecRecommendedSpeed); .WriteLine($"[slateblue1]{Localization.Core.Drive_supports_PoweRec_is_enabled_and_recommends_0}[/]",
$"[lime]{devInfo.PlextorFeatures.PoweRecRecommendedSpeed}[/]");
} }
else else
AaruLogging.WriteLine(Localization.Core.Drive_supports_PoweRec_and_has_it_enabled); AaruLogging
.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_PoweRec_and_has_it_enabled}[/]");
if(devInfo.PlextorFeatures.PoweRecSelected > 0) if(devInfo.PlextorFeatures.PoweRecSelected > 0)
{ {
AaruLogging.WriteLine(Localization.Core AaruLogging.WriteLine($"[slateblue1]{Localization.Core
.Selected_PoweRec_speed_for_currently_inserted_media_is_0_1, .Selected_PoweRec_speed_for_currently_inserted_media_is_0_1}[/]",
devInfo.PlextorFeatures.PoweRecSelected, $"[lime]{devInfo.PlextorFeatures.PoweRecSelected}[/]",
devInfo.PlextorFeatures.PoweRecSelected / 177); $"[teal]{devInfo.PlextorFeatures.PoweRecSelected / 177}[/]");
} }
if(devInfo.PlextorFeatures.PoweRecMax > 0) if(devInfo.PlextorFeatures.PoweRecMax > 0)
{ {
AaruLogging.WriteLine(Localization.Core AaruLogging.WriteLine($"[slateblue1]{Localization.Core
.Maximum_PoweRec_speed_for_currently_inserted_media_is_0_1, .Maximum_PoweRec_speed_for_currently_inserted_media_is_0_1}[/]",
devInfo.PlextorFeatures.PoweRecMax, $"[lime]{devInfo.PlextorFeatures.PoweRecMax}[/]",
devInfo.PlextorFeatures.PoweRecMax / 177); $"[teal]{devInfo.PlextorFeatures.PoweRecMax / 177}[/]");
} }
if(devInfo.PlextorFeatures.PoweRecLast > 0) if(devInfo.PlextorFeatures.PoweRecLast > 0)
{ {
AaruLogging.WriteLine(Localization.Core.Last_used_PoweRec_was_0_1, AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Last_used_PoweRec_was_0_1}[/]",
devInfo.PlextorFeatures.PoweRecLast, $"[lime]{devInfo.PlextorFeatures.PoweRecLast}[/]",
devInfo.PlextorFeatures.PoweRecLast / 177); $"[teal]{devInfo.PlextorFeatures.PoweRecLast / 177}[/]");
} }
} }
else else
AaruLogging.WriteLine(Localization.Core.Drive_supports_PoweRec_and_has_it_disabled); AaruLogging
.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_PoweRec_and_has_it_disabled}[/]");
} }
if(devInfo.PlextorFeatures?.SilentMode == true) if(devInfo.PlextorFeatures?.SilentMode == true)
{ {
AaruLogging.WriteLine(Localization.Core.Drive_supports_Plextor_SilentMode); AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_Plextor_SilentMode}[/]");
if(devInfo.PlextorFeatures.SilentModeEnabled) if(devInfo.PlextorFeatures.SilentModeEnabled)
{ {
AaruLogging.WriteLine(Localization.Core.Plextor_SilentMode_is_enabled); AaruLogging.WriteLine($"[green]{Localization.Core.Plextor_SilentMode_is_enabled}[/]");
AaruLogging.WriteLine("\t" + AaruLogging.WriteLine("\t" +
(devInfo.PlextorFeatures.AccessTimeLimit == 2 (devInfo.PlextorFeatures.AccessTimeLimit == 2
? Localization.Core.Access_time_is_slow ? $"[slateblue1]{Localization.Core.Access_time_is_slow}[/]"
: Localization.Core.Access_time_is_fast)); : $"[slateblue1]{Localization.Core.Access_time_is_fast}[/]"));
if(devInfo.PlextorFeatures.CdReadSpeedLimit > 0) if(devInfo.PlextorFeatures.CdReadSpeedLimit > 0)
{ {
AaruLogging.WriteLine("\t" + Localization.Core.CD_read_speed_limited_to_0, AaruLogging.WriteLine("\t" + $"[slateblue1]{Localization.Core.CD_read_speed_limited_to_0}[/]",
devInfo.PlextorFeatures.CdReadSpeedLimit); $"[teal]{devInfo.PlextorFeatures.CdReadSpeedLimit}[/]");
} }
if(devInfo.PlextorFeatures.DvdReadSpeedLimit > 0 && devInfo.PlextorFeatures.IsDvd) if(devInfo.PlextorFeatures.DvdReadSpeedLimit > 0 && devInfo.PlextorFeatures.IsDvd)
{ {
AaruLogging.WriteLine("\t" + Localization.Core.DVD_read_speed_limited_to_0, AaruLogging.WriteLine("\t" + $"[slateblue1]{Localization.Core.DVD_read_speed_limited_to_0}[/]",
devInfo.PlextorFeatures.DvdReadSpeedLimit); $"[teal]{devInfo.PlextorFeatures.DvdReadSpeedLimit}[/]");
} }
if(devInfo.PlextorFeatures.CdWriteSpeedLimit > 0) if(devInfo.PlextorFeatures.CdWriteSpeedLimit > 0)
{ {
AaruLogging.WriteLine("\t" + Localization.Core.CD_write_speed_limited_to_0, AaruLogging.WriteLine("\t" + $"[slateblue1]{Localization.Core.CD_write_speed_limited_to_0}[/]",
devInfo.PlextorFeatures.CdWriteSpeedLimit); $"[teal]{devInfo.PlextorFeatures.CdWriteSpeedLimit}[/]");
} }
} }
} }
if(devInfo.PlextorFeatures?.GigaRec == true) if(devInfo.PlextorFeatures?.GigaRec == true)
AaruLogging.WriteLine(Localization.Core.Drive_supports_Plextor_GigaRec); AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_Plextor_GigaRec}[/]");
if(devInfo.PlextorFeatures?.SecuRec == true) if(devInfo.PlextorFeatures?.SecuRec == true)
AaruLogging.WriteLine(Localization.Core.Drive_supports_Plextor_SecuRec); AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_Plextor_SecuRec}[/]");
if(devInfo.PlextorFeatures?.SpeedRead == true) if(devInfo.PlextorFeatures?.SpeedRead == true)
{ {
AaruLogging.WriteLine(devInfo.PlextorFeatures.SpeedReadEnabled AaruLogging.WriteLine(devInfo.PlextorFeatures.SpeedReadEnabled
? Localization.Core.Drive_supports_Plextor_SpeedRead_and_has_it_enabled ? $"[green]{Localization.Core.Drive_supports_Plextor_SpeedRead_and_has_it_enabled}[/]"
: Localization.Core.Drive_supports_Plextor_SpeedRead); : $"[slateblue1]{Localization.Core.Drive_supports_Plextor_SpeedRead}[/]");
} }
if(devInfo.PlextorFeatures?.Hiding == true) if(devInfo.PlextorFeatures?.Hiding == true)
{ {
AaruLogging.WriteLine(Localization.Core.Drive_supports_hiding_CDRs_and_forcing_single_session); AaruLogging
.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_hiding_CDRs_and_forcing_single_session}[/]");
if(devInfo.PlextorFeatures.HidesRecordables) if(devInfo.PlextorFeatures.HidesRecordables)
AaruLogging.WriteLine(Localization.Core.Drive_currently_hides_CDRs); AaruLogging.WriteLine($"[green]{Localization.Core.Drive_currently_hides_CDRs}[/]");
if(devInfo.PlextorFeatures.HidesSessions) if(devInfo.PlextorFeatures.HidesSessions)
AaruLogging.WriteLine(Localization.Core.Drive_currently_forces_single_session); AaruLogging.WriteLine($"[green]{Localization.Core.Drive_currently_forces_single_session}[/]");
} }
if(devInfo.PlextorFeatures?.VariRec == true) if(devInfo.PlextorFeatures?.VariRec == true)
AaruLogging.WriteLine(Localization.Core.Drive_supports_Plextor_VariRec); AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_Plextor_VariRec}[/]");
if(devInfo.PlextorFeatures?.IsDvd == true) if(devInfo.PlextorFeatures?.IsDvd == true)
{ {
if(devInfo.PlextorFeatures.VariRecDvd) if(devInfo.PlextorFeatures.VariRecDvd)
AaruLogging.WriteLine(Localization.Core.Drive_supports_Plextor_VariRec_for_DVDs); AaruLogging
.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_Plextor_VariRec_for_DVDs}[/]");
if(devInfo.PlextorFeatures.BitSetting) if(devInfo.PlextorFeatures.BitSetting)
AaruLogging.WriteLine(Localization.Core.Drive_supports_bitsetting_DVD_R_book_type); AaruLogging
.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_bitsetting_DVD_R_book_type}[/]");
if(devInfo.PlextorFeatures.BitSettingDl) if(devInfo.PlextorFeatures.BitSettingDl)
AaruLogging.WriteLine(Localization.Core.Drive_supports_bitsetting_DVD_R_DL_book_type); AaruLogging
.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_bitsetting_DVD_R_DL_book_type}[/]");
if(devInfo.PlextorFeatures.DvdPlusWriteTest) if(devInfo.PlextorFeatures.DvdPlusWriteTest)
AaruLogging.WriteLine(Localization.Core.Drive_supports_test_writing_DVD_Plus); AaruLogging.WriteLine($"[slateblue1]{Localization.Core.Drive_supports_test_writing_DVD_Plus}[/]");
} }
if(devInfo.ScsiInquiry.Value.KreonPresent) if(devInfo.ScsiInquiry.Value.KreonPresent)
{ {
AaruLogging.WriteLine($"[bold]{UI.Title_Drive_has_kreon_firmware}[/]"); AaruLogging.WriteLine($"[bold][blue]{UI.Title_Drive_has_kreon_firmware}[/][/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse))
AaruLogging.WriteLine("\t" + Localization.Core.Can_do_challenge_response_with_Xbox_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_do_challenge_response_with_Xbox_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs))
AaruLogging.WriteLine("\t" + Localization.Core.Can_read_and_decrypt_SS_from_Xbox_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_read_and_decrypt_SS_from_Xbox_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock))
AaruLogging.WriteLine("\t" + Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock))
AaruLogging.WriteLine("\t" + Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse360)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse360))
AaruLogging.WriteLine("\t" + Localization.Core.Can_do_challenge_response_with_Xbox_360_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_do_challenge_response_with_Xbox_360_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs360)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs360))
AaruLogging.WriteLine("\t" + Localization.Core.Can_read_and_decrypt_SS_from_Xbox_360_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_read_and_decrypt_SS_from_Xbox_360_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock360)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock360))
AaruLogging.WriteLine("\t" + Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_360_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_set_xtreme_unlock_state_with_Xbox_360_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock360)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock360))
AaruLogging.WriteLine("\t" + Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_360_discs); AaruLogging
.WriteLine($"\t[slateblue1]{Localization.Core.Can_set_wxripper_unlock_state_with_Xbox_360_discs}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.Lock)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.Lock))
AaruLogging.WriteLine("\t" + Localization.Core.Can_set_Kreon_locked_state); AaruLogging.WriteLine($"\t[slateblue1]{Localization.Core.Can_set_Kreon_locked_state}[/]");
if(devInfo.KreonFeatures.HasFlag(KreonFeatures.ErrorSkipping)) if(devInfo.KreonFeatures.HasFlag(KreonFeatures.ErrorSkipping))
AaruLogging.WriteLine("\t" + Localization.Core.Kreon_Can_skip_read_errors); AaruLogging.WriteLine($"\t[slateblue1]{Localization.Core.Kreon_Can_skip_read_errors}[/]");
} }
if(devInfo.BlockLimits != null) if(devInfo.BlockLimits != null)
@@ -1116,7 +1169,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
"SSC READ BLOCK LIMITS", "SSC READ BLOCK LIMITS",
devInfo.BlockLimits); devInfo.BlockLimits);
AaruLogging.WriteLine(Localization.Core.Block_limits_for_device); AaruLogging.WriteLine($"[bold][blue]{Localization.Core.Block_limits_for_device}[/][/]");
AaruLogging.WriteLine(BlockLimits.Prettify(devInfo.BlockLimits)); AaruLogging.WriteLine(BlockLimits.Prettify(devInfo.BlockLimits));
} }
@@ -1130,7 +1183,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
if(devInfo.DensitySupportHeader.HasValue) if(devInfo.DensitySupportHeader.HasValue)
{ {
AaruLogging.WriteLine(UI.Densities_supported_by_device); AaruLogging.WriteLine($"[bold][blue]{UI.Densities_supported_by_device}[/][/]");
AaruLogging.WriteLine(DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader)); AaruLogging.WriteLine(DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader));
} }
} }
@@ -1145,7 +1198,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
if(devInfo.MediaTypeSupportHeader.HasValue) if(devInfo.MediaTypeSupportHeader.HasValue)
{ {
AaruLogging.WriteLine(UI.Medium_types_supported_by_device); AaruLogging.WriteLine($"[bold][blue]{UI.Medium_types_supported_by_device}[/][/]");
AaruLogging.WriteLine(DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader)); AaruLogging.WriteLine(DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader));
} }
@@ -1193,7 +1246,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
AaruLogging.WriteLine("{0}", Decoders.MMC.Decoders.PrettifyExtendedCSD(devInfo.ExtendedCSD)); AaruLogging.WriteLine("{0}", Decoders.MMC.Decoders.PrettifyExtendedCSD(devInfo.ExtendedCSD));
} }
if(noInfo) AaruLogging.WriteLine("Could not get any kind of information from the device !!!"); if(noInfo) AaruLogging.Error(UI.Could_not_get_any_kind_of_information_from_the_device);
} }
break; break;
@@ -1253,7 +1306,7 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
AaruLogging.WriteLine("{0}", Decoders.SecureDigital.Decoders.PrettifySCR(devInfo.SCR)); AaruLogging.WriteLine("{0}", Decoders.SecureDigital.Decoders.PrettifySCR(devInfo.SCR));
} }
if(noInfo) AaruLogging.WriteLine("Could not get any kind of information from the device !!!"); if(noInfo) AaruLogging.Error(UI.Could_not_get_any_kind_of_information_from_the_device);
} }
break; break;
@@ -1273,13 +1326,15 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
d.Revision == dev.FirmwareRevision); d.Revision == dev.FirmwareRevision);
if(dbDev is null) if(dbDev is null)
AaruLogging.WriteLine(Localization.Core.Device_not_in_database); AaruLogging.WriteLine($"[red]{Localization.Core.Device_not_in_database}[/]");
else else
{ {
AaruLogging.WriteLine(string.Format(Localization.Core.Device_in_database_since_0, dbDev.LastSynchronized)); AaruLogging.WriteLine(string.Format($"[slateblue1]{Localization.Core.Device_in_database_since_0}[/]",
$"[yellow3]{dbDev.LastSynchronized:d}[/]"));
if(dbDev.OptimalMultipleSectorsRead > 0) if(dbDev.OptimalMultipleSectorsRead > 0)
AaruLogging.WriteLine($"Optimal multiple read is {dbDev.LastSynchronized} sectors."); AaruLogging.WriteLine(string.Format($"[slateblue1]{UI.Optimal_multiple_read_is_0_sectors}[/]",
$"[aqua]{dbDev.OptimalMultipleSectorsRead}[/]"));
} }
if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice) return (int)ErrorNumber.NoError; if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice) return (int)ErrorNumber.NoError;
@@ -1291,8 +1346,10 @@ sealed class DeviceInfoCommand : Command<DeviceInfoCommand.Settings>
(d.Model == dev.Model || d.Model == dev.Model.Replace('/', '-'))); (d.Model == dev.Model || d.Model == dev.Model.Replace('/', '-')));
AaruLogging.WriteLine(cdOffset is null AaruLogging.WriteLine(cdOffset is null
? "CD reading offset not found in database." ? $"[slateblue1]{UI.CD_reading_offset_not_found_in_database}[/]"
: $"CD reading offset is {cdOffset.Offset} samples ({cdOffset.Offset * 4} bytes)."); : string.Format($"[slateblue1]{UI.CD_reading_offset_is_0_samples_1_bytes}[/]",
$"[lime]{cdOffset.Offset}[/]",
$"[lime]{cdOffset.Offset * 4}[/]"));
return (int)ErrorNumber.NoError; return (int)ErrorNumber.NoError;
} }