Autor Beitrag
Ironhead
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP,Kanotix 5

BeitragVerfasst: So 09.09.07 19:07 
Hab mal ne Frage,

ich tu bei meinem mp3 Player mit nem OpenDialog die Musik in eine Playlist laden, nun hätt ich ganz gerne auch noch ne Covervorschau.

Also beim laden der Musik soll er mir automatisch das Verzeichnis nach Bilddateien (bmp, JPEG oder ähnliches) durchsuchen und wenn eins vorhanden ist soll er es automatisch ins TImage laden.

Wäre schön wenn einer ne Lösung hat, Danke schonmal.
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 09.09.07 19:36 
Hier mal ein Ausschnitt, wie ich das mache:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
// Liste mit Bilddateien ermitteln
Procedure SucheCover(pfad: String; CoverList:TStringlist);
var sr : TSearchrec;
    dateityp:string;
begin
    pfad := IncludeTrailingPathDelimiter(pfad);
    if Findfirst(pfad+'*',FaAnyfile,sr) = 0 then
    repeat
      if (sr.name<>'.') AND (sr.name<>'..') then
      begin
        dateityp:=AnsiLowerCase(ExtractFileExt(sr.Name));
        if (dateityp='.jpg') OR (dateityp='.jpeg') OR (dateityp='.bmp') then
            CoverList.Add(pfad + sr.Name);
      end;
    until Findnext(sr)<>0;
    Findclose(sr);
end;

// Index eines Front-Cover ermitteln
function GetFrontCover(CoverList:TStrings):integer;
var i:integer;
begin
  result := -1;

  for i:=0 to CoverList.Count-1 do
    if AnsiContainsText(CoverList[i],'front') then
      result := i;

  if result = -1 then
    for i:=0 to CoverList.Count-1 do
      if AnsiContainsText(CoverList[i],'_a') then
        result := i;

  if result = -1 then
  begin
    result := 0;
    for i:=0 to CoverList.Count-1 do
      if AnsiContainsText(CoverList[i],'folder') then
        result := i;
  end;
end;

_________________
We are, we were and will not be.
Ironhead Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 57

Win XP,Kanotix 5

BeitragVerfasst: So 09.09.07 19:54 
Jau ich Danke dir erstmal, ich werd mir das mal zu gemüte führen