Registriert seit: 19. Sep 2006
126 Beiträge
|
Re: Probleme mit ListView in HTML Speichern
11. Feb 2007, 17:50
ich habe hier die längen weg genommen
Delphi-Quellcode:
type
TID3Tag = record
ID: string[3];
Titel: string;
Artist: string;
Album: string;
Year: string[4];
Comment: string;
Genre: byte;
dauer: longint; //in sekunden;
sample: integer;
bits: byte;
vers: byte;
layers: byte;
end;
const
MPEG_BIT_RATES : array[1..3] of array[1..3] of array[0..15] of word =
{ Version 1, Layer I }
(((0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0),
{ Version 1, Layer II }
(0,32,48,56, 64, 80, 96,112,128,160,192,224,256,320,384,0),
{ Version 1, Layer III }
(0,32,40,48, 56, 64, 80, 96,112,128,160,192,224,256,320,0)),
{ Version 2, Layer I }
((0,32,48, 56, 64, 80, 96,112,128,144,160,176,192,224,256,0),
{ Version 2, Layer II }
(0, 8,16,24, 32, 40, 48, 56, 64, 80, 96, 112,128,144,160,0),
{ Version 2, Layer III }
(0, 8,16,24, 32, 40, 48, 56, 64, 80, 96, 112,128,144,160,0)),
{ Version 2.5, Layer I }
((0,32,48, 56, 64, 80, 96,112,128,144,160,176,192,224,256,0),
{ Version 2.5, Layer II }
(0, 8,16,24, 32, 40, 48, 56, 64, 80, 96, 112,128,144,160,0),
{ Version 2.5, Layer III }
(0, 8,16,24, 32, 40, 48, 56, 64, 80, 96, 112,128,144,160,0)));
sample_rates: array[1..3] of array [0..3] of word=
((44100,48000,32000,0),
(22050,24000,16000,0),
(11025,12000,8000,0));
Hiermit erstelle ich die liste nach Feld eintrag
Delphi-Quellcode:
procedure TForm1.CreateFileList(Dir, Ext: String; UseSubDirs: Boolean);
var
SR: TSearchRec;
Item: TListItem;
begin
If FindFirst(Dir + '*.*', faAnyFile, SR) = 0 then
Repeat
If (SR.Attr and faDirectory = faDirectory) and (SR.Name <> '.') and (SR.Name <> '..') and (UseSubDirs) then CreateFileList(IncludeTrailingPathDelimiter(Dir + SR.Name), Ext, UseSubDirs)
Else If LowerCase(ExtractFileExt(SR.Name)) = LowerCase(Ext) then
begin
Application.ProcessMessages;
///////////////////////////////////////////////
Item := ListView1.Items.Add;
///////////////////////////////////////////////
Lese_ID3Tag(Dir + SR.Name);
Item.Caption := ID3Tag.Artist;
Item.SubItems.Add(ID3Tag.Titel);
Item.SubItems.Add(ID3Tag.Album);
Item.SubItems.Add(SR.Name);
//Item.SubItems.Add(Dir);
///////////////////////////////////////////////
Item := ListView2.Items.Add;
Item.Caption := artist;
Item.SubItems.Add(titel);
end;
Label2.Caption:='Aktion: Suche Dateien';
Until FindNext(SR) <> 0;
FindClose(SR);
Label2.Caption:='Aktion: Fertig';
end;
Beginn der Suche:
Delphi-Quellcode:
procedure TForm1.SucheClick(Sender: TObject);
begin
artist:=ID3Tag.Artist;
titel:=ID3Tag.Titel;
ListView1.Clear;
ListView2.Clear;
if CheckBox_MP3.Checked = True then
CreateFileList(quelle + '\', '.mp3', CheckBox1.Checked);
if CheckBox_WMA.Checked = True then
CreateFileList(quelle + '\', '.wma', CheckBox1.Checked);
Label1.Caption:='Insgesamt: '+IntToStr(ListView1.Items.Count);
//////////////////////////////////////////////////////////////
ColumnToSort := 0; //hier also der Index der Spalte, nach der Sortiert werden soll
ColumnToSort2 := 2;
ColumnToSort3 := 1;
ListView1.AlphaSort;
end;
Ein wahrhaft großer Mann wird weder einen Wurm zertreten noch vor dem Kaiser kriechen.
Benjamin Franklin
17.01.1706 - 17.04.1790
|