Ignore:
Timestamp:
Jun 5, 2007, 12:07:29 AM (17 years ago)
Author:
alloc
Message:
 
Location:
oup/current/FileClasses
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • oup/current/FileClasses/TXMP.pas

    r207 r209  
    44
    55uses
    6   TypeDefs, _FileTypes, _DataTypes;
     6  _FileTypes;
    77
    88type
     
    1717
    1818uses
    19   ConnectionManager, Math, Classes;
     19  ConnectionManager, Math, Classes, TypeDefs, _DataTypes;
    2020
    21 { TFile_SNDD }
    22 
    23 procedure TFile_TXMP.InitDatLinks;
    24 begin
    25   SetLength(FDatLinks, 2);
    26   FDatLinks[0].SrcOffset := $94;
    27   FDatLinks[0].DestID := -1;
    28   FDatLinks[0].PosDestExts := '*';
    29   FDatLinks[1].SrcOffset := $98;
    30   FDatLinks[1].DestID := -1;
    31   FDatLinks[1].PosDestExts := 'TXMP';
    32 end;
    33 
     21{ TFile_TXMP }
    3422
    3523procedure TFile_TXMP.InitDataFields;
     
    119107
    120108
     109procedure TFile_TXMP.InitDatLinks;
     110begin
     111  SetLength(FDatLinks, 2);
     112  FDatLinks[0].SrcOffset := $94;
     113  FDatLinks[0].DestID := GetDatLinkValue(FFile, $94);
     114  FDatLinks[0].PosDestExts := '*';
     115  FDatLinks[1].SrcOffset := $98;
     116  FDatLinks[1].DestID := GetDatLinkValue(FFile, $98);
     117  FDatLinks[1].PosDestExts := 'TXMP';
     118end;
     119
     120
    121121procedure TFile_TXMP.InitRawList;
    122122var
  • oup/current/FileClasses/_FileTypes.pas

    r207 r209  
    1212      FConnectionID: Integer;
    1313      FFileID: Integer;
     14      FFileName: String;
    1415      FFile: TMemoryStream;
    1516
     
    3435      property FileStream: TMemoryStream read FFile;
    3536      property FileID: Integer read FFileID;
     37      property FileName: String read FFileName;
    3638      property ConnectionID: Integer read FConnectionID;
    3739
     
    5052
    5153
     54function GetDatLinkValue(stream: TStream; offset: Integer): Integer;
     55
     56
     57
    5258implementation
    5359
     
    6369  FConnectionID := ConnectionID;
    6470  FFileID := FileID;
    65   FFile := nil;
     71  FFileName := ConManager.Connection[ConnectionID].GetFileInfo(FileID).Name;
    6672
    6773  FFile := TMemoryStream.Create;
     
    7177  InitDataFields();
    7278  InitRawList();
    73 
    74   if FDataFields.FieldCount > 0 then
    75   begin
    76     for i := 0 to FDataFields.FieldCount - 1 do
    77     begin
    78       ShowMessage(FDataFields.FieldByIndex[i].ValueAsString);
    79     end;
    80   end;
    8179
    8280  FFile.Free;
     
    171169end;
    172170
     171
     172
     173function GetDatLinkValue(stream: TStream; offset: Integer): Integer;
     174begin
     175  stream.Seek(Offset, soFromBeginning);
     176  stream.Read(Result, 4);
     177  if Result > 0 then
     178    Result := Result div 256
     179  else
     180    Result := -1;
     181end;
     182
    173183end.
Note: See TracChangeset for help on using the changeset viewer.