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.

74 lines
2.7 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dsplayd.h
  6. * Content: Definition of the CDirectSoundPlaybackDevice class
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 07/16/99 rodtoll Created
  12. * 07/30/99 rodtoll Updated to allow creation of object using a pre-created
  13. * DirectSound Object.
  14. * 08/04/99 rodtoll Added member to retrieve DirectSound object
  15. * 11/01/99 rodtoll Updated to conform to new interface
  16. * 11/12/99 rodtoll Modified abstraction for new waveOut support.
  17. * Now abstracted types look almost like dsound objects
  18. * 12/01/99 rodtoll Bug #121815 - Static in playback/record
  19. * Added implementations of Set/GetMixerQuality
  20. * (For Win2k/Millenium/Systems w/DX7)
  21. * rodtoll Cleanup of class
  22. * 01/27/2000 rodtoll Updated sound classes to accept playback flags,
  23. * buffer structures and DSBUFFERDESC instead of DSBUFFERDESC1
  24. * 02/17/2000 rodtoll Updated so primary buffer is held instead of released immediately
  25. * 04/04/2001 rodtoll WINBUG #343428 - DPVOICE: Voice wizard's playback is very choppy.
  26. *
  27. ***************************************************************************/
  28. #ifndef __DIRECTSOUNDPLAYBACKDEVICE_H
  29. #define __DIRECTSOUNDPLAYBACKDEVICE_H
  30. class CDirectSoundPlaybackDevice;
  31. // CDirectSoundPlaybackDevice
  32. //
  33. // This class is responsible for providing an implementation of the
  34. // CAudioPLaybackDevice class for DirectSound. A single instance
  35. // of this class represents a DirectSound playback device and
  36. // is used to initialize the sound device and act as a class
  37. // factory for CAudioPlaybackBuffers for the DirectSound
  38. // sub-system.
  39. //
  40. class CDirectSoundPlaybackDevice: public CAudioPlaybackDevice
  41. {
  42. public:
  43. CDirectSoundPlaybackDevice( );
  44. virtual ~CDirectSoundPlaybackDevice();
  45. public: // Initialization
  46. HRESULT Initialize( const GUID &guidDevice, HWND hwndOwner, WAVEFORMATEX *primaryFormat, BOOL fPriorityMode );
  47. HRESULT Initialize( LPDIRECTSOUND lpDirectSound, const GUID &guidDevice );
  48. BOOL IsEmulated() { return m_fEmulated; };
  49. HRESULT CreateBuffer( LPDSBUFFERDESC lpdsBufferDesc, DWORD dwFrameSize, CAudioPlaybackBuffer **lpapBuffer );
  50. LPDIRECTSOUND GetPlaybackDevice();
  51. HRESULT GetMixerQuality( DIRECTSOUNDMIXER_SRCQUALITY *psrcQuality );
  52. HRESULT SetMixerQuality( const DIRECTSOUNDMIXER_SRCQUALITY srcQuality );
  53. protected:
  54. HRESULT CheckAndSetEmulated( );
  55. LPDIRECTSOUND m_lpdsDirectSound; // DirectSound object associated w/this object
  56. LPDIRECTSOUNDBUFFER m_lpdsPrimaryBuffer;
  57. HWND m_hwndOwner;
  58. GUID m_guidDevice;
  59. BOOL m_fEmulated;
  60. };
  61. #endif