Hi
Ich habe einige kleine Probleme mit nem Playlist (*.M3U) Code!
Er funzt zu 95%! Wen die liste wie folgt Aussieht.
Problem Nr.1
--------------------------------------------------------------
#EXTM3U
#EXTINF:220,Barracuda - Damn
G:\xxx\ok\109_barracuda_-_damn-mod.mp3
#EXTINF:200,sam g - lost in space
G:\xxx\ok\110-sam_g_-_lost_in_space-tlt.mp3
#EXTINF:205,André Visior - Don't Go
G:\xxx\ok\110_andre_visior_-_dont_go-nbd.mp3
#EXTINF:200,DJ K - I like Chopin
G:\xxx\ok\110_dj_k_-_i_like_chopin-mod.mp3
Wen in der liste der bereich (#EXTINF) feilt kackt er Up
--
#EXTM3U
#EXTINF:220,Barracuda - Damn
G:\xxx\ok\109_barracuda_-_damn-mod.mp3
#EXTINF:200,sam g - lost in space
G:\xxx\ok\110-sam_g_-_lost_in_space-tlt.mp3
G:\xxx\ok\110_andre_visior_-_dont_go-nbd.mp3
G:\xxx\ok\110_dj_k_-_i_like_chopin-mod.mp3
--------------------------------------------------------------
Problem Nr.2
Wie kann ich die zeit auslesen (#EXTINF:220, Title) 220 = Time
Code:
FileList : TStringList;
FileTitle : TStringList;
FileLength : TStringList;
function TPlaylist.LoadM3U(FileName : String; ClearCurrent : Boolean) : Boolean;
var i : Integer; FileINI : TStringList; Temp : String;
begin
CurPlaylist := FileName;
try
if ClearCurrent then
begin
{FileList.Clear;
FileTitle.Clear;
FileLength.Clear}
Clear;
end;
FileINI := TStringList.Create;
FileINI.LoadFromFile(FileName);
i := 0;
While (i < FileINI.Count - 1) do
begin
Temp := UpperCase(Trim(FileINI[i]));
if (Copy(Temp, 1, 1) <> '#') then
FileList.Add(ProcessPath(FileINI[i]))
else
if Copy(Temp, 1, 8) = '#EXTINF:' then
begin
FileTitle.Add(Copy(FileINI[i], Pos(',', FileINI[i]) + 1, Length(FileINI[i])));
FileLength.Add('0');
end
Inc(i);
end;
FileINI.Free;
result := True;
except
result := False;
end;
end;
Danke im Voraus!