FileMgr.h 1.06 KB

#ifndef _AE_FileMgr_h
#define _AE_FileMgr_h

#include "Hash.h"

#define FILE_FAILURE  -1
#define FILE_OK       0
#define NO_FILE       1

class FileMgr
{
  protected:
    HashTable   *hashTbl;
    ALSymFile   *symFile;


    int     _ParseAssets(void);

    void    _ParseBankFile(AEBankFile* bankfAsset, int fileOffset);
    void    _ParseBank(AEBank* bankAsset, int fileOffset);
    void    _ParseInst(AEInst* instAsset, int fileOffset);
    void    _ParseSound(AESound* soundAsset, int fileOffset);
    void    _ParseKeymap(AEKeymap* keymapAsset, int fileOffset);
    void    _ParseEnvlp(AEEnvlp* envlpAsset, int fileOffset);
    void    _ParseWavet(AEWavet* bankAsset, int fileOffset);
    void    _ParseLoop(AELoop* bankAsset, int fileOffset);
    void    _ParseBook(AEBook* bookAsset, int fileOffset);

  public:

    ALBankFile  *ctlFile;    
    u8          *tblFile;
    int         tblSize;
    int         ctlSize;
    int         symSize;

    FileMgr(); 
    ~FileMgr();
   
    char*   GetFile(char *fname, int *fSize);
    int     ReadBank(char *bname);
};


#endif