mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-19 09:01:32 +01:00
Add the possibility to cancel CDA extraction, gif and ico.
This commit is contained in:
1 parent
2f1fa29b5c
commit
010a68c2c0
3 files changed
+33
No files matched your search
@@ -22,10 +22,12 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
public ConversionJob_ExtractCDA() : base()
|
||||
{
|
||||
this.IsCancelable = true;
|
||||
}
|
||||
|
||||
public ConversionJob_ExtractCDA(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
this.IsCancelable = true;
|
||||
}
|
||||
|
||||
protected override InputPostConversionAction InputPostConversionAction
|
||||
@@ -186,6 +188,13 @@ namespace FileConverter.ConversionJobs
|
||||
File.Delete(this.intermediateFilePath);
|
||||
}
|
||||
|
||||
public override void Cancel()
|
||||
{
|
||||
base.Cancel();
|
||||
|
||||
this.compressionConversionJob.Cancel();
|
||||
}
|
||||
|
||||
private void WriteWaveData(object sender, DataReadEventArgs eventArgs)
|
||||
{
|
||||
this.waveWriter?.Write(eventArgs.Data, 0, (int)eventArgs.DataSize);
|
||||
@@ -193,6 +202,12 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
private void CdReadProgress(object sender, ReadProgressEventArgs eventArgs)
|
||||
{
|
||||
if (this.CancelIsRequested)
|
||||
{
|
||||
eventArgs.CancelRead = true;
|
||||
return;
|
||||
}
|
||||
|
||||
this.Progress = (float)eventArgs.BytesRead / (float)eventArgs.Bytes2Read;
|
||||
|
||||
eventArgs.CancelRead |= this.State != ConversionState.InProgress;
|
||||
|
||||
@@ -14,6 +14,15 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
public ConversionJob_Gif(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
this.IsCancelable = true;
|
||||
}
|
||||
|
||||
public override void Cancel()
|
||||
{
|
||||
base.Cancel();
|
||||
|
||||
this.pngConversionJob.Cancel();
|
||||
this.gifConversionJob.Cancel();
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
|
||||
@@ -13,6 +13,15 @@ namespace FileConverter.ConversionJobs
|
||||
|
||||
public ConversionJob_Ico(ConversionPreset conversionPreset) : base(conversionPreset)
|
||||
{
|
||||
this.IsCancelable = true;
|
||||
}
|
||||
|
||||
public override void Cancel()
|
||||
{
|
||||
base.Cancel();
|
||||
|
||||
this.pngConversionJob.Cancel();
|
||||
this.icoConversionJob.Cancel();
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
|
||||
Reference in new issue
Block a user