Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
2.1 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dsplayb.h
  6. * Content: Definition of the CDirectSoundPlaybackBuffer class
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/16/99 rodtoll Created
  12. * 08/04/99 rodtoll Updated to take dsound ranges for volume
  13. * 11/12/99 rodtoll Modified abstraction for new waveOut support.
  14. * Now abstracted types look almost like dsound objects
  15. * 01/27/2000 rodtoll Updated sound classes to accept playback flags,
  16. * buffer structures and DSBUFFERDESC instead of DSBUFFERDESC1
  17. * 04/17/2000 rodtoll Fix: Bug #32215 - Session Lost after resuming from hibernation
  18. *
  19. ***************************************************************************/
  20. #ifndef __DIRECTSOUNDPLAYBACKBUFFER_H
  21. #define __DIRECTSOUNDPLAYBACKBUFFER_H
  22. // CDirectSoundPlaybackBuffer
  23. //
  24. // This class provides an implementation of the CAudioPlaybackBuffer class
  25. // for directsound. In the abstract sense, it represents a buffer of audio
  26. // which can be played to the sound hardware which consists of multiple,
  27. // equal length subbuffers.
  28. //
  29. class CDirectSoundPlaybackBuffer: public CAudioPlaybackBuffer
  30. {
  31. public:
  32. CDirectSoundPlaybackBuffer( LPDIRECTSOUNDBUFFER lpdsBuffer );
  33. virtual ~CDirectSoundPlaybackBuffer();
  34. public:
  35. HRESULT Lock( DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID *lplpvBuffer1, LPDWORD lpdwSize1, LPVOID *lplpvBuffer2, LPDWORD lpdwSize2, DWORD dwFlags );
  36. HRESULT UnLock( LPVOID lpvBuffer1, DWORD dwSize1, LPVOID lpvBuffer2, DWORD dwSize2 );
  37. HRESULT SetVolume( LONG lVolume );
  38. HRESULT GetCurrentPosition( LPDWORD lpdwPosition );
  39. HRESULT SetCurrentPosition( DWORD dwPosition );
  40. HRESULT Get3DBuffer( LPDIRECTSOUND3DBUFFER *lplpds3dBuffer );
  41. HRESULT Play( DWORD dwPriority, DWORD dwFlags );
  42. HRESULT Stop();
  43. HRESULT Restore();
  44. DWORD GetStartupLatency();
  45. protected:
  46. LPDIRECTSOUNDBUFFER m_lpdsBuffer;
  47. DWORD m_dwLastPosition;
  48. DWORD m_dwPriority;
  49. DWORD m_dwFlags;
  50. BOOL m_fPlaying;
  51. };
  52. #endif