2018-07-23 23:25:43 +01:00
|
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:25 +00:00
|
|
|
|
// Aaru Data Preservation Suite
|
2018-07-23 23:25:43 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : Helpers.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : Disk image plugins.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Contains helpers for Nero Burning ROM disc images.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// This library is free software; you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
|
// published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This library 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
|
|
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2022-02-18 10:02:53 +00:00
|
|
|
|
// Copyright © 2011-2022 Natalia Portillo
|
2018-07-23 23:25:43 +01:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
namespace Aaru.DiscImages;
|
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
|
using Aaru.CommonTypes.Enums;
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
public sealed partial class Nero
|
2018-07-23 23:25:43 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
static CommonTypes.MediaType NeroMediaTypeToMediaType(NeroMediaTypes type)
|
2018-07-23 23:25:43 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
switch(type)
|
2018-07-23 23:25:43 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
case NeroMediaTypes.NeroMtypDdcd: return CommonTypes.MediaType.DDCD;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdM:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdMR: return CommonTypes.MediaType.DVDR;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdP:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdPR: return CommonTypes.MediaType.DVDPR;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdRam: return CommonTypes.MediaType.DVDRAM;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypMl:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypMrw:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypCdrw: return CommonTypes.MediaType.CDRW;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypCdr: return CommonTypes.MediaType.CDR;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdRom:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdAny:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdAnyR9:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdAnyOld: return CommonTypes.MediaType.DVDROM;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypCdrom: return CommonTypes.MediaType.CDROM;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdMRw: return CommonTypes.MediaType.DVDRW;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdPRw: return CommonTypes.MediaType.DVDPRW;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdPR9: return CommonTypes.MediaType.DVDPRDL;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypDvdMR9: return CommonTypes.MediaType.DVDRDL;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypBd:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypBdAny:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypBdRom: return CommonTypes.MediaType.BDROM;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypBdR: return CommonTypes.MediaType.BDR;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypBdRe: return CommonTypes.MediaType.BDRE;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypHdDvd:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypHdDvdAny:
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypHdDvdRom: return CommonTypes.MediaType.HDDVDROM;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypHdDvdR: return CommonTypes.MediaType.HDDVDR;
|
|
|
|
|
|
case NeroMediaTypes.NeroMtypHdDvdRw: return CommonTypes.MediaType.HDDVDRW;
|
|
|
|
|
|
default: return CommonTypes.MediaType.CD;
|
2018-07-23 23:25:43 +01:00
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
}
|
2018-07-23 23:25:43 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
static TrackType NeroTrackModeToTrackType(DaoMode mode)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch(mode)
|
2018-07-23 23:25:43 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
case DaoMode.Data:
|
|
|
|
|
|
case DaoMode.DataRaw:
|
|
|
|
|
|
case DaoMode.DataRawSub: return TrackType.CdMode1;
|
|
|
|
|
|
case DaoMode.DataM2F1: return TrackType.CdMode2Form1;
|
|
|
|
|
|
case DaoMode.DataM2F2: return TrackType.CdMode2Form2;
|
|
|
|
|
|
case DaoMode.DataM2RawSub:
|
|
|
|
|
|
case DaoMode.DataM2Raw: return TrackType.CdMode2Formless;
|
|
|
|
|
|
case DaoMode.Audio:
|
|
|
|
|
|
case DaoMode.AudioAlt:
|
|
|
|
|
|
case DaoMode.AudioSub: return TrackType.Audio;
|
|
|
|
|
|
default: return TrackType.Data;
|
2018-07-23 23:25:43 +01:00
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
}
|
2018-07-23 23:25:43 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
static ushort NeroTrackModeToBytesPerSector(DaoMode mode)
|
|
|
|
|
|
{
|
|
|
|
|
|
switch(mode)
|
2018-07-23 23:25:43 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
case DaoMode.Data:
|
|
|
|
|
|
case DaoMode.DataM2F1: return 2048;
|
|
|
|
|
|
case DaoMode.DataM2F2: return 2336;
|
|
|
|
|
|
case DaoMode.DataRaw:
|
|
|
|
|
|
case DaoMode.DataM2Raw:
|
|
|
|
|
|
case DaoMode.AudioAlt:
|
|
|
|
|
|
case DaoMode.Audio: return 2352;
|
|
|
|
|
|
case DaoMode.DataM2RawSub:
|
|
|
|
|
|
case DaoMode.DataRawSub:
|
|
|
|
|
|
case DaoMode.AudioSub: return 2448;
|
|
|
|
|
|
default: return 2352;
|
2018-07-23 23:25:43 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|