-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCDToImageProgressFormUnit.pas
More file actions
142 lines (126 loc) · 5.64 KB
/
Copy pathCDToImageProgressFormUnit.pas
File metadata and controls
142 lines (126 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
unit CDToImageProgressFormUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, CDToImageThreadUnit;
type
TCDToImageProgressForm = class(TForm)
Sect_reading_disp_Lbl: TLabel;
Reading_sector_Lbl: TLabel;
Stop_Image_Btn: TButton;
LBL_curr_read_speed: TLabel;
Label2: TLabel;
Label1: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure Stop_Image_BtnClick(Sender: TObject);
private
{ Private declarations }
On_FormClose_proc : TNotifyEvent;
CDToImageThread : TCDToImageThread;
Procedure Thread_done(Sender: TObject);
public
{ Public declarations }
Constructor Create(In_On_FormClose_proc : TNotifyEvent; in_AOwner: TComponent);
Procedure Start_thread(in_StartSect : LongInt;
in_N_Sect : LongWord;
in_CD_read_speed_index : Word;
in_FilterMode : Byte;
in_SubChSelMode : Byte;
in_is_TEB : Boolean;
in_f : TFileStream;
in_f2 : TFileStream;
in_f3 : TFileStream;
in_f_pregap1 : TFileStream;
in_f_LO : TFileStream;
in_f_C2 : TFileStream;
in_C2_error_mode : Byte;
in_C2_read_order : Byte;
in_lead_in_type : Byte;
in_lead_in_size : LongInt;
in_lead_out_size : LongInt;
in_deinterleave : Boolean);
Procedure ShowErrMsg(s : String);
end;
var
CDToImageProgressForm: TCDToImageProgressForm;
implementation
{$R *.dfm}
Constructor TCDToImageProgressForm.Create(In_On_FormClose_proc : TNotifyEvent; in_AOwner: TComponent);
Begin
On_FormClose_proc:=In_On_FormClose_proc;
inherited Create(in_AOwner);
End;
Procedure TCDToImageProgressForm.Start_thread(in_StartSect : LongInt;
in_N_Sect : LongWord;
in_CD_read_speed_index : Word;
in_FilterMode : Byte;
in_SubChSelMode : Byte;
in_is_TEB : Boolean;
in_f : TFileStream;
in_f2 : TFileStream;
in_f3 : TFileStream;
in_f_pregap1 : TFileStream;
in_f_LO : TFileStream;
in_f_C2 : TFileStream;
in_C2_error_mode : Byte;
in_C2_read_order : Byte;
in_lead_in_type : Byte;
in_lead_in_size : LongInt;
in_lead_out_size : LongInt;
in_deinterleave : Boolean);
Begin
If CDToImageThread=nil Then
Begin
CDToImageThread:=TCDToImageThread.Create(Thread_done,
in_StartSect,
in_N_Sect,
in_CD_read_speed_index,
in_FilterMode,
in_SubChSelMode,
in_is_TEB,
in_f,
in_f2,
in_f3,
in_f_pregap1,
in_f_LO,
in_f_C2,
in_C2_error_mode,
in_C2_read_order,
in_lead_in_type,
in_lead_in_size,
in_lead_out_size,
in_deinterleave);
End;
End;
Procedure TCDToImageProgressForm.Thread_done(Sender: TObject);
Begin
Stop_Image_Btn.Enabled:=False;
MessageDlg('Finished. Image completed.', mtInformation, [mbOk], 0);
End;
procedure TCDToImageProgressForm.FormClose(Sender: TObject; var Action: TCloseAction);
begin
If CDToImageThread<>nil Then
Begin
CDToImageThread.Terminate;
CDToImageThread.WaitFor;
CDToImageThread.Free;
CDToImageThread:=nil;
End;
On_FormClose_proc(Sender);
Action:=caFree;
end;
procedure TCDToImageProgressForm.Stop_Image_BtnClick(Sender: TObject);
begin
If CDToImageThread<>nil Then
Begin
CDToImageThread.Terminate;
Stop_Image_Btn.Enabled:=False;
End;
end;
Procedure TCDToImageProgressForm.ShowErrMsg(s : String);
Begin
Application.NormalizeTopMosts;
MessageDlg(s, mtError, [mbOk], 0);
Application.RestoreTopMosts;
End;
end.