Dann muss aber Mp3File noch ein Create bekommen, damit ich damit arbeiten kann, oder ?
Delphi-Quellcode:
TAudioFile = class
private
//Mp3
FID: String;
FTitel: String;
FArtist: String;
FAlbum: String;
FYear: String;
FComment: String;
FGenre: Byte;
FFilename: String;
FEndung: String;
public
constructor Create (AMusicFilename : string) ;
property ID : string read FID write FID;
property Titel : string read FTitel write FTitel;
property Artist : string read FArtist write FArtist;
property Album : string read FAlbum write FAlbum;
property Year : string read FYear write FYear;
property Comment : string read FComment write FComment;
property Genre : byte read FGenre write FGenre;
property Filename : string read FFilename write FFilename;
property Endung : string read FEndung write FEndung;
function ReadTags(const FileName: String): TAudioFile;
// procedure Write;
end;
TMP3File = class(TAudioFile)
public
procedure ReadMp3;
procedure Write;
end;
constructor TAudioFile.Create (AMusicFilename: String);
begin
FFilename := AMusicFilename;
end;
function TAudioFile.ReadTags(const FileName: String): TAudioFile;
begin
MP3File := TMP3File.
if LowerCase(ExtractFileExt(Filename)) = '.mp3' then
end;
procedure TMP3File.ReadMp3;
begin
with TFileStream.Create(FileName, fmOpenRead or fmShareDenyNone) do
try
Position := Size - 128;
Read(FID, 3);
Read(FTitel, 30);
Read(FArtist, 30);
Read(FAlbum, 30);
Read(FYear, 4);
Read(FComment, 30);
Read(FGenre, 1);
finally
Free;
end;
end;