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.

56 lines
1.5 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: dsoundcaptureobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // dSoundCaptureObj.cpp : Implementation of CDirectApp and DLL registration.
  11. // DHF_DS entire file
  12. #include "stdafx.h"
  13. #include "Direct.h"
  14. #include "dSound.h"
  15. #include "dms.h"
  16. #include "dSoundObj.h"
  17. #include "dSoundCaptureObj.h"
  18. #include "dSoundCaptureBufferObj.h"
  19. CONSTRUCTOR(_dxj_DirectSoundCapture, {});
  20. DESTRUCTOR(_dxj_DirectSoundCapture, {});
  21. GETSET_OBJECT(_dxj_DirectSoundCapture);
  22. STDMETHODIMP C_dxj_DirectSoundCaptureObject::createCaptureBuffer(
  23. DSCBUFFERDESC_CDESC *desc,I_dxj_DirectSoundCaptureBuffer **retval)
  24. {
  25. HRESULT hr = S_OK;
  26. IDirectSoundCaptureBuffer *lpBuffer=NULL;
  27. DSCBUFFERDESC realDesc;
  28. ZeroMemory(&realDesc, sizeof(DSCBUFFERDESC));
  29. realDesc.dwSize = sizeof(DSCBUFFERDESC);
  30. realDesc.dwBufferBytes = desc->lBufferBytes;
  31. realDesc.dwReserved = desc->lReserved;
  32. realDesc.lpwfxFormat = (WAVEFORMATEX*)&desc->fxFormat;
  33. hr=m__dxj_DirectSoundCapture->CreateCaptureBuffer(&realDesc,&lpBuffer,NULL);
  34. if FAILED(hr) return hr;
  35. INTERNAL_CREATE(_dxj_DirectSoundCaptureBuffer, lpBuffer, retval);
  36. return hr;
  37. }
  38. STDMETHODIMP C_dxj_DirectSoundCaptureObject::getCaps(DSCCAPS_CDESC *caps){
  39. ((DSCCAPS*)caps)->dwSize=sizeof(DSCCAPS);
  40. return m__dxj_DirectSoundCapture->GetCaps((DSCCAPS*)caps);
  41. }