mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Decode DVD media tags from image info in GUI.
This commit is contained in:
2
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
2
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
@@ -1616,6 +1616,8 @@
|
||||
<e p="tabAtaInfo.xeto.cs" t="Include" />
|
||||
<e p="tabCompactDiscInfo.xeto" t="Include" />
|
||||
<e p="tabCompactDiscInfo.xeto.cs" t="Include" />
|
||||
<e p="tabDvdInfo.xeto" t="Include" />
|
||||
<e p="tabDvdInfo.xeto.cs" t="Include" />
|
||||
<e p="tabScsiInfo.xeto" t="Include" />
|
||||
<e p="tabScsiInfo.xeto.cs" t="Include" />
|
||||
</e>
|
||||
|
||||
@@ -36,6 +36,7 @@ using System.Text;
|
||||
using DiscImageChef.CommonTypes.Enums;
|
||||
using DiscImageChef.CommonTypes.Interfaces;
|
||||
using DiscImageChef.Decoders.CD;
|
||||
using DiscImageChef.Decoders.DVD;
|
||||
using DiscImageChef.Decoders.SCSI;
|
||||
using DiscImageChef.Gui.Tabs;
|
||||
using Eto.Forms;
|
||||
@@ -387,6 +388,41 @@ namespace DiscImageChef.Gui.Panels
|
||||
tabCompactDiscInfo.LoadData(toc, atip, null, null, fullToc, pma, cdtext, decodedToc, decodedAtip, null,
|
||||
decodedFullToc, decodedCdText, null, mediaCatalogueNumber, null);
|
||||
tabInfos.Pages.Add(tabCompactDiscInfo);
|
||||
|
||||
byte[] dvdPfi = null;
|
||||
byte[] dvdDmi = null;
|
||||
byte[] dvdCmi = null;
|
||||
byte[] hddvdCopyrightInformation = null;
|
||||
byte[] dvdBca = null;
|
||||
PFI.PhysicalFormatInformation? decodedPfi = null;
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.DVD_PFI))
|
||||
{
|
||||
dvdPfi = imageFormat.ReadDiskTag(MediaTagType.DVD_PFI);
|
||||
decodedPfi = PFI.Decode(dvdPfi);
|
||||
}
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.DVD_DMI))
|
||||
dvdDmi = imageFormat.ReadDiskTag(MediaTagType.DVD_DMI);
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.DVD_CMI))
|
||||
dvdCmi = imageFormat.ReadDiskTag(MediaTagType.DVD_CMI);
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.HDDVD_CPI))
|
||||
hddvdCopyrightInformation = imageFormat.ReadDiskTag(MediaTagType.HDDVD_CPI);
|
||||
|
||||
if(imageFormat.Info.ReadableMediaTags != null &&
|
||||
imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.DVD_BCA))
|
||||
dvdBca = imageFormat.ReadDiskTag(MediaTagType.DVD_BCA);
|
||||
|
||||
tabDvdInfo tabDvdInfo = new tabDvdInfo();
|
||||
tabDvdInfo.LoadData(imageFormat.Info.MediaType, dvdPfi, dvdDmi, dvdCmi, hddvdCopyrightInformation, dvdBca,
|
||||
null, decodedPfi);
|
||||
tabInfos.Pages.Add(tabDvdInfo);
|
||||
}
|
||||
|
||||
#region XAML controls
|
||||
|
||||
@@ -31,7 +31,8 @@
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
-->
|
||||
<Panel xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DiscImageChef.Gui.Controls;assembly=DiscImageChef.Gui">
|
||||
<Panel xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:DiscImageChef.Gui.Controls;assembly=DiscImageChef.Gui">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Center">
|
||||
<Label ID="lblMediaInfo" Text="Media information"/>
|
||||
@@ -100,111 +101,6 @@
|
||||
Text="Save REPORT DENSITY SUPPORT (MEDIUM & MEDIA) response" Visible="False"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCd" Text="CompactDisc" Visible="False">
|
||||
<TabControl>
|
||||
<TabPage ID="tabCdInformation" Text="Information" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem Expand="True" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextArea ID="txtCdInformation" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdInformationClick" ID="btnCdInformation"
|
||||
Text="Save READ DISC INFORMATION response"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCdToc" Text="TOC" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem Expand="True" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextArea ID="txtCdToc" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdTocClick" ID="btnCdToc" Text="Save READ TOC response"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCdFullToc" Text="TOC (full)" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem Expand="True" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextArea ID="txtCdFullToc" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdFullTocClick" ID="btnCdFullToc"
|
||||
Text="Save READ RAW TOC response"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCdSession" Text="Session" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem Expand="True" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextArea ID="txtCdSession" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdSessionClick" ID="btnCdSession"
|
||||
Text="Save READ SESSION response"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCdText" Text="CD-TEXT" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem Expand="True" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextArea ID="txtCdText" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdTextClick" ID="btnCdText" Text="Save Lead-In CD-TEXT"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCdAtip" Text="ATIP" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem Expand="True" VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch">
|
||||
<TextArea ID="txtCdAtip" ReadOnly="True"/>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdAtipClick" ID="btnCdAtip" Text="Save READ ATIP response"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabCdMisc" Text="Miscellaneous" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch">
|
||||
<StackLayout Orientation="Horizontal" ID="stkMcn" Visible="False">
|
||||
<Label ID="lblMcn" Text="Media catalog number"/>
|
||||
<TextBox ID="txtMcn" ReadOnly="True"/>
|
||||
</StackLayout>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
Expand="True">
|
||||
<GroupBox ID="grpIsrcs" Text="ISRCs" Visible="False">
|
||||
<TreeGridView ID="grdIsrcs"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnCdPmaClick" ID="btnCdPma" Text="Save READ PMA response"
|
||||
Visible="False"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
</TabControl>
|
||||
</TabPage>
|
||||
<TabPage ID="tabDvd" Text="DVD" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpDvdPfi" Text="Physical Format Information" Visible="False">
|
||||
<TextArea ID="txtDvdPfi" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpDvdCmi" Text="Copyright Management Information" Visible="False">
|
||||
<TextArea ID="txtDvdCmi" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnSaveDvdPfiClick" ID="btnSaveDvdPfi" Text="Save Physical Format Information"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdDmiClick" ID="btnSaveDvdDmi"
|
||||
Text="Save Disc Manufacturer Information" Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdCmiClick" ID="btnSaveDvdCmi"
|
||||
Text="Save Copyright Management Information" Visible="False"/>
|
||||
<Button Click="OnBtnSaveHdDvdCmiClick" ID="btnSaveHdDvdCmi"
|
||||
Text="Save Copyright Management Information" Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdBcaClick" ID="btnSaveDvdBca" Text="Save Burst Cutting Area"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdAacsClick" ID="btnSaveDvdAacs" Text="Save AACS Information"
|
||||
Visible="False"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
<TabPage ID="tabXbox" Text="Xbox" Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayout Orientation="Vertical" ID="stkXboxInformation" Visible="False">
|
||||
|
||||
@@ -36,7 +36,6 @@ using System.Text;
|
||||
using DiscImageChef.CommonTypes;
|
||||
using DiscImageChef.Core.Media.Info;
|
||||
using DiscImageChef.Decoders.Bluray;
|
||||
using DiscImageChef.Decoders.DVD;
|
||||
using DiscImageChef.Decoders.SCSI.MMC;
|
||||
using DiscImageChef.Decoders.SCSI.SSC;
|
||||
using DiscImageChef.Decoders.Xbox;
|
||||
@@ -46,7 +45,6 @@ using DiscImageChef.Gui.Tabs;
|
||||
using Eto.Drawing;
|
||||
using Eto.Forms;
|
||||
using Eto.Serialization.Xaml;
|
||||
using BCA = DiscImageChef.Decoders.Bluray.BCA;
|
||||
using Cartridge = DiscImageChef.Decoders.DVD.Cartridge;
|
||||
using DDS = DiscImageChef.Decoders.DVD.DDS;
|
||||
using DMI = DiscImageChef.Decoders.Xbox.DMI;
|
||||
@@ -82,21 +80,6 @@ namespace DiscImageChef.Gui.Panels
|
||||
}
|
||||
//}
|
||||
|
||||
switch(this.scsiInfo.MediaType)
|
||||
{
|
||||
case MediaType.HDDVDROM:
|
||||
case MediaType.HDDVDRAM:
|
||||
case MediaType.HDDVDR:
|
||||
case MediaType.HDDVDRW:
|
||||
case MediaType.HDDVDRDL:
|
||||
case MediaType.HDDVDRWDL:
|
||||
tabDvd.Text = "HD DVD";
|
||||
break;
|
||||
default:
|
||||
tabDvd.Text = "DVD";
|
||||
break;
|
||||
}
|
||||
|
||||
switch(this.scsiInfo.MediaType)
|
||||
{
|
||||
case MediaType.DVDR:
|
||||
@@ -194,30 +177,11 @@ namespace DiscImageChef.Gui.Panels
|
||||
this.scsiInfo.Mcn, this.scsiInfo.Isrcs);
|
||||
tabInfos.Pages.Add(tabCompactDiscInfo);
|
||||
|
||||
if(this.scsiInfo.DecodedPfi.HasValue)
|
||||
{
|
||||
grpDvdPfi.Visible = true;
|
||||
txtDvdPfi.Text = PFI.Prettify(this.scsiInfo.DecodedPfi);
|
||||
}
|
||||
|
||||
if(this.scsiInfo.DvdCmi != null)
|
||||
{
|
||||
grpDvdCmi.Visible = true;
|
||||
txtDvdCmi.Text = CSS_CPRM.PrettifyLeadInCopyright(this.scsiInfo.DvdCmi);
|
||||
btnSaveDvdCmi.Visible = true;
|
||||
}
|
||||
|
||||
btnSaveDvdPfi.Visible = this.scsiInfo.DvdPfi != null;
|
||||
btnSaveDvdDmi.Visible = this.scsiInfo.DvdDmi != null;
|
||||
btnSaveDvdCmi.Visible = this.scsiInfo.DvdCmi != null;
|
||||
btnSaveHdDvdCmi.Visible = this.scsiInfo.HddvdCopyrightInformation != null;
|
||||
btnSaveDvdBca.Visible = this.scsiInfo.DvdBca != null;
|
||||
btnSaveDvdAacs.Visible = this.scsiInfo.DvdAacs != null;
|
||||
|
||||
tabDvd.Visible = grpDvdPfi.Visible || grpDvdCmi.Visible || btnSaveDvdPfi.Visible ||
|
||||
btnSaveDvdDmi.Visible ||
|
||||
btnSaveDvdCmi.Visible || btnSaveHdDvdCmi.Visible || btnSaveDvdBca.Visible ||
|
||||
btnSaveDvdAacs.Visible;
|
||||
tabDvdInfo tabDvdInfo = new tabDvdInfo();
|
||||
tabDvdInfo.LoadData(scsiInfo.MediaType, scsiInfo.DvdPfi, scsiInfo.DvdDmi, scsiInfo.DvdCmi,
|
||||
scsiInfo.HddvdCopyrightInformation, scsiInfo.DvdBca, scsiInfo.DvdAacs,
|
||||
this.scsiInfo.DecodedPfi);
|
||||
tabInfos.Pages.Add(tabDvdInfo);
|
||||
|
||||
if(this.scsiInfo.XgdInfo != null)
|
||||
{
|
||||
|
||||
58
DiscImageChef.Gui/Tabs/tabDvdInfo.xeto
Normal file
58
DiscImageChef.Gui/Tabs/tabDvdInfo.xeto
Normal file
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><!--
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ============================================================================
|
||||
//
|
||||
// Filename : pnlScsiInfo.xeto
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : SCSI media information panel.
|
||||
//
|
||||
// ==[ Description ] ==========================================================
|
||||
//
|
||||
// Defines the structure for the SCSI media information panel.
|
||||
//
|
||||
// ==[ 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-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
-->
|
||||
<TabPage xmlns="http://schema.picoe.ca/eto.forms" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Text="DVD"
|
||||
Visible="False">
|
||||
<StackLayout Orientation="Vertical">
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpDvdPfi" Text="Physical Format Information" Visible="False">
|
||||
<TextArea ID="txtDvdPfi" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<StackLayoutItem HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Expand="True">
|
||||
<GroupBox ID="grpDvdCmi" Text="Copyright Management Information" Visible="False">
|
||||
<TextArea ID="txtDvdCmi" ReadOnly="True"/>
|
||||
</GroupBox>
|
||||
</StackLayoutItem>
|
||||
<Button Click="OnBtnSaveDvdPfiClick" ID="btnSaveDvdPfi" Text="Save Physical Format Information"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdDmiClick" ID="btnSaveDvdDmi" Text="Save Disc Manufacturer Information"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdCmiClick" ID="btnSaveDvdCmi" Text="Save Copyright Management Information"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveHdDvdCmiClick" ID="btnSaveHdDvdCmi" Text="Save Copyright Management Information"
|
||||
Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdBcaClick" ID="btnSaveDvdBca" Text="Save Burst Cutting Area" Visible="False"/>
|
||||
<Button Click="OnBtnSaveDvdAacsClick" ID="btnSaveDvdAacs" Text="Save AACS Information" Visible="False"/>
|
||||
</StackLayout>
|
||||
</TabPage>
|
||||
184
DiscImageChef.Gui/Tabs/tabDvdInfo.xeto.cs
Normal file
184
DiscImageChef.Gui/Tabs/tabDvdInfo.xeto.cs
Normal file
@@ -0,0 +1,184 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : pnlxeto.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : SCSI media information panel.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Implements the SCSI media information panel.
|
||||
//
|
||||
// --[ 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-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using DiscImageChef.CommonTypes;
|
||||
using DiscImageChef.Core.Media.Info;
|
||||
using DiscImageChef.Decoders.Bluray;
|
||||
using DiscImageChef.Decoders.DVD;
|
||||
using DiscImageChef.Decoders.SCSI.MMC;
|
||||
using DiscImageChef.Decoders.SCSI.SSC;
|
||||
using DiscImageChef.Decoders.Xbox;
|
||||
using DiscImageChef.Gui.Controls;
|
||||
using DiscImageChef.Gui.Forms;
|
||||
using DiscImageChef.Gui.Tabs;
|
||||
using Eto.Drawing;
|
||||
using Eto.Forms;
|
||||
using Eto.Serialization.Xaml;
|
||||
using BCA = DiscImageChef.Decoders.Bluray.BCA;
|
||||
using Cartridge = DiscImageChef.Decoders.DVD.Cartridge;
|
||||
using DDS = DiscImageChef.Decoders.DVD.DDS;
|
||||
using DMI = DiscImageChef.Decoders.Xbox.DMI;
|
||||
using Spare = DiscImageChef.Decoders.DVD.Spare;
|
||||
|
||||
namespace DiscImageChef.Gui.Tabs
|
||||
{
|
||||
public class tabDvdInfo : TabPage
|
||||
{
|
||||
byte[] DvdPfi;
|
||||
byte[] DvdDmi;
|
||||
byte[] DvdCmi;
|
||||
byte[] HddvdCopyrightInformation;
|
||||
byte[] DvdBca;
|
||||
byte[] DvdAacs;
|
||||
|
||||
public tabDvdInfo()
|
||||
{
|
||||
XamlReader.Load(this);
|
||||
}
|
||||
|
||||
internal void LoadData(MediaType mediaType, byte[] pfi, byte[] dmi, byte[] cmi, byte[] hdCopyrightInformation, byte[] bca, byte[] aacs, PFI.PhysicalFormatInformation? decodedPfi)
|
||||
{
|
||||
DvdPfi=pfi;
|
||||
DvdDmi=dmi;
|
||||
DvdCmi=cmi;
|
||||
HddvdCopyrightInformation=hdCopyrightInformation;
|
||||
DvdBca=bca;
|
||||
DvdAacs=aacs;
|
||||
|
||||
switch(mediaType)
|
||||
{
|
||||
case MediaType.HDDVDROM:
|
||||
case MediaType.HDDVDRAM:
|
||||
case MediaType.HDDVDR:
|
||||
case MediaType.HDDVDRW:
|
||||
case MediaType.HDDVDRDL:
|
||||
case MediaType.HDDVDRWDL:
|
||||
Text = "HD DVD";
|
||||
break;
|
||||
default:
|
||||
Text = "DVD";
|
||||
break;
|
||||
}
|
||||
|
||||
if(decodedPfi.HasValue)
|
||||
{
|
||||
grpDvdPfi.Visible = true;
|
||||
txtDvdPfi.Text = PFI.Prettify(decodedPfi);
|
||||
}
|
||||
|
||||
if(cmi != null)
|
||||
{
|
||||
grpDvdCmi.Visible = true;
|
||||
txtDvdCmi.Text = CSS_CPRM.PrettifyLeadInCopyright(cmi);
|
||||
btnSaveDvdCmi.Visible = true;
|
||||
}
|
||||
|
||||
btnSaveDvdPfi.Visible = pfi != null;
|
||||
btnSaveDvdDmi.Visible = dmi != null;
|
||||
btnSaveDvdCmi.Visible = cmi != null;
|
||||
btnSaveHdDvdCmi.Visible = hdCopyrightInformation != null;
|
||||
btnSaveDvdBca.Visible = bca != null;
|
||||
btnSaveDvdAacs.Visible = aacs != null;
|
||||
|
||||
Visible = grpDvdPfi.Visible || grpDvdCmi.Visible || btnSaveDvdPfi.Visible ||
|
||||
btnSaveDvdDmi.Visible ||
|
||||
btnSaveDvdCmi.Visible || btnSaveHdDvdCmi.Visible || btnSaveDvdBca.Visible ||
|
||||
btnSaveDvdAacs.Visible;
|
||||
}
|
||||
|
||||
void SaveElement(byte[] data)
|
||||
{
|
||||
SaveFileDialog dlgSaveBinary = new SaveFileDialog();
|
||||
dlgSaveBinary.Filters.Add(new FileFilter {Extensions = new[] {"*.bin"}, Name = "Binary"});
|
||||
DialogResult result = dlgSaveBinary.ShowDialog(this);
|
||||
|
||||
if(result != DialogResult.Ok) return;
|
||||
|
||||
FileStream saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
|
||||
saveFs.Write(data, 0, data.Length);
|
||||
|
||||
saveFs.Close();
|
||||
}
|
||||
|
||||
protected void OnBtnSaveDvdPfiClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveElement(DvdPfi);
|
||||
}
|
||||
|
||||
protected void OnBtnSaveDvdDmiClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveElement(DvdDmi);
|
||||
}
|
||||
|
||||
protected void OnBtnSaveDvdCmiClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveElement(DvdCmi);
|
||||
}
|
||||
|
||||
protected void OnBtnSaveHdDvdCmiClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveElement(HddvdCopyrightInformation);
|
||||
}
|
||||
|
||||
protected void OnBtnSaveDvdBcaClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveElement(DvdBca);
|
||||
}
|
||||
|
||||
protected void OnBtnSaveDvdAacsClick(object sender, EventArgs e)
|
||||
{
|
||||
SaveElement(DvdAacs);
|
||||
}
|
||||
|
||||
#region XAML controls
|
||||
#pragma warning disable 169
|
||||
#pragma warning disable 649
|
||||
GroupBox grpDvdPfi;
|
||||
TextArea txtDvdPfi;
|
||||
GroupBox grpDvdCmi;
|
||||
TextArea txtDvdCmi;
|
||||
GroupBox grpHdDvdCmi;
|
||||
TextArea txtHdDvdCmi;
|
||||
Button btnSaveDvdPfi;
|
||||
Button btnSaveDvdDmi;
|
||||
Button btnSaveDvdCmi;
|
||||
Button btnSaveHdDvdCmi;
|
||||
Button btnSaveDvdBca;
|
||||
Button btnSaveDvdAacs;
|
||||
#pragma warning restore 169
|
||||
#pragma warning restore 649
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user