home *** CD-ROM | disk | FTP | other *** search
/ Game Audio Programming / GameAudioProgramming.iso / Game_Audio / audio_sdk / src / AudioLib / IAudioLoader.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-07-03  |  1.7 KB  |  61 lines

  1. /***********************************************************\
  2. Copyright (C) James Boer, 2002. 
  3. All rights reserved worldwide.
  4.  
  5. This software is provided "as is" without express or implied
  6. warranties. You may freely copy and compile this source into
  7. applications you distribute provided that the copyright text
  8. below is included in the resulting source code, for example:
  9. "Portions Copyright (C) James Boer, 2002"
  10. \***********************************************************/
  11. #ifndef __IAUDIOLOADER_H__
  12. #define __IAUDIOLOADER_H__
  13.  
  14. #include "Audio.h"
  15.  
  16. namespace Audio
  17. {
  18.  
  19. class IAudioLoader
  20. {
  21. public:
  22.     
  23.     // This Open function is used by the current audio
  24.     // system.  It is expected that it will acquire
  25.     // an IAudioStream interface using the filename,
  26.     // which technically could simply be a string ID
  27.     // for a custom file system as well.
  28.     virtual bool Open(std::string sFileName) = 0;
  29.  
  30.     // This decodes data directly to a memory buffer in
  31.     // a single batch.
  32.     virtual bool Open(BYTE* pbData, uint32 dwDataSize) = 0;
  33.  
  34.     // Close the input stream
  35.     virtual bool Close() = 0;
  36.  
  37.     // Read from the input stream
  38.     virtual bool Read( BYTE* pBuffer, uint32 dwSizeToRead, uint32* pdwSizeRead ) = 0;
  39.  
  40.     // Get the total size of the input stream
  41.     virtual uint32 GetSize() = 0;
  42.  
  43.     // Reset the input stream to the beginning
  44.     virtual bool Reset() = 0;
  45.  
  46.     // Get the PCM format of the input stream
  47.     virtual WAVEFORMATEX* GetFormat() = 0;
  48.  
  49.     // Return true if the end of the stream is reached
  50.     virtual bool IsEOF() = 0;
  51.  
  52.     // Function used to destroy pool-managed objects
  53.     virtual void Destroy() = 0;
  54.  
  55. protected:
  56.     virtual ~IAudioLoader()    {}
  57. };
  58.  
  59. }; // namespace Audio
  60.  
  61. #endif // __IAUDIOLOADER_H__