Changeset 3
- Timestamp:
- Feb 17, 2014, 4:15:32 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GenPlaylist.pas
r2 r3 4 4 SysUtils; 5 5 6 procedure FileSearch(const PathName, FileName, BasePath : string) ; 6 type 7 TStringArray = array of string; 8 9 function InStrArray(Value: string; StrArray: array of string): Boolean; 10 var 11 I: Integer; 12 begin 13 I := 0; 14 while (I < Length(StrArray)) and (StrArray[I] <> Value) do Inc(I); 15 if I < Length(StrArray) then Result := True 16 else Result := False; 17 end; 18 19 procedure FileSearch(const PathName: string; ExtList: array of string; BasePath : string) ; 7 20 var 8 21 Rec: TSearchRec; … … 18 31 if Rec.Name = '..' then continue 19 32 else if Rec.Name = '.' then continue 20 else if (Rec.Attr and faDirectory) > 0 then FileSearch(Path + Rec.Name, FileName, BasePAth)21 else if LowerCase(ExtractFileExt(Rec.Name)) = LowerCase(FileName) then begin33 else if (Rec.Attr and faDirectory) > 0 then FileSearch(Path + Rec.Name, ExtList, BasePAth) 34 else if InStrArray(LowerCase(ExtractFileExt(Rec.Name)), ExtList) then begin 22 35 //WriteLn('File: ' + Rec.Name); 23 36 ItemFileName := ParamStr(2) + Copy(Path + Rec.Name, Length(BasePath) + 2, High(Integer)); … … 33 46 begin 34 47 WriteLn('#EXTM3U'); 35 FileSearch(ParamStr(1), '.mp3', ParamStr(1));48 FileSearch(ParamStr(1), ['.mp3', '.ac3', '.flac', '.it', '.m4a', '.wma', '.s3m', '.ogg'], ParamStr(1)); 36 49 end.
Note:
See TracChangeset
for help on using the changeset viewer.