pcmfilelist.dato

mdxonline213.cfg̐ݒBasePathȉpcmfilelist.dat.szipǉł̂ŁAȑÕo[Ŵ܂܂ł肠܂B
ۂɂ́Ahttp://moonlight.servehttp.com:11080/mdxonline213/pcmfilelist.dat.szipɂȂ܂B

t@CtH[}bg

pos type info
  0 word t@C

wb_IB}WbNR[h͂܂B
ȉt@C܂B

pos type info
  0 byte MXDRVpPDXȂ0AFMP/PMDpPCMȂ1܂B2ȍ~͖悤ɂĉB
  1 byte t@C̒B1Ȃ1A10Ȃ10܂B
  2 str  t@C

tb^͂܂B

XPDXt@CNGXgȂ悤ɂ邱ƂŃX|X̌オAƂ̂̎vRłAɂAMDXw12345678.pdxŁAT[o[123456789.pdxvł悤ɂȂƎv܂B]Ȃ̂łMXDRV̎iƂHuman68k̎dljƂėL炵̂ŁB
Aꂩ啶藐Ă܂̂łӉ܂B

DelphiŎۂɎgĂǂݍ݃R[h

var
  MXDRVPDXFileList,FMPMDPCMFileList:TStringList;

procedure TNetwork.LoadPCMFileList;
var
  fname:string;
  fs:TFileStream;
  cnt,Count:integer;
  mode:byte;
begin
  MXDRVPDXFileList.Clear;
  FMPMDPCMFileList.Clear;

  fname:=CFG.PCMFileListFilename;
  if FileExists(fname)=False then exit;

  fs:=TFileStream.Create(fname,fmOpenRead or fmShareDenyWrite);
  Count:=GetStreamWord(fs);
  for cnt:=0 to Count-1 do begin
    mode:=GetStreamByte(fs);
    case mode of
      0: MXDRVPDXFileList.Add(GetStreamMString(fs));
      1: FMPMDPCMFileList.Add(GetStreamMString(fs));
    end;
  end;
  fs.Free;
end;

܂BDelphiŎۂɎgĂ鏑݃R[h

procedure TMain.CreatePCMFile;
var
  path:string;
  FileLstCount:integer;
  cnt:integer;
  fs:TFileStream;
  res:integer;
  procedure LoadFiles(path:string;mode:byte);
  var
    res:integer;
    SearchRec: TSearchRec;
  begin
    res:=FindFirst(path, (faReadOnly or faHidden or faSysFile or faArchive), SearchRec);
    if res=0 then begin
      repeat
        if (SearchRec.Attr and faDirectory)=0 then begin
          inc(FileLstCount);
          SetStreamByte(fs,mode);
          SetStreamMString(fs,copy(SearchRec.Name,1,length(SearchRec.Name)-5));
        end;
        res:=FindNext(SearchRec);
      until (res<>0);
    end;
    FindClose(SearchRec);
  end;
begin
  LoadPCMFileTimer.Enabled:=False;

  path:=SeekPathEdt.Text;

  FileLstCount:=0;
  fs:=TFileStream.Create(path+'pcmfilelist.dat',fmCreate or fmShareDenyWrite);
  SetStreamWord(fs,FileLstCount);
  LoadFiles(path+'MXDRV_PDX\*.szip',0);
  LoadFiles(path+'FMPPMD_PCM\*.szip',1);
  fs.Position:=0;
  SetStreamWord(fs,FileLstCount);
  fs.Free;

  res:=SZipCompress(path+'pcmfilelist.dat',path+'pcmfilelist.dat.szip');
  if res<>0 then ShowMessage(inttostr(res)+' CatalogPCMFileListCompressFailed pcmfilelist.dat');
end;

Ȃij
