mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Make Sidecar class non-static.
This commit is contained in:
@@ -524,7 +524,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
if(preSidecar != null)
|
if(preSidecar != null)
|
||||||
{
|
{
|
||||||
preSidecar.BlockMedia = sidecar.BlockMedia;
|
preSidecar.BlockMedia = sidecar.BlockMedia;
|
||||||
|
|||||||
@@ -1844,7 +1844,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
|
|
||||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||||
|
|||||||
@@ -171,5 +171,17 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
/// Event raised to update the status of an undeterminate progress bar
|
/// Event raised to update the status of an undeterminate progress bar
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public event PulseProgressHandler PulseProgress;
|
public event PulseProgressHandler PulseProgress;
|
||||||
|
/// <summary>
|
||||||
|
/// Event raised when the progress bar is not longer needed
|
||||||
|
/// </summary>
|
||||||
|
public event EndProgressHandler2 EndProgress2;
|
||||||
|
/// <summary>
|
||||||
|
/// Event raised when a progress bar is needed
|
||||||
|
/// </summary>
|
||||||
|
public event InitProgressHandler2 InitProgress2;
|
||||||
|
/// <summary>
|
||||||
|
/// Event raised to update the values of a determinate progress bar
|
||||||
|
/// </summary>
|
||||||
|
public event UpdateProgressHandler2 UpdateProgress2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -594,7 +594,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
|
|
||||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||||
@@ -1062,7 +1073,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
|
|
||||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||||
|
|||||||
@@ -829,7 +829,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
|
|
||||||
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
totalChkDuration = (end - chkStart).TotalMilliseconds;
|
||||||
|
|||||||
@@ -479,7 +479,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
if(!inputPlugin.Open(filter)) StoppingErrorMessage?.Invoke("Could not open created image.");
|
if(!inputPlugin.Open(filter)) StoppingErrorMessage?.Invoke("Could not open created image.");
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
|
|
||||||
if(preSidecar != null)
|
if(preSidecar != null)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -929,7 +929,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
|||||||
}
|
}
|
||||||
|
|
||||||
DateTime chkStart = DateTime.UtcNow;
|
DateTime chkStart = DateTime.UtcNow;
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputPlugin, outputPath, filter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(inputPlugin, outputPath, filter.Id, encoding)
|
||||||
|
{
|
||||||
|
// TODO: Be able to cancel hashing
|
||||||
|
InitProgressEvent += InitProgress,
|
||||||
|
UpdateProgressEvent += UpdateProgress,
|
||||||
|
EndProgressEvent += EndProgress,
|
||||||
|
InitProgressEvent2 += InitProgress2,
|
||||||
|
UpdateProgressEvent2 += UpdateProgress2,
|
||||||
|
EndProgressEvent2 += EndProgress2,
|
||||||
|
UpdateStatusEvent += UpdateStatus
|
||||||
|
};
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
end = DateTime.UtcNow;
|
end = DateTime.UtcNow;
|
||||||
|
|
||||||
if(preSidecar != null)
|
if(preSidecar != null)
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ using Schemas;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
// TODO: Complete it
|
// TODO: Complete it
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a metadata sidecar for a block media (e.g. floppy, hard disk, flash card, usb stick)
|
/// Creates a metadata sidecar for a block media (e.g. floppy, hard disk, flash card, usb stick)
|
||||||
@@ -62,8 +62,8 @@ namespace DiscImageChef.Core
|
|||||||
/// <param name="plugins">Image plugins</param>
|
/// <param name="plugins">Image plugins</param>
|
||||||
/// <param name="imgChecksums">List of image checksums</param>
|
/// <param name="imgChecksums">List of image checksums</param>
|
||||||
/// <param name="sidecar">Metadata sidecar</param>
|
/// <param name="sidecar">Metadata sidecar</param>
|
||||||
static void BlockMedia(IMediaImage image, Guid filterId, string imagePath,
|
void BlockMedia(IMediaImage image, Guid filterId, string imagePath, FileInfo fi,
|
||||||
FileInfo fi, PluginBase plugins,
|
PluginBase plugins,
|
||||||
List<ChecksumType> imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
|
List<ChecksumType> imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
|
||||||
{
|
{
|
||||||
sidecar.BlockMedia = new[]
|
sidecar.BlockMedia = new[]
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ using Schemas;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a metadata sidecar for a block tape (e.g. scsi streaming)
|
/// Creates a metadata sidecar for a block tape (e.g. scsi streaming)
|
||||||
@@ -44,9 +44,9 @@ namespace DiscImageChef.Core
|
|||||||
/// <param name="files">List of files</param>
|
/// <param name="files">List of files</param>
|
||||||
/// <param name="folderName">Dump path</param>
|
/// <param name="folderName">Dump path</param>
|
||||||
/// <param name="blockSize">Expected block size in bytes</param>
|
/// <param name="blockSize">Expected block size in bytes</param>
|
||||||
public static CICMMetadataType Create(string folderName, List<string> files, int blockSize)
|
public CICMMetadataType BlockTape(string folderName, List<string> files, int blockSize)
|
||||||
{
|
{
|
||||||
CICMMetadataType sidecar = new CICMMetadataType
|
sidecar = new CICMMetadataType
|
||||||
{
|
{
|
||||||
BlockMedia = new[]
|
BlockMedia = new[]
|
||||||
{
|
{
|
||||||
@@ -84,7 +84,7 @@ namespace DiscImageChef.Core
|
|||||||
|
|
||||||
for(int i = 0; i < files.Count; i++)
|
for(int i = 0; i < files.Count; i++)
|
||||||
{
|
{
|
||||||
FileStream fs = new FileStream(files[i], FileMode.Open, FileAccess.Read);
|
fs = new FileStream(files[i], FileMode.Open, FileAccess.Read);
|
||||||
Checksum fileWorker = new Checksum();
|
Checksum fileWorker = new Checksum();
|
||||||
TapeFileType tapeFile = new TapeFileType
|
TapeFileType tapeFile = new TapeFileType
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -32,47 +32,47 @@
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
public static event InitProgressHandler InitProgressEvent;
|
public event InitProgressHandler InitProgressEvent;
|
||||||
public static event UpdateProgressHandler UpdateProgressEvent;
|
public event UpdateProgressHandler UpdateProgressEvent;
|
||||||
public static event EndProgressHandler EndProgressEvent;
|
public event EndProgressHandler EndProgressEvent;
|
||||||
public static event InitProgressHandler2 InitProgressEvent2;
|
public event InitProgressHandler2 InitProgressEvent2;
|
||||||
public static event UpdateProgressHandler2 UpdateProgressEvent2;
|
public event UpdateProgressHandler2 UpdateProgressEvent2;
|
||||||
public static event EndProgressHandler2 EndProgressEvent2;
|
public event EndProgressHandler2 EndProgressEvent2;
|
||||||
public static event UpdateStatusHandler UpdateStatusEvent;
|
public event UpdateStatusHandler UpdateStatusEvent;
|
||||||
|
|
||||||
public static void InitProgress()
|
public void InitProgress()
|
||||||
{
|
{
|
||||||
InitProgressEvent?.Invoke();
|
InitProgressEvent?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateProgress(string text, long current, long maximum)
|
public void UpdateProgress(string text, long current, long maximum)
|
||||||
{
|
{
|
||||||
UpdateProgressEvent?.Invoke(string.Format(text, current, maximum), current, maximum);
|
UpdateProgressEvent?.Invoke(string.Format(text, current, maximum), current, maximum);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void EndProgress()
|
public void EndProgress()
|
||||||
{
|
{
|
||||||
EndProgressEvent?.Invoke();
|
EndProgressEvent?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void InitProgress2()
|
public void InitProgress2()
|
||||||
{
|
{
|
||||||
InitProgressEvent2?.Invoke();
|
InitProgressEvent2?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateProgress2(string text, long current, long maximum)
|
public void UpdateProgress2(string text, long current, long maximum)
|
||||||
{
|
{
|
||||||
UpdateProgressEvent2?.Invoke(string.Format(text, current, maximum), current, maximum);
|
UpdateProgressEvent2?.Invoke(string.Format(text, current, maximum), current, maximum);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void EndProgress2()
|
public void EndProgress2()
|
||||||
{
|
{
|
||||||
EndProgressEvent2?.Invoke();
|
EndProgressEvent2?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateStatus(string text, params object[] args)
|
public void UpdateStatus(string text, params object[] args)
|
||||||
{
|
{
|
||||||
UpdateStatusEvent?.Invoke(string.Format(text, args));
|
UpdateStatusEvent?.Invoke(string.Format(text, args));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts a LBA to MM:SS:FF string for CDs
|
/// Converts a LBA to MM:SS:FF string for CDs
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ using Schemas;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
// TODO: Complete it
|
// TODO: Complete it
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -53,7 +53,7 @@ namespace DiscImageChef.Core
|
|||||||
/// <param name="plugins">Image plugins</param>
|
/// <param name="plugins">Image plugins</param>
|
||||||
/// <param name="imgChecksums">List of image checksums</param>
|
/// <param name="imgChecksums">List of image checksums</param>
|
||||||
/// <param name="sidecar">Metadata sidecar</param>
|
/// <param name="sidecar">Metadata sidecar</param>
|
||||||
static void LinearMedia(IMediaImage image, Guid filterId, string imagePath,
|
void LinearMedia(IMediaImage image, Guid filterId, string imagePath,
|
||||||
FileInfo fi, PluginBase plugins,
|
FileInfo fi, PluginBase plugins,
|
||||||
List<ChecksumType> imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
|
List<ChecksumType> imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ using TrackType = Schemas.TrackType;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a metadata sidecar for an optical disc (e.g. CD, DVD, GD, BD, XGD, GOD)
|
/// Creates a metadata sidecar for an optical disc (e.g. CD, DVD, GD, BD, XGD, GOD)
|
||||||
@@ -62,11 +62,9 @@ namespace DiscImageChef.Core
|
|||||||
/// <param name="plugins">Image plugins</param>
|
/// <param name="plugins">Image plugins</param>
|
||||||
/// <param name="imgChecksums">List of image checksums</param>
|
/// <param name="imgChecksums">List of image checksums</param>
|
||||||
/// <param name="sidecar">Metadata sidecar</param>
|
/// <param name="sidecar">Metadata sidecar</param>
|
||||||
static void OpticalDisc(IOpticalMediaImage image, Guid filterId,
|
void OpticalDisc(IOpticalMediaImage image, Guid filterId, string imagePath,
|
||||||
string imagePath, FileInfo fi,
|
FileInfo fi, PluginBase plugins,
|
||||||
PluginBase plugins, List<ChecksumType> imgChecksums,
|
List<ChecksumType> imgChecksums, ref CICMMetadataType sidecar, Encoding encoding)
|
||||||
ref CICMMetadataType sidecar,
|
|
||||||
Encoding encoding)
|
|
||||||
{
|
{
|
||||||
sidecar.OpticalDisc = new[]
|
sidecar.OpticalDisc = new[]
|
||||||
{
|
{
|
||||||
@@ -110,10 +108,8 @@ namespace DiscImageChef.Core
|
|||||||
};
|
};
|
||||||
ATIP.CDATIP? atip = ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP));
|
ATIP.CDATIP? atip = ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP));
|
||||||
if(atip.HasValue)
|
if(atip.HasValue)
|
||||||
if(atip.Value.DDCD)
|
if(atip.Value.DDCD) dskType = atip.Value.DiscType ? MediaType.DDCDRW : MediaType.DDCDR;
|
||||||
dskType = atip.Value.DiscType ? MediaType.DDCDRW : MediaType.DDCDR;
|
else dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR;
|
||||||
else
|
|
||||||
dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR;
|
|
||||||
break;
|
break;
|
||||||
case MediaTagType.DVD_BCA:
|
case MediaTagType.DVD_BCA:
|
||||||
sidecar.OpticalDisc[0].BCA = new DumpType
|
sidecar.OpticalDisc[0].BCA = new DumpType
|
||||||
|
|||||||
@@ -42,26 +42,50 @@ using Schemas;
|
|||||||
|
|
||||||
namespace DiscImageChef.Core
|
namespace DiscImageChef.Core
|
||||||
{
|
{
|
||||||
public static partial class Sidecar
|
public partial class Sidecar
|
||||||
{
|
{
|
||||||
/// <summary>
|
readonly Encoding encoding;
|
||||||
/// Implements creating a metadata sidecar
|
readonly FileInfo fi;
|
||||||
/// </summary>
|
readonly Guid filterId;
|
||||||
|
FileStream fs;
|
||||||
|
readonly IMediaImage image;
|
||||||
|
readonly string imagePath;
|
||||||
|
readonly Checksum imgChkWorker;
|
||||||
|
readonly PluginBase plugins;
|
||||||
|
CICMMetadataType sidecar;
|
||||||
|
|
||||||
|
public Sidecar()
|
||||||
|
{
|
||||||
|
plugins = GetPluginBase.Instance;
|
||||||
|
imgChkWorker = new Checksum();
|
||||||
|
}
|
||||||
|
|
||||||
/// <param name="image">Image</param>
|
/// <param name="image">Image</param>
|
||||||
/// <param name="imagePath">Path to image</param>
|
/// <param name="imagePath">Path to image</param>
|
||||||
/// <param name="filterId">Filter uuid</param>
|
/// <param name="filterId">Filter uuid</param>
|
||||||
/// <param name="encoding">Encoding for analysis</param>
|
/// <param name="encoding">Encoding for analysis</param>
|
||||||
/// <returns>The metadata sidecar</returns>
|
public Sidecar(IMediaImage image, string imagePath, Guid filterId, Encoding encoding)
|
||||||
public static CICMMetadataType Create(IMediaImage image, string imagePath, Guid filterId, Encoding encoding)
|
|
||||||
{
|
{
|
||||||
CICMMetadataType sidecar = image.CicmMetadata ?? new CICMMetadataType();
|
this.image = image;
|
||||||
PluginBase plugins = GetPluginBase.Instance;
|
this.imagePath = imagePath;
|
||||||
|
this.filterId = filterId;
|
||||||
|
this.encoding = encoding;
|
||||||
|
|
||||||
FileInfo fi = new FileInfo(imagePath);
|
sidecar = image.CicmMetadata ?? new CICMMetadataType();
|
||||||
FileStream fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
plugins = GetPluginBase.Instance;
|
||||||
|
|
||||||
Checksum imgChkWorker = new Checksum();
|
fi = new FileInfo(imagePath);
|
||||||
|
fs = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
||||||
|
|
||||||
|
imgChkWorker = new Checksum();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Implements creating a metadata sidecar
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>The metadata sidecar</returns>
|
||||||
|
public CICMMetadataType Create()
|
||||||
|
{
|
||||||
// For fast debugging, skip checksum
|
// For fast debugging, skip checksum
|
||||||
//goto skipImageChecksum;
|
//goto skipImageChecksum;
|
||||||
|
|
||||||
|
|||||||
@@ -46,10 +46,10 @@ namespace DiscImageChef.Gui.Forms
|
|||||||
{
|
{
|
||||||
public class frmImageSidecar : Form
|
public class frmImageSidecar : Form
|
||||||
{
|
{
|
||||||
Encoding encoding;
|
readonly Encoding encoding;
|
||||||
Guid filterId;
|
readonly Guid filterId;
|
||||||
string imageSource;
|
readonly string imageSource;
|
||||||
IMediaImage inputFormat;
|
readonly IMediaImage inputFormat;
|
||||||
|
|
||||||
public frmImageSidecar(IMediaImage inputFormat, string imageSource, Guid filterId, Encoding encoding)
|
public frmImageSidecar(IMediaImage inputFormat, string imageSource, Guid filterId, Encoding encoding)
|
||||||
{
|
{
|
||||||
@@ -81,7 +81,8 @@ namespace DiscImageChef.Gui.Forms
|
|||||||
btnDestination.Visible = false;
|
btnDestination.Visible = false;
|
||||||
});
|
});
|
||||||
|
|
||||||
CICMMetadataType sidecar = Sidecar.Create(inputFormat, imageSource, filterId, encoding);
|
Sidecar sidecarClass = new Sidecar(inputFormat, imageSource, filterId, encoding);
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
|
|
||||||
DicConsole.WriteLine("Writing metadata sidecar");
|
DicConsole.WriteLine("Writing metadata sidecar");
|
||||||
|
|
||||||
|
|||||||
@@ -115,14 +115,6 @@ namespace DiscImageChef.Commands
|
|||||||
DicConsole.DebugWriteLine("Create sidecar command", "--tape={0}", tape);
|
DicConsole.DebugWriteLine("Create sidecar command", "--tape={0}", tape);
|
||||||
DicConsole.DebugWriteLine("Create sidecar command", "--verbose={0}", MainClass.Verbose);
|
DicConsole.DebugWriteLine("Create sidecar command", "--verbose={0}", MainClass.Verbose);
|
||||||
|
|
||||||
Sidecar.InitProgressEvent += Progress.InitProgress;
|
|
||||||
Sidecar.UpdateProgressEvent += Progress.UpdateProgress;
|
|
||||||
Sidecar.EndProgressEvent += Progress.EndProgress;
|
|
||||||
Sidecar.InitProgressEvent2 += Progress.InitProgress2;
|
|
||||||
Sidecar.UpdateProgressEvent2 += Progress.UpdateProgress2;
|
|
||||||
Sidecar.EndProgressEvent2 += Progress.EndProgress2;
|
|
||||||
Sidecar.UpdateStatusEvent += Progress.UpdateStatus;
|
|
||||||
|
|
||||||
Encoding encoding = null;
|
Encoding encoding = null;
|
||||||
|
|
||||||
if(encodingName != null)
|
if(encodingName != null)
|
||||||
@@ -190,7 +182,15 @@ namespace DiscImageChef.Commands
|
|||||||
Statistics.AddMediaFormat(imageFormat.Format);
|
Statistics.AddMediaFormat(imageFormat.Format);
|
||||||
Statistics.AddFilter(inputFilter.Name);
|
Statistics.AddFilter(inputFilter.Name);
|
||||||
|
|
||||||
CICMMetadataType sidecar = Sidecar.Create(imageFormat, inputFile, inputFilter.Id, encoding);
|
Sidecar sidecarClass = new Sidecar(imageFormat, inputFile, inputFilter.Id, encoding);
|
||||||
|
sidecarClass.InitProgressEvent += Progress.InitProgress;
|
||||||
|
sidecarClass.UpdateProgressEvent += Progress.UpdateProgress;
|
||||||
|
sidecarClass.EndProgressEvent += Progress.EndProgress;
|
||||||
|
sidecarClass.InitProgressEvent2 += Progress.InitProgress2;
|
||||||
|
sidecarClass.UpdateProgressEvent2 += Progress.UpdateProgress2;
|
||||||
|
sidecarClass.EndProgressEvent2 += Progress.EndProgress2;
|
||||||
|
sidecarClass.UpdateStatusEvent += Progress.UpdateStatus;
|
||||||
|
CICMMetadataType sidecar = sidecarClass.Create();
|
||||||
|
|
||||||
DicConsole.WriteLine("Writing metadata sidecar");
|
DicConsole.WriteLine("Writing metadata sidecar");
|
||||||
|
|
||||||
@@ -223,7 +223,15 @@ namespace DiscImageChef.Commands
|
|||||||
|
|
||||||
files.Sort(StringComparer.CurrentCultureIgnoreCase);
|
files.Sort(StringComparer.CurrentCultureIgnoreCase);
|
||||||
|
|
||||||
CICMMetadataType sidecar = Sidecar.Create(Path.GetFileName(inputFile), files, blockSize);
|
Sidecar sidecarClass = new Sidecar();
|
||||||
|
sidecarClass.InitProgressEvent += Progress.InitProgress;
|
||||||
|
sidecarClass.UpdateProgressEvent += Progress.UpdateProgress;
|
||||||
|
sidecarClass.EndProgressEvent += Progress.EndProgress;
|
||||||
|
sidecarClass.InitProgressEvent2 += Progress.InitProgress2;
|
||||||
|
sidecarClass.UpdateProgressEvent2 += Progress.UpdateProgress2;
|
||||||
|
sidecarClass.EndProgressEvent2 += Progress.EndProgress2;
|
||||||
|
sidecarClass.UpdateStatusEvent += Progress.UpdateStatus;
|
||||||
|
CICMMetadataType sidecar = sidecarClass.BlockTape(Path.GetFileName(inputFile), files, blockSize);
|
||||||
|
|
||||||
DicConsole.WriteLine("Writing metadata sidecar");
|
DicConsole.WriteLine("Writing metadata sidecar");
|
||||||
|
|
||||||
|
|||||||
@@ -144,15 +144,6 @@ namespace DiscImageChef.Commands
|
|||||||
devicePath = extra[0];
|
devicePath = extra[0];
|
||||||
outputFile = extra[1];
|
outputFile = extra[1];
|
||||||
|
|
||||||
// TODO: Be able to cancel hashing
|
|
||||||
Sidecar.InitProgressEvent += Progress.InitProgress;
|
|
||||||
Sidecar.UpdateProgressEvent += Progress.UpdateProgress;
|
|
||||||
Sidecar.EndProgressEvent += Progress.EndProgress;
|
|
||||||
Sidecar.InitProgressEvent2 += Progress.InitProgress2;
|
|
||||||
Sidecar.UpdateProgressEvent2 += Progress.UpdateProgress2;
|
|
||||||
Sidecar.EndProgressEvent2 += Progress.EndProgress2;
|
|
||||||
Sidecar.UpdateStatusEvent += Progress.UpdateStatus;
|
|
||||||
|
|
||||||
DicConsole.DebugWriteLine("Dump-Media command", "--cicm-xml={0}", cicmXml);
|
DicConsole.DebugWriteLine("Dump-Media command", "--cicm-xml={0}", cicmXml);
|
||||||
DicConsole.DebugWriteLine("Dump-Media command", "--debug={0}", MainClass.Debug);
|
DicConsole.DebugWriteLine("Dump-Media command", "--debug={0}", MainClass.Debug);
|
||||||
DicConsole.DebugWriteLine("Dump-Media command", "--device={0}", devicePath);
|
DicConsole.DebugWriteLine("Dump-Media command", "--device={0}", devicePath);
|
||||||
|
|||||||
Reference in New Issue
Block a user