Tagi z plików mp3 i TStringGrid

0

Otóż mam taki problem, iż po odczytaniu odpowiednich tagów z pliku mp3 nie są one poprawnie wyswietlane w tstringgrid, tylko jakieś głupoty, oczywiście nie wszystkie ale spora część to jaieś kwadraciki itp.
Oto kod źródłowy:
procedure Tforma.Search(dir:string;mask:string);
var
SRec: TSearchRec;
res: Integer;
ec: Char;
pom:string;
begin
ec := ':';
if dir <> '' then ec := dir[Length(dir)];
if (ec <> '') and (ec <> ':') then dir := dir + '';

res := FindFirst(dir + mask, faArchive, SRec);
while res = 0 do
begin
lista.cells[0,lista.rowcount]:=dir + SRec.Name;
lista.cells[1,lista.RowCount]:=FormatFloat('0.00', (srec.size/1024)/1024) ;
lista.cells[2,lista.rowcount]:=TimeToStr(FileDateToDateTime(SRec.Time));
tagi2.tag2mp(dir+srec.name);
if (tag2.tytul=) or (tag2.artysta=) or (tag2.album='')
then
begin
tagi1.tag1mp(dir+srec.name);
lista.cells[3,lista.rowcount]:=tag1.Title;
lista.cells[4,lista.rowcount]:=tag1.Album;
lista.cells[5,lista.rowcount]:=tag1.Artist;
lista.cells[6,lista.rowcount]:='';
lista.cells[7,lista.rowcount]:=tag1.year;
lista.cells[8,lista.rowcount]:=tag1.Comment;
pom:=tag1.Title+' - '+tag1.Artist+' - '+tag1.Album;
end
else
begin
lista.cells[3,lista.rowcount]:=tag2.Tytul;
lista.cells[4,lista.rowcount]:=tag2.Album;
lista.cells[5,lista.rowcount]:=tag2.Artysta;
lista.cells[6,lista.rowcount]:='';
lista.cells[7,lista.rowcount]:=tag2.Rok;
lista.cells[8,lista.rowcount]:=tag2.Komentarz;
pom:=tag2.tytul+' - '+tag2.artysta+' - '+tag2.album;
end;

lista.rowcount:=lista.rowcount+1;
res := FindNext(SRec);
end;
FindClose(SRec);

res := FindFirst(dir + '*', faDirectory, SRec);
while res = 0 do begin
if (SRec.Attr and faDirectory <> 0)
and (SRec.Name <> '.' ) and (SRec.Name <> '..') then
search(dir + srec.Name,mask);
res := FindNext(SRec);
end;
FindClose(SRec);

end;
Proszę kogos kto ma ochotę lub jakieś doświadczenie w temacie o pomoc.

0

Pierwsze co

Lista.RowCount-1

Bo array [0..10] ma 11 elemantów ale ostatni ma indeks Count-1. Następnie poczytaj ten fragment.

0
Oleksy_Adam napisał(a)

Pierwsze co

Lista.RowCount-1

Bo array [0..10] ma 11 elemantów ale ostatni ma indeks Count-1. Następnie poczytaj ten fragment.

Tyle, że tam jest jedynie tag w wersi 1. Gdzieś napisałem artykuł lub gotowiec o odczycie tagu w wersji 2. W prawdzie jest to wielka amatorka, ale działa ;)

1 użytkowników online, w tym zalogowanych: 0, gości: 1