home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Programmierung / SOURCE.mdf / programm / windows / c / playwave / playwave.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-11-12  |  993 b   |  32 lines

  1. #include <windows.h>
  2.  
  3. typedef BOOL (FAR PASCAL *_sndPlaySound_)(LPSTR,WORD);
  4.  
  5. class    PLAYWAVE
  6. {
  7.  private:
  8.   WORD wError;
  9.   _sndPlaySound_ sndPlaySound;
  10.   HANDLE hMemMMSYSTEM;
  11.   void Error(void);
  12.  public:
  13.   PLAYWAVE();
  14.   ~PLAYWAVE();
  15.   void Play(LPSTR,WORD);
  16.   void Resource(HANDLE,LPSTR);
  17. };
  18.  
  19. #define  SOUND_SYNC        0x0000 // play synchronously (default)
  20. #define  SOUND_ASYNC        0x0001 // play asynchronously
  21. #define  SOUND_NO_DEFAULT       0x0002 // don't use default sound
  22. #define  SOUND_MEMORY           0x0004 // lpszSoundName points to a memory file
  23. #define  SOUND_LOOP              0x0008 // loop the sound until next sndPlaySound
  24. #define  SOUND_NOSTOP             0x0010 // don't stop any currently playing sound
  25.  
  26.  
  27. #define     WAVE_ERROR_BAD_FORMAT    0x0020 // Wave format not supported
  28. #define  WAVE_ERROR_PLAYING    0x0021 // Still something playing
  29. #define     WAVE_ERROR_NOT_READY    0x0022 // Header not ready
  30. #define  WAVE_ERROR_SYNC_ONLY    0x0023 // Device is synchronous only
  31.  
  32.