home *** CD-ROM | disk | FTP | other *** search
/ Game Audio Programming / GameAudioProgramming.iso / Game_Audio / audio_sdk / include / AudioLib / IAudioStream.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-06-30  |  2.7 KB  |  75 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 IAUDIOSTREAM_H__
  12. #define IAUDIOSTREAM_H__
  13.  
  14. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  15. namespace Audio
  16. {
  17. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  18.  
  19. /*! \file IAudioStream.h*/ 
  20.  
  21. //! IAudioStream is the internal file representation used by the audio system
  22. /*!
  23. IAudioStream, derived from the COM standard IStream interface is used
  24. internally by the audio system to interface with data streams of any kind.
  25. A default file-based stream implementation is used internally by default,
  26. but a client may choose to create a custom implementation and use it 
  27. instead.  
  28. \sa IAudioStreamFactory
  29. */
  30. class IAudioStream : public IStream
  31. {
  32. public:
  33.     /*!
  34.     Opens an IStream using a unique character-based identifier.  Typically,
  35.     the string represents a file name, but alternative implementations
  36.     may choose to utilize other methods of representing data blocks.
  37.     \param sFileName A unique string-based identifier which can be used
  38.     \return S_OK is returned on success, otherwise E_FAIL is returned.
  39.     to open the data stream.
  40.     */
  41.     virtual HRESULT __stdcall Open(std::string sFileName) = 0;
  42. };
  43.  
  44.  
  45. //! IAudioStreamFactory is a factory template used to create IAudioStream files
  46. /*!
  47. IAudioStreamFactory is an abstract template class used by the audio system
  48. when it must create IAudioStream objects.  A default implementation of this
  49. interface is used to create standard file-based IAudioStream objects, but
  50. a client may choose to create a custom implementation of this class, along with
  51. a custom implementation of IAudioStream, which will be used in place of
  52. the internal default version of the factory.  The custom factory may be passed to
  53. the audio system in the AudioMgrInit structure.  The client is responsible
  54. for allocating and deallocating the object.
  55. \sa IAudioStream, AudioMgrInit, IAudioManager::Init()
  56. */
  57. class IAudioStreamFactory
  58. {
  59. public:
  60.     /*!
  61.     Creates an IAudioStream-based object.
  62.     \param pStream Holds a pointer to an IAudioStream object which will be
  63.     filled out by the function.
  64.     \return true indicates success, false indicates failure.
  65.     \sa IAudioStream
  66.     */
  67.     virtual bool CreateAudioStream(IAudioStream*& pStream) = 0;
  68. };
  69.  
  70. #ifndef DOXYGEN_SHOULD_SKIP_THIS
  71. }; // namespace Audio
  72. #endif /* DOXYGEN_SHOULD_SKIP_THIS */
  73.  
  74. #endif // IAUDIOSTREAM_H__
  75.