Leaked source code of windows server 2003
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.

85 lines
3.2 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1999 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dscrecb.h
  6. * Content: Definition of the CDirectSoundCaptureRecordBuffer class
  7. *
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 11/04/99 rodtoll Created
  12. * 11/22/99 rodtoll Added code to allow specification of wave device ID
  13. * 11/23/99 rodtoll Updated to use waveIn device ID or DSound 7.1 when they are avail
  14. * rodtoll Added SelectMicrophone call to the interface
  15. * 12/01/99 rodtoll Bug #115783 - Will always adjust volume of default device
  16. * Now uses new CMixerLine class for adjusting volumes/selecting mic
  17. * 12/08/99 rodtoll Bug #121054 - DirectX 7.1 support.
  18. * - Added hwndOwner param for capture focus support
  19. * - Added lpfLostFocus param to GetCurrentPosition so upper
  20. * layers can detect lost focus.
  21. * 01/28/2000 rodtoll Bug #130465: Record Mute/Unmute must call YieldFocus() / ClaimFocus()
  22. *
  23. ***************************************************************************/
  24. #ifndef __DIRECTSOUNDCAPTURERECORDBUFFER_H
  25. #define __DIRECTSOUNDCAPTURERECORDBUFFER_H
  26. // Uncomment out to get a lockup of the recording position after LOCKUP_NUM_FRAMES_BEFORE_LOCKUP frames
  27. //#define LOCKUP_SIMULATION 1
  28. #define LOCKUP_NUM_CALLS_BEFORE_LOCKUP 60
  29. // Uncomment to have Stop fail on a reset
  30. //#define LOCKUP_STOPFAIL
  31. // Uncomment to have Start fail on a reset
  32. //#define LOCKUP_STARTFAIL
  33. // CDirectSoundCaptureRecordBuffer
  34. //
  35. // This class provides an implementation of the CAudioRecordBuffer class
  36. // for directsound. In the abstract sense, it represents a buffer of audio
  37. // which can be played to the sound hardware which consists of multiple,
  38. // equal length subbuffers.
  39. //
  40. class CDirectSoundCaptureRecordBuffer: public CAudioRecordBuffer
  41. {
  42. public:
  43. CDirectSoundCaptureRecordBuffer( LPDIRECTSOUNDCAPTUREBUFFER lpdsBuffer, HWND hwndOwner, const GUID &guidDevice, UINT uiWaveDeviceID, const DSCBUFFERDESC * lpdsBufferDesc );
  44. virtual ~CDirectSoundCaptureRecordBuffer();
  45. public:
  46. HRESULT Lock( DWORD dwWriteCursor, DWORD dwWriteBytes, LPVOID *lplpvBuffer1, LPDWORD lpdwSize1, LPVOID *lplpvBuffer2, LPDWORD lpdwSize2, DWORD dwFlags );
  47. HRESULT UnLock( LPVOID lpvBuffer1, DWORD dwSize1, LPVOID lpvBuffer2, DWORD dwSize2 );
  48. HRESULT GetVolume( LPLONG lplVolume );
  49. HRESULT SetVolume( LONG lVolume );
  50. HRESULT GetCurrentPosition( LPDWORD lpdwPosition, LPBOOL lpfLostFocus );
  51. HRESULT Record( BOOL fLooping );
  52. HRESULT Stop();
  53. HRESULT SelectMicrophone( BOOL fSelect );
  54. HRESULT YieldFocus();
  55. HRESULT ClaimFocus();
  56. LPWAVEFORMATEX GetRecordFormat();
  57. DWORD GetStartupLatency();
  58. protected:
  59. BOOL m_fUseCaptureFocus;
  60. HWND m_hwndOwner;
  61. LPDIRECTSOUNDCAPTUREBUFFER m_lpdscBuffer;
  62. LPDIRECTSOUNDCAPTUREBUFFER7_1 m_lpdscBuffer7;
  63. UINT m_uiWaveDeviceID;
  64. LPWAVEFORMATEX m_lpwfxRecordFormat;
  65. GUID m_guidDevice;
  66. CMixerLine m_mixerLine;
  67. #ifdef LOCKUP_SIMULATION
  68. DWORD m_dwNumSinceLastLockup;
  69. DWORD m_dwLastPosition;
  70. #endif
  71. };
  72. #endif