mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Migrate bluray info from Eto.Forms to Avalonia.
This commit is contained in:
5
.idea/.idea.Aaru/.idea/contentModel.xml
generated
5
.idea/.idea.Aaru/.idea/contentModel.xml
generated
@@ -1277,6 +1277,8 @@
|
||||
<e p="Tabs" t="Include">
|
||||
<e p="AtaInfoTab.xaml" t="Include" />
|
||||
<e p="AtaInfoTab.xaml.cs" t="Include" />
|
||||
<e p="BlurayInfoTab.xaml" t="Include" />
|
||||
<e p="BlurayInfoTab.xaml.cs" t="Include" />
|
||||
<e p="CompactDiscInfoTab.xaml" t="Include" />
|
||||
<e p="CompactDiscInfoTab.xaml.cs" t="Include" />
|
||||
<e p="DvdInfoTab.xaml" t="Include" />
|
||||
@@ -1285,8 +1287,6 @@
|
||||
<e p="DvdWritableInfoTab.xaml.cs" t="Include" />
|
||||
<e p="ScsiInfoTab.xaml" t="Include" />
|
||||
<e p="ScsiInfoTab.xaml.cs" t="Include" />
|
||||
<e p="tabBlurayInfo.xeto" t="Include" />
|
||||
<e p="tabBlurayInfo.xeto.cs" t="Include" />
|
||||
<e p="tabPcmciaInfo.xeto" t="Include" />
|
||||
<e p="tabPcmciaInfo.xeto.cs" t="Include" />
|
||||
<e p="tabSdMmcInfo.xeto" t="Include" />
|
||||
@@ -1298,6 +1298,7 @@
|
||||
<e p="ViewModels" t="Include">
|
||||
<e p="AboutDialogViewModel.cs" t="Include" />
|
||||
<e p="AtaInfoViewModel.cs" t="Include" />
|
||||
<e p="BlurayInfoViewModel.cs" t="Include" />
|
||||
<e p="CompactDiscInfoViewModel.cs" t="Include" />
|
||||
<e p="ConsoleWindowViewModel.cs" t="Include" />
|
||||
<e p="DvdInfoViewModel.cs" t="Include" />
|
||||
|
||||
@@ -144,6 +144,12 @@
|
||||
</TabItem.Header>
|
||||
<ContentControl Content="{Binding DvdWritableInfo}" />
|
||||
</TabItem>
|
||||
<TabItem IsVisible="{Binding !!BlurayInfo}">
|
||||
<TabItem.Header>
|
||||
<TextBlock Text="Blu-ray" />
|
||||
</TabItem.Header>
|
||||
<ContentControl Content="{Binding BlurayInfo}" />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||
<Button Command="{Binding EntropyCommand}">
|
||||
|
||||
@@ -148,29 +148,30 @@ namespace Aaru.Gui.Panels
|
||||
scsiInfo.DecodedXboxSecuritySector);
|
||||
|
||||
tabInfos.Pages.Add(tabXboxInfo);
|
||||
/*
|
||||
var tabDvdWritableInfo = new tabDvdWritableInfo();
|
||||
/*
|
||||
var tabDvdWritableInfo = new tabDvdWritableInfo();
|
||||
|
||||
tabDvdWritableInfo.LoadData(scsiInfo.MediaType, scsiInfo.DvdRamDds, scsiInfo.DvdRamCartridgeStatus,
|
||||
scsiInfo.DvdRamSpareArea, scsiInfo.LastBorderOutRmd,
|
||||
scsiInfo.DvdPreRecordedInfo, scsiInfo.DvdrMediaIdentifier,
|
||||
scsiInfo.DvdrPhysicalInformation, scsiInfo.HddvdrMediumStatus,
|
||||
scsiInfo.HddvdrLastRmd, scsiInfo.DvdrLayerCapacity,
|
||||
scsiInfo.DvdrDlMiddleZoneStart, scsiInfo.DvdrDlJumpIntervalSize,
|
||||
scsiInfo.DvdrDlManualLayerJumpStartLba, scsiInfo.DvdrDlRemapAnchorPoint,
|
||||
scsiInfo.DvdPlusAdip, scsiInfo.DvdPlusDcb);
|
||||
tabDvdWritableInfo.LoadData(scsiInfo.MediaType, scsiInfo.DvdRamDds, scsiInfo.DvdRamCartridgeStatus,
|
||||
scsiInfo.DvdRamSpareArea, scsiInfo.LastBorderOutRmd,
|
||||
scsiInfo.DvdPreRecordedInfo, scsiInfo.DvdrMediaIdentifier,
|
||||
scsiInfo.DvdrPhysicalInformation, scsiInfo.HddvdrMediumStatus,
|
||||
scsiInfo.HddvdrLastRmd, scsiInfo.DvdrLayerCapacity,
|
||||
scsiInfo.DvdrDlMiddleZoneStart, scsiInfo.DvdrDlJumpIntervalSize,
|
||||
scsiInfo.DvdrDlManualLayerJumpStartLba, scsiInfo.DvdrDlRemapAnchorPoint,
|
||||
scsiInfo.DvdPlusAdip, scsiInfo.DvdPlusDcb);
|
||||
|
||||
tabInfos.Pages.Add(tabDvdWritableInfo);
|
||||
*/
|
||||
var tabBlurayInfo = new tabBlurayInfo();
|
||||
tabInfos.Pages.Add(tabDvdWritableInfo);
|
||||
*/
|
||||
/*
|
||||
var tabBlurayInfo = new tabBlurayInfo();
|
||||
|
||||
tabBlurayInfo.LoadData(scsiInfo.BlurayDiscInformation, scsiInfo.BlurayBurstCuttingArea, scsiInfo.BlurayDds,
|
||||
scsiInfo.BlurayCartridgeStatus, scsiInfo.BluraySpareAreaInformation,
|
||||
scsiInfo.BlurayPowResources, scsiInfo.BlurayTrackResources, scsiInfo.BlurayRawDfl,
|
||||
scsiInfo.BlurayPac);
|
||||
|
||||
tabInfos.Pages.Add(tabBlurayInfo);
|
||||
tabBlurayInfo.LoadData(scsiInfo.BlurayDiscInformation, scsiInfo.BlurayBurstCuttingArea, scsiInfo.BlurayDds,
|
||||
scsiInfo.BlurayCartridgeStatus, scsiInfo.BluraySpareAreaInformation,
|
||||
scsiInfo.BlurayPowResources, scsiInfo.BlurayTrackResources, scsiInfo.BlurayRawDfl,
|
||||
scsiInfo.BlurayPac);
|
||||
|
||||
tabInfos.Pages.Add(tabBlurayInfo);
|
||||
*/
|
||||
this.devicePath = devicePath;
|
||||
}
|
||||
|
||||
|
||||
70
Aaru.Gui/Tabs/BlurayInfoTab.xaml
Normal file
70
Aaru.Gui/Tabs/BlurayInfoTab.xaml
Normal file
@@ -0,0 +1,70 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:vm="clr-namespace:Aaru.Gui.ViewModels" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Aaru.Gui.Tabs.BlurayInfoTab">
|
||||
<Design.DataContext>
|
||||
<vm:BlurayInfoViewModel />
|
||||
</Design.DataContext>
|
||||
<StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BlurayDiscInformationText}">
|
||||
<TextBlock Text="Disc information" />
|
||||
<TextBox IsReadOnly="True" Text="{Binding BlurayDiscInformationText}" />
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BlurayBurstCuttingAreaText}">
|
||||
<TextBlock Text="Burst Cutting Area" />
|
||||
<TextBox IsReadOnly="True" Text="{Binding BlurayBurstCuttingAreaText}" />
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BlurayDdsText}">
|
||||
<TextBlock Text="Disc Definition Structure" /> <TextBox IsReadOnly="True" Text="{Binding BlurayDdsText}" />
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BlurayCartridgeStatusText}">
|
||||
<TextBlock Text="Cartridge Status" />
|
||||
<TextBox IsReadOnly="True" Text="{Binding BlurayCartridgeStatusText}" />
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BluraySpareAreaInformationText}">
|
||||
<TextBlock Text="Spare Area Information" />
|
||||
<TextBox IsReadOnly="True" Text="{Binding BluraySpareAreaInformationText}" />
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BlurayPowResourcesText}">
|
||||
<TextBlock Text="Pseudo-OverWrite Resources" />
|
||||
<TextBox IsReadOnly="True" Text="{Binding BlurayPowResourcesText}" />
|
||||
</StackPanel>
|
||||
<StackPanel IsVisible="{Binding !!BlurayTrackResourcesText}">
|
||||
<TextBlock Text="Track Resources" />
|
||||
<TextBox IsReadOnly="True" Text="{Binding BlurayTrackResourcesText}" />
|
||||
</StackPanel>
|
||||
<Button Command="{Binding SaveBlurayDiscInformationCommand}"
|
||||
IsVisible="{Binding SaveBlurayDiscInformationVisible}">
|
||||
<TextBlock Text="Save Disc Information" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayBurstCuttingAreaCommand}"
|
||||
IsVisible="{Binding SaveBlurayBurstCuttingAreaVisible}">
|
||||
<TextBlock Text="Save Burst Cutting Area" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayDdsCommand}" IsVisible="{Binding SaveBlurayDdsVisible}">
|
||||
<TextBlock Text="Save Save Disc Definition Structure" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayCartridgeStatusCommand}"
|
||||
IsVisible="{Binding SaveBlurayCartridgeStatusVisible}">
|
||||
<TextBlock Text="Save Cartridge Status" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBluraySpareAreaInformationCommand}"
|
||||
IsVisible="{Binding SaveBluraySpareAreaInformationVisible}">
|
||||
<TextBlock Text="Save Spare Area Information" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayPowResourcesCommand}" IsVisible="{Binding SaveBlurayPowResourcesVisible}">
|
||||
<TextBlock Text="Save Pseudo-OverWrite Resources" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayTrackResourcesCommand}"
|
||||
IsVisible="{Binding SaveBlurayTrackResourcesVisible}">
|
||||
<TextBlock Text="Save Track Resources" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayRawDflCommand}" IsVisible="{Binding SaveBlurayRawDflVisible}">
|
||||
<TextBlock Text="Save raw DFL" />
|
||||
</Button>
|
||||
<Button Command="{Binding SaveBlurayPacCommand}" IsVisible="{Binding SaveBlurayPacVisible}">
|
||||
<TextBlock Text="Save PAC" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
12
Aaru.Gui/Tabs/BlurayInfoTab.xaml.cs
Normal file
12
Aaru.Gui/Tabs/BlurayInfoTab.xaml.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Aaru.Gui.Tabs
|
||||
{
|
||||
public class BlurayInfoTab : UserControl
|
||||
{
|
||||
public BlurayInfoTab() => InitializeComponent();
|
||||
|
||||
void InitializeComponent() => AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ============================================================================
|
||||
//
|
||||
// Filename : tabBlurayInfo.xeto
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Media information.
|
||||
//
|
||||
// ==[ Description ] ==========================================================
|
||||
//
|
||||
// Defines the structure for the Blu-ray media information.
|
||||
//
|
||||
// ==[ License ] ==============================================================
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ============================================================================
|
||||
// Copyright © 2011-2020 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
-->
|
||||
|
||||
<TabPage Text="Blu-ray" Visible="False" xmlns="http://schema.picoe.ca/eto.forms"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBlurayDiscInformation" Text="Disc information" Visible="False">
|
||||
<TextArea ID="txtBlurayDiscInformation" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBlurayBurstCuttingArea" Text="Burst Cutting Area" Visible="False">
|
||||
<TextArea ID="txtBlurayBurstCuttingArea" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBlurayDds" Text="Disc Definition Structure" Visible="False">
|
||||
<TextArea ID="txtBlurayDds" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBlurayCartridgeStatus" Text="Cartridge Status" Visible="False">
|
||||
<TextArea ID="txtBlurayCartridgeStatus" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBluraySpareAreaInformation" Text="Spare Area Information" Visible="False">
|
||||
<TextArea ID="txtBluraySpareAreaInformation" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBlurayPowResources" Text="Pseudo-OverWrite Resources" Visible="False">
|
||||
<TextArea ID="txtBlurayPowResources" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpBlurayTrackResources" Text="Track Resources" Visible="False">
|
||||
<TextArea ID="txtBlurayTrackResources" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnSaveBlurayDiscInformationClick" ID="btnSaveBlurayDiscInformation"
|
||||
Text="Save Disc Information" Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayBurstCuttingAreaClick" ID="btnSaveBlurayBurstCuttingArea"
|
||||
Text="Save Burst Cutting Area" Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayDdsClick" ID="btnSaveBlurayDds" Text="Save Disc Definition Structure"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayCartridgeStatusClick" ID="btnSaveBlurayCartridgeStatus"
|
||||
Text="Save Cartridge Status" Visible="False"/>
|
||||
<Button Click="OnBtnSaveBluraySpareAreaInformationClick" ID="btnSaveBluraySpareAreaInformation"
|
||||
Text="Save Spare Area Information" Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayPowResourcesClick" ID="btnSaveBlurayPowResources"
|
||||
Text="Save Pseudo-OverWrite Resources" Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayTrackResourcesClick" ID="btnSaveBlurayTrackResources" Text="Save Track Resources"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayRawDflClick" ID="btnSaveBlurayRawDfl" Text="Save raw DFL" Visible="False"/>
|
||||
<Button Click="OnBtnSaveBlurayPacClick" ID="btnSaveBlurayPac" Text="Save PAC" Visible="False"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
@@ -1,204 +0,0 @@
|
||||
// /***************************************************************************
|
||||
// Aaru Data Preservation Suite
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : tabBlurayInfo.xeto.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Media information.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Implements the Blu-ray media information.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2020 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Aaru.Decoders.Bluray;
|
||||
using Eto.Forms;
|
||||
using Eto.Serialization.Xaml;
|
||||
|
||||
namespace Aaru.Gui.Tabs
|
||||
{
|
||||
public class tabBlurayInfo : TabPage
|
||||
{
|
||||
byte[] BurstCuttingArea;
|
||||
byte[] CartridgeStatus;
|
||||
byte[] Dds;
|
||||
byte[] DiscInformation;
|
||||
byte[] Pac;
|
||||
byte[] PowResources;
|
||||
byte[] RawDfl;
|
||||
byte[] SpareAreaInformation;
|
||||
byte[] TrackResources;
|
||||
|
||||
public tabBlurayInfo() => XamlReader.Load(this);
|
||||
|
||||
internal void LoadData(byte[] blurayDiscInformation, byte[] blurayBurstCuttingArea, byte[] blurayDds,
|
||||
byte[] blurayCartridgeStatus, byte[] bluraySpareAreaInformation,
|
||||
byte[] blurayPowResources, byte[] blurayTrackResources, byte[] blurayRawDfl,
|
||||
byte[] blurayPac)
|
||||
{
|
||||
DiscInformation = blurayDiscInformation;
|
||||
BurstCuttingArea = blurayBurstCuttingArea;
|
||||
Dds = blurayDds;
|
||||
CartridgeStatus = blurayCartridgeStatus;
|
||||
SpareAreaInformation = bluraySpareAreaInformation;
|
||||
PowResources = blurayPowResources;
|
||||
TrackResources = blurayTrackResources;
|
||||
RawDfl = blurayRawDfl;
|
||||
Pac = blurayPac;
|
||||
|
||||
if(blurayDiscInformation != null)
|
||||
{
|
||||
grpBlurayDiscInformation.Visible = true;
|
||||
btnSaveBlurayDiscInformation.Visible = true;
|
||||
txtBlurayDiscInformation.Text = DI.Prettify(blurayDiscInformation);
|
||||
}
|
||||
|
||||
if(blurayBurstCuttingArea != null)
|
||||
{
|
||||
grpBlurayBurstCuttingArea.Visible = true;
|
||||
btnSaveBlurayBurstCuttingArea.Visible = true;
|
||||
txtBlurayBurstCuttingArea.Text = BCA.Prettify(blurayBurstCuttingArea);
|
||||
}
|
||||
|
||||
if(blurayDds != null)
|
||||
{
|
||||
grpBlurayDds.Visible = true;
|
||||
btnSaveBlurayDds.Visible = true;
|
||||
txtBlurayDds.Text = DDS.Prettify(blurayDds);
|
||||
}
|
||||
|
||||
if(blurayCartridgeStatus != null)
|
||||
{
|
||||
grpBlurayCartridgeStatus.Visible = true;
|
||||
btnSaveBlurayCartridgeStatus.Visible = true;
|
||||
txtBlurayCartridgeStatus.Text = Cartridge.Prettify(blurayCartridgeStatus);
|
||||
}
|
||||
|
||||
if(bluraySpareAreaInformation != null)
|
||||
{
|
||||
grpBluraySpareAreaInformation.Visible = true;
|
||||
btnSaveBluraySpareAreaInformation.Visible = true;
|
||||
txtBluraySpareAreaInformation.Text = Spare.Prettify(bluraySpareAreaInformation);
|
||||
}
|
||||
|
||||
if(blurayPowResources != null)
|
||||
{
|
||||
grpBlurayPowResources.Visible = true;
|
||||
btnSaveBlurayPowResources.Visible = true;
|
||||
txtBlurayPowResources.Text = Decoders.SCSI.MMC.DiscInformation.Prettify(blurayPowResources);
|
||||
}
|
||||
|
||||
if(blurayTrackResources != null)
|
||||
{
|
||||
grpBlurayTrackResources.Visible = true;
|
||||
btnSaveBlurayTrackResources.Visible = true;
|
||||
txtBlurayTrackResources.Text = Decoders.SCSI.MMC.DiscInformation.Prettify(blurayTrackResources);
|
||||
}
|
||||
|
||||
btnSaveBlurayRawDfl.Visible = blurayRawDfl != null;
|
||||
btnSaveBlurayPac.Visible = blurayPac != null;
|
||||
|
||||
Visible = grpBlurayDiscInformation.Visible || grpBlurayBurstCuttingArea.Visible ||
|
||||
grpBlurayDds.Visible ||
|
||||
grpBlurayCartridgeStatus.Visible || grpBluraySpareAreaInformation.Visible ||
|
||||
grpBlurayPowResources.Visible || grpBlurayTrackResources.Visible ||
|
||||
btnSaveBlurayRawDfl.Visible ||
|
||||
btnSaveBlurayPac.Visible;
|
||||
}
|
||||
|
||||
void SaveElement(byte[] data)
|
||||
{
|
||||
var dlgSaveBinary = new SaveFileDialog();
|
||||
|
||||
dlgSaveBinary.Filters.Add(new FileFilter
|
||||
{
|
||||
Extensions = new[]
|
||||
{
|
||||
"*.bin"
|
||||
},
|
||||
Name = "Binary"
|
||||
});
|
||||
|
||||
DialogResult result = dlgSaveBinary.ShowDialog(this);
|
||||
|
||||
if(result != DialogResult.Ok)
|
||||
return;
|
||||
|
||||
var saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
saveFs.Close();
|
||||
}
|
||||
|
||||
protected void OnBtnSaveBlurayDiscInformationClick(object sender, EventArgs e) => SaveElement(DiscInformation);
|
||||
|
||||
protected void OnBtnSaveBlurayBurstCuttingAreaClick(object sender, EventArgs e) =>
|
||||
SaveElement(BurstCuttingArea);
|
||||
|
||||
protected void OnBtnSaveBlurayDdsClick(object sender, EventArgs e) => SaveElement(Dds);
|
||||
|
||||
protected void OnBtnSaveBlurayCartridgeStatusClick(object sender, EventArgs e) => SaveElement(CartridgeStatus);
|
||||
|
||||
protected void OnBtnSaveBluraySpareAreaInformationClick(object sender, EventArgs e) =>
|
||||
SaveElement(SpareAreaInformation);
|
||||
|
||||
protected void OnBtnSaveBlurayPowResourcesClick(object sender, EventArgs e) => SaveElement(PowResources);
|
||||
|
||||
protected void OnBtnSaveBlurayTrackResourcesClick(object sender, EventArgs e) => SaveElement(TrackResources);
|
||||
|
||||
protected void OnBtnSaveBlurayRawDflClick(object sender, EventArgs e) => SaveElement(RawDfl);
|
||||
|
||||
protected void OnBtnSaveBlurayPacClick(object sender, EventArgs e) => SaveElement(Pac);
|
||||
|
||||
#region XAML controls
|
||||
#pragma warning disable 169
|
||||
#pragma warning disable 649
|
||||
GroupBox grpBlurayDiscInformation;
|
||||
TextArea txtBlurayDiscInformation;
|
||||
GroupBox grpBlurayBurstCuttingArea;
|
||||
TextArea txtBlurayBurstCuttingArea;
|
||||
GroupBox grpBlurayDds;
|
||||
TextArea txtBlurayDds;
|
||||
GroupBox grpBlurayCartridgeStatus;
|
||||
TextArea txtBlurayCartridgeStatus;
|
||||
GroupBox grpBluraySpareAreaInformation;
|
||||
TextArea txtBluraySpareAreaInformation;
|
||||
GroupBox grpBlurayPowResources;
|
||||
TextArea txtBlurayPowResources;
|
||||
GroupBox grpBlurayTrackResources;
|
||||
TextArea txtBlurayTrackResources;
|
||||
Button btnSaveBlurayDiscInformation;
|
||||
Button btnSaveBlurayBurstCuttingArea;
|
||||
Button btnSaveBlurayDds;
|
||||
Button btnSaveBlurayCartridgeStatus;
|
||||
Button btnSaveBluraySpareAreaInformation;
|
||||
Button btnSaveBlurayPowResources;
|
||||
Button btnSaveBlurayTrackResources;
|
||||
Button btnSaveBlurayRawDfl;
|
||||
Button btnSaveBlurayPac;
|
||||
#pragma warning restore 169
|
||||
#pragma warning restore 649
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
166
Aaru.Gui/ViewModels/BlurayInfoViewModel.cs
Normal file
166
Aaru.Gui/ViewModels/BlurayInfoViewModel.cs
Normal file
@@ -0,0 +1,166 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reactive;
|
||||
using Aaru.Decoders.Bluray;
|
||||
using Aaru.Decoders.SCSI.MMC;
|
||||
using Avalonia.Controls;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace Aaru.Gui.ViewModels
|
||||
{
|
||||
public class BlurayInfoViewModel
|
||||
{
|
||||
readonly byte[] _burstCuttingArea;
|
||||
readonly byte[] _cartridgeStatus;
|
||||
readonly byte[] _dds;
|
||||
readonly byte[] _discInformation;
|
||||
readonly byte[] _pac;
|
||||
readonly byte[] _powResources;
|
||||
readonly byte[] _rawDfl;
|
||||
readonly byte[] _spareAreaInformation;
|
||||
readonly byte[] _trackResources;
|
||||
readonly Window _view;
|
||||
|
||||
public BlurayInfoViewModel(byte[] blurayDiscInformation, byte[] blurayBurstCuttingArea, byte[] blurayDds,
|
||||
byte[] blurayCartridgeStatus, byte[] bluraySpareAreaInformation,
|
||||
byte[] blurayPowResources, byte[] blurayTrackResources, byte[] blurayRawDfl,
|
||||
byte[] blurayPac, Window view)
|
||||
{
|
||||
_view = view;
|
||||
_discInformation = blurayDiscInformation;
|
||||
_burstCuttingArea = blurayBurstCuttingArea;
|
||||
_dds = blurayDds;
|
||||
_cartridgeStatus = blurayCartridgeStatus;
|
||||
_spareAreaInformation = bluraySpareAreaInformation;
|
||||
_powResources = blurayPowResources;
|
||||
_trackResources = blurayTrackResources;
|
||||
_rawDfl = blurayRawDfl;
|
||||
_pac = blurayPac;
|
||||
SaveBlurayDiscInformationCommand = ReactiveCommand.Create(ExecuteSaveBlurayDiscInformationCommand);
|
||||
SaveBlurayBurstCuttingAreaCommand = ReactiveCommand.Create(ExecuteSaveBlurayBurstCuttingAreaCommand);
|
||||
SaveBlurayDdsCommand = ReactiveCommand.Create(ExecuteSaveBlurayDdsCommand);
|
||||
SaveBlurayCartridgeStatusCommand = ReactiveCommand.Create(ExecuteSaveBlurayCartridgeStatusCommand);
|
||||
|
||||
SaveBluraySpareAreaInformationCommand =
|
||||
ReactiveCommand.Create(ExecuteSaveBluraySpareAreaInformationCommand);
|
||||
|
||||
SaveBlurayPowResourcesCommand = ReactiveCommand.Create(ExecuteSaveBlurayPowResourcesCommand);
|
||||
SaveBlurayTrackResourcesCommand = ReactiveCommand.Create(ExecuteSaveBlurayTrackResourcesCommand);
|
||||
SaveBlurayRawDflCommand = ReactiveCommand.Create(ExecuteSaveBlurayRawDflCommand);
|
||||
SaveBlurayPacCommand = ReactiveCommand.Create(ExecuteSaveBlurayPacCommand);
|
||||
|
||||
if(blurayDiscInformation != null)
|
||||
{
|
||||
SaveBlurayDiscInformationVisible = true;
|
||||
BlurayDiscInformationText = DI.Prettify(blurayDiscInformation);
|
||||
}
|
||||
|
||||
if(blurayBurstCuttingArea != null)
|
||||
{
|
||||
SaveBlurayBurstCuttingAreaVisible = true;
|
||||
BlurayBurstCuttingAreaText = BCA.Prettify(blurayBurstCuttingArea);
|
||||
}
|
||||
|
||||
if(blurayDds != null)
|
||||
{
|
||||
SaveBlurayDdsVisible = true;
|
||||
BlurayDdsText = DDS.Prettify(blurayDds);
|
||||
}
|
||||
|
||||
if(blurayCartridgeStatus != null)
|
||||
{
|
||||
SaveBlurayCartridgeStatusVisible = true;
|
||||
BlurayCartridgeStatusText = Cartridge.Prettify(blurayCartridgeStatus);
|
||||
}
|
||||
|
||||
if(bluraySpareAreaInformation != null)
|
||||
{
|
||||
SaveBluraySpareAreaInformationVisible = true;
|
||||
BluraySpareAreaInformationText = Spare.Prettify(bluraySpareAreaInformation);
|
||||
}
|
||||
|
||||
if(blurayPowResources != null)
|
||||
{
|
||||
SaveBlurayPowResourcesVisible = true;
|
||||
BlurayPowResourcesText = DiscInformation.Prettify(blurayPowResources);
|
||||
}
|
||||
|
||||
if(blurayTrackResources != null)
|
||||
{
|
||||
SaveBlurayTrackResourcesVisible = true;
|
||||
BlurayTrackResourcesText = DiscInformation.Prettify(blurayTrackResources);
|
||||
}
|
||||
|
||||
SaveBlurayRawDflVisible = blurayRawDfl != null;
|
||||
SaveBlurayPacVisible = blurayPac != null;
|
||||
}
|
||||
|
||||
public string BlurayDiscInformationText { get; }
|
||||
public string BlurayBurstCuttingAreaText { get; }
|
||||
public string BlurayDdsText { get; }
|
||||
public string BlurayCartridgeStatusText { get; }
|
||||
public string BluraySpareAreaInformationText { get; }
|
||||
public string BlurayPowResourcesText { get; }
|
||||
public string BlurayTrackResourcesText { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayDiscInformationCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayBurstCuttingAreaCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayDdsCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayCartridgeStatusCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBluraySpareAreaInformationCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayPowResourcesCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayTrackResourcesCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayRawDflCommand { get; }
|
||||
public ReactiveCommand<Unit, Unit> SaveBlurayPacCommand { get; }
|
||||
public bool SaveBlurayDiscInformationVisible { get; }
|
||||
public bool SaveBlurayBurstCuttingAreaVisible { get; }
|
||||
public bool SaveBlurayDdsVisible { get; }
|
||||
public bool SaveBlurayCartridgeStatusVisible { get; }
|
||||
public bool SaveBluraySpareAreaInformationVisible { get; }
|
||||
public bool SaveBlurayPowResourcesVisible { get; }
|
||||
public bool SaveBlurayTrackResourcesVisible { get; }
|
||||
public bool SaveBlurayRawDflVisible { get; }
|
||||
public bool SaveBlurayPacVisible { get; }
|
||||
|
||||
async void SaveElement(byte[] data)
|
||||
{
|
||||
var dlgSaveBinary = new SaveFileDialog();
|
||||
|
||||
dlgSaveBinary.Filters.Add(new FileDialogFilter
|
||||
{
|
||||
Extensions = new List<string>(new[]
|
||||
{
|
||||
"*.bin"
|
||||
}),
|
||||
Name = "Binary"
|
||||
});
|
||||
|
||||
string result = await dlgSaveBinary.ShowAsync(_view);
|
||||
|
||||
if(result is null)
|
||||
return;
|
||||
|
||||
var saveFs = new FileStream(result, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
saveFs.Close();
|
||||
}
|
||||
|
||||
void ExecuteSaveBlurayDiscInformationCommand() => SaveElement(_discInformation);
|
||||
|
||||
void ExecuteSaveBlurayBurstCuttingAreaCommand() => SaveElement(_burstCuttingArea);
|
||||
|
||||
void ExecuteSaveBlurayDdsCommand() => SaveElement(_dds);
|
||||
|
||||
void ExecuteSaveBlurayCartridgeStatusCommand() => SaveElement(_cartridgeStatus);
|
||||
|
||||
void ExecuteSaveBluraySpareAreaInformationCommand() => SaveElement(_spareAreaInformation);
|
||||
|
||||
void ExecuteSaveBlurayPowResourcesCommand() => SaveElement(_powResources);
|
||||
|
||||
void ExecuteSaveBlurayTrackResourcesCommand() => SaveElement(_trackResources);
|
||||
|
||||
void ExecuteSaveBlurayRawDflCommand() => SaveElement(_rawDfl);
|
||||
|
||||
void ExecuteSaveBlurayPacCommand() => SaveElement(_pac);
|
||||
}
|
||||
}
|
||||
@@ -453,8 +453,6 @@ namespace Aaru.Gui.ViewModels
|
||||
_view)
|
||||
};
|
||||
|
||||
/* TODO: tabBlurayInfo
|
||||
|
||||
byte[] blurayBurstCuttingArea = null;
|
||||
byte[] blurayCartridgeStatus = null;
|
||||
byte[] blurayDds = null;
|
||||
@@ -491,13 +489,13 @@ namespace Aaru.Gui.ViewModels
|
||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.MMC_TrackResourcesInformation))
|
||||
bluraySpareAreaInformation = imageFormat.ReadDiskTag(MediaTagType.MMC_TrackResourcesInformation);
|
||||
|
||||
var tabBlurayInfo = new tabBlurayInfo();
|
||||
BlurayInfo = new BlurayInfoTab
|
||||
{
|
||||
DataContext = new BlurayInfoViewModel(blurayDiscInformation, blurayBurstCuttingArea, blurayDds,
|
||||
blurayCartridgeStatus, bluraySpareAreaInformation,
|
||||
blurayPowResources, blurayTrackResources, null, null, _view)
|
||||
};
|
||||
|
||||
tabBlurayInfo.LoadData(blurayDiscInformation, blurayBurstCuttingArea, blurayDds, blurayCartridgeStatus,
|
||||
bluraySpareAreaInformation, blurayPowResources, blurayTrackResources, null, null);
|
||||
|
||||
tabInfos.Pages.Add(tabBlurayInfo);
|
||||
*/
|
||||
/* TODO: tabXboxInfo
|
||||
|
||||
byte[] xboxDmi = null;
|
||||
@@ -647,6 +645,7 @@ namespace Aaru.Gui.ViewModels
|
||||
public CompactDiscInfoTab CompactDiscInfo { get; }
|
||||
public DvdInfoTab DvdInfo { get; }
|
||||
public DvdWritableInfoTab DvdWritableInfo { get; }
|
||||
public BlurayInfoTab BlurayInfo { get; }
|
||||
public Bitmap MediaLogo { get; }
|
||||
public string ImagePathText { get; }
|
||||
public string FilterText { get; }
|
||||
|
||||
Reference in New Issue
Block a user