(( Dies gehört eigentlich unter "Tips&Tricks" ))
Utility:unit B_ID3V1;
interface
uses
Windows, Messages, SysUtils, Classes;
Type
// standard definition
PID3V1Rec = ^TID3V1Rec;
TID3V1Rec = packed record
Tag : array[0..2] of Char;
Title : array[0..29] of Char;
Artist : array[0..29] of Char;
Album : array[0..29] of Char;
Year : array[0..3] of Char;
Comment : array[0..29] of Char;
Genre : Byte;
end;
const
cID3V1FGenre : Array[0..147] of String = (
'Blues', 'Classic Rock', 'Country', 'Dance', ..., 'Synthpop' );
function BASSID3ToID3V1Rec(PC: PChar): TID3V1Rec;
implementation
function BASSID3ToID3V1Rec(PC: PChar): TID3V1Rec;
Var
TempID3V1: TID3V1Rec;
begin
FillChar(Result, SizeOf(TID3V1Rec),0);
If (PC=Nil) then Exit;
TempID3V1:=PID3V1Rec(PC)^;
If SameText(TempID3V1.Tag,'TAG') then Result:=TempID3V1;
End;
Use:
Var
ID3: TID3V1Rec;
...
ID3:= BASSID3ToID3V1Rec(BASS_StreamGetTags(fStreamHandle, BASS_TAG_ID3));
Showmessage(
'Title : ' + ID3.Title
'Artist : ' + ID3.Artist
'Year : ' + ID3.Year
'Comment : ' + ID3.Comment
'Genre : ' + cID3V1FGenre[ID3.Genre]
);
Ich poste es gleich "rüber" ;)
Gruß