2019-12-31 19:47:18 +00:00
|
|
|
// /***************************************************************************
|
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : CompactDisc.cs
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// Component : Core algorithms.
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Dumps CDs and DDCDs.
|
|
|
|
|
//
|
|
|
|
|
// --[ 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/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2020-01-03 17:51:30 +00:00
|
|
|
// Copyright © 2011-2020 Natalia Portillo
|
2019-12-31 19:47:18 +00:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
using DiscImageChef.Core.Logging;
|
|
|
|
|
using DiscImageChef.Devices;
|
|
|
|
|
|
|
|
|
|
// ReSharper disable JoinDeclarationAndInitializer
|
|
|
|
|
// ReSharper disable InlineOutVariableDeclaration
|
|
|
|
|
// ReSharper disable TooWideLocalVariableScope
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Core.Devices.Dumping
|
|
|
|
|
{
|
|
|
|
|
partial class Dump
|
|
|
|
|
{
|
2020-01-02 18:31:49 +00:00
|
|
|
public static bool SupportsRwSubchannel(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus)
|
2019-12-31 19:47:18 +00:00
|
|
|
{
|
2020-01-02 18:31:49 +00:00
|
|
|
dumpLog?.WriteLine("Checking if drive supports full raw subchannel reading...");
|
|
|
|
|
updateStatus?.Invoke("Checking if drive supports full raw subchannel reading...");
|
2019-12-31 19:47:18 +00:00
|
|
|
|
2020-01-02 18:31:49 +00:00
|
|
|
return!dev.ReadCd(out _, out _, 0, 2352 + 96, 1, MmcSectorTypes.AllTypes, false, false, true,
|
|
|
|
|
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.Raw, dev.Timeout,
|
|
|
|
|
out _);
|
2019-12-31 19:47:18 +00:00
|
|
|
}
|
|
|
|
|
|
2020-01-02 18:31:49 +00:00
|
|
|
public static bool SupportsPqSubchannel(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus)
|
2019-12-31 19:47:18 +00:00
|
|
|
{
|
2020-01-02 18:31:49 +00:00
|
|
|
dumpLog?.WriteLine("Checking if drive supports PQ subchannel reading...");
|
|
|
|
|
updateStatus?.Invoke("Checking if drive supports PQ subchannel reading...");
|
2019-12-31 19:47:18 +00:00
|
|
|
|
2020-01-02 18:31:49 +00:00
|
|
|
return!dev.ReadCd(out _, out _, 0, 2352 + 16, 1, MmcSectorTypes.AllTypes, false, false, true,
|
|
|
|
|
MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.Q16, dev.Timeout,
|
|
|
|
|
out _);
|
2019-12-31 19:47:18 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|