/* * CWarFileReaderクラスのインタフェースを記述するためのファイルです。 * Author: AKIYAMA Kouhei * Created: 2002-10-01 */ #ifndef SSLIB2_WAR_FILE_READER_H_INCLUDED #define SSLIB2_WAR_FILE_READER_H_INCLUDED #include "WaveReader.h" namespace sslib2 { class CWarFileReader : public CWaveReader { //型 private: struct CWarHeaderRecord { DWORD dataCount; DWORD indexRecordSize; }; struct CWarIndexRecord { DWORD offset; DWORD size; DWORD loopIn; DWORD loopOut; DWORD loopCount; DWORD type : 8; DWORD streamFlag : 1; DWORD reserved : 32 - 9; }; //属性、関連 private: CWaveReader *m_reader; CWarIndexRecord m_indexRecord; //公開操作 public: CWarFileReader(); virtual ~CWarFileReader(); bool Open(const char *filename, int index); virtual void Close(void); virtual bool IsOpen(void) const; virtual bool Read(void *dst, unsigned long size, unsigned long *read); virtual bool Seek(unsigned long sample); virtual unsigned long Tell(void) const; virtual bool IsTerminated(void) const; virtual PCMWAVEFORMAT GetFormat(void) const; virtual unsigned long GetTotal(void) const; virtual unsigned long GetLoopIn(void) const; virtual unsigned long GetLoopOut(void) const; virtual int GetLoopCount(void) const; virtual bool GetStreamFlag(void) const; //非公開操作 private: static bool OpenWarFile(HANDLE fileHandle, int index, CWarIndexRecord *indexRecordPtr); static CWaveReader *CreateReader(HANDLE fileHandle, const CWarIndexRecord &indexRecord); static CWaveReader *CreatePlainWavFileReader(HANDLE fileHandle, const CWarIndexRecord &indexRecord); static CWaveReader *CreateAcmWavFileReader(HANDLE fileHandle, const CWarIndexRecord &indexRecord); static CWaveReader *CreateOggFileReader(HANDLE fileHandle, const CWarIndexRecord &indexRecord); }; } #endif