望吧主莫删 本人不通delphi 中间的片段代码需要翻译到自己写的程序中 求教
begin
if (not OpenDialog1.Execute) then exit;
if (treeview1.Items.Count>0) then begin
ListView1.Items.Clear;
freenode(treeview1.Items[0]);
node:=treeview1.Items[0];
node.free;
treeview1.Items.Clear;
imagefile.close;
end;
if not imagefile.readimagefile(ProgressBar1, OpenDialog1.FileName, treeview1) then exit;
if (imagefile.instream.tarform<>nil) then begin
input_imagefile.Text:=OpenDialog1.FileName+*\*+imagefile.instream.tarform.tarform.TreeView1.Selected.Text;
imagefile.instream.tarform.tarform.Close;
imagefile.instream.tarform.tarform.free;
end
else
input_imagefile.Text:=OpenDialog1.FileName;
button_saveext4.Enabled:=true;
treeview1.Selected:=treeview1.Items[0];
node:=treeview1.Items[0];
node.Expand(false);
node.Expanded:=true;
end;
private
{ Private declarations }
imagefile : TImageFile;
oggpl : TOggPlayer;
mp3pl : TcmxMP3;
playstart : string;
playstop : string;
SaveimageDialogTitle : string;
savefileasdialogtitle : string;
savefiletodialogtitle : string;
stopextract : boolean;
procedure freenode(anode : TTreeNode);
procedure ogg_playend(Sender: Tobject);
procedure mp3_playend(Sender: Tobject);
procedure savefile(dirobj: TExt4_DirObj; dstdir: string; filename: string);
procedure savedir(dirlist: TStringList; dstdir: string);
procedure countfiles(dirlist: TStringList);
public
{ Public declarations }
end;
begin
if (not OpenDialog1.Execute) then exit;
if (treeview1.Items.Count>0) then begin
ListView1.Items.Clear;
freenode(treeview1.Items[0]);
node:=treeview1.Items[0];
node.free;
treeview1.Items.Clear;
imagefile.close;
end;
if not imagefile.readimagefile(ProgressBar1, OpenDialog1.FileName, treeview1) then exit;
if (imagefile.instream.tarform<>nil) then begin
input_imagefile.Text:=OpenDialog1.FileName+*\*+imagefile.instream.tarform.tarform.TreeView1.Selected.Text;
imagefile.instream.tarform.tarform.Close;
imagefile.instream.tarform.tarform.free;
end
else
input_imagefile.Text:=OpenDialog1.FileName;
button_saveext4.Enabled:=true;
treeview1.Selected:=treeview1.Items[0];
node:=treeview1.Items[0];
node.Expand(false);
node.Expanded:=true;
end;
private
{ Private declarations }
imagefile : TImageFile;
oggpl : TOggPlayer;
mp3pl : TcmxMP3;
playstart : string;
playstop : string;
SaveimageDialogTitle : string;
savefileasdialogtitle : string;
savefiletodialogtitle : string;
stopextract : boolean;
procedure freenode(anode : TTreeNode);
procedure ogg_playend(Sender: Tobject);
procedure mp3_playend(Sender: Tobject);
procedure savefile(dirobj: TExt4_DirObj; dstdir: string; filename: string);
procedure savedir(dirlist: TStringList; dstdir: string);
procedure countfiles(dirlist: TStringList);
public
{ Public declarations }
end;