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
4.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1999
  6. //
  7. // File: dsound3dbuffer.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // dSound3DBuffer.cpp : Implementation of CDirectApp and DLL registration.
  11. // DHF_DS entire file
  12. #define DIRECTSOUND_VERSION 0x600
  13. #include "stdafx.h"
  14. #include "Direct.h"
  15. #include "dSound.h"
  16. #include "dms.h"
  17. #include "dSoundObj.h"
  18. #include "dSoundBufferObj.h"
  19. #include "dSound3DBuffer.h"
  20. #include "dSound3DListener.h"
  21. CONSTRUCTOR(_dxj_DirectSound3dBuffer, {});
  22. DESTRUCTOR(_dxj_DirectSound3dBuffer, {});
  23. GETSET_OBJECT(_dxj_DirectSound3dBuffer);
  24. PASS_THROUGH_CAST_2_R(_dxj_DirectSound3dBuffer, getConeAngles, GetConeAngles, long*,(DWORD*), long*,(DWORD*));
  25. PASS_THROUGH_CAST_1_R(_dxj_DirectSound3dBuffer, getConeOrientation, GetConeOrientation, D3dVector*, (_D3DVECTOR*));
  26. PASS_THROUGH1_R(_dxj_DirectSound3dBuffer, getConeOutsideVolume, GetConeOutsideVolume, long*);
  27. PASS_THROUGH1_R(_dxj_DirectSound3dBuffer, getMaxDistance, GetMaxDistance, d3dvalue*);
  28. PASS_THROUGH1_R(_dxj_DirectSound3dBuffer, getMinDistance, GetMinDistance, d3dvalue*);
  29. PASS_THROUGH_CAST_1_R(_dxj_DirectSound3dBuffer, getMode, GetMode, long *,(DWORD*));
  30. PASS_THROUGH_CAST_1_R(_dxj_DirectSound3dBuffer, getPosition, GetPosition, D3dVector*, (_D3DVECTOR*));
  31. PASS_THROUGH_CAST_1_R(_dxj_DirectSound3dBuffer, getVelocity, GetVelocity, D3dVector*, (_D3DVECTOR*));
  32. PASS_THROUGH_CAST_3_R(_dxj_DirectSound3dBuffer, setConeAngles, SetConeAngles, long,(DWORD) ,long,(DWORD) ,long,(DWORD));
  33. PASS_THROUGH_CAST_4_R(_dxj_DirectSound3dBuffer, setConeOrientation, SetConeOrientation, d3dvalue,(float), d3dvalue,(float), d3dvalue,(float), long,(DWORD));
  34. PASS_THROUGH_CAST_2_R(_dxj_DirectSound3dBuffer, setConeOutsideVolume, SetConeOutsideVolume, long, (long),long,(DWORD));
  35. PASS_THROUGH_CAST_2_R(_dxj_DirectSound3dBuffer, setMaxDistance, SetMaxDistance, d3dvalue, (float),long,(DWORD));
  36. PASS_THROUGH_CAST_2_R(_dxj_DirectSound3dBuffer, setMinDistance, SetMinDistance, d3dvalue,(float),long,(DWORD));
  37. PASS_THROUGH_CAST_2_R(_dxj_DirectSound3dBuffer, setMode, SetMode, long,(unsigned long) , long,(DWORD));
  38. PASS_THROUGH_CAST_4_R(_dxj_DirectSound3dBuffer, setPosition, SetPosition, d3dvalue,(float), d3dvalue,(float), d3dvalue,(float), long,(DWORD));
  39. PASS_THROUGH_CAST_4_R(_dxj_DirectSound3dBuffer, setVelocity, SetVelocity, d3dvalue,(float), d3dvalue,(float), d3dvalue,(float), long,(DWORD));
  40. /////////////////////////////////////////////////////////////////////////////
  41. STDMETHODIMP C_dxj_DirectSound3dBufferObject::getAllParameters( DS3dBuffer* lobj )
  42. {
  43. if(!lobj)
  44. return E_POINTER;
  45. lobj->lSize = sizeof(DS3DBUFFER);
  46. return m__dxj_DirectSound3dBuffer->GetAllParameters( (LPDS3DBUFFER)lobj );
  47. }
  48. /////////////////////////////////////////////////////////////////////////////
  49. STDMETHODIMP C_dxj_DirectSound3dBufferObject::setAllParameters( DS3dBuffer *lobj, long apply)
  50. {
  51. if(!lobj)
  52. return E_POINTER;
  53. lobj->lSize = sizeof(DS3DBUFFER);
  54. return m__dxj_DirectSound3dBuffer->SetAllParameters( (LPDS3DBUFFER)lobj, (DWORD)apply );
  55. }
  56. /////////////////////////////////////////////////////////////////////////////
  57. STDMETHODIMP C_dxj_DirectSound3dBufferObject::getDirectSoundBuffer( I_dxj_DirectSoundBuffer **retv)
  58. {
  59. HRESULT hr;
  60. IDirectSoundBuffer *pdsb;
  61. hr=m__dxj_DirectSound3dBuffer->QueryInterface(IID_IDirectSoundBuffer,(void**)&pdsb);
  62. if FAILED(hr) return hr;
  63. INTERNAL_CREATE(_dxj_DirectSoundBuffer,pdsb,retv);
  64. return hr;
  65. }
  66. /////////////////////////////////////////////////////////////////////////////
  67. STDMETHODIMP C_dxj_DirectSound3dBufferObject::getDirectSound3dListener( I_dxj_DirectSound3dListener **retv)
  68. {
  69. HRESULT hr;
  70. IDirectSound3DListener *pdsb;
  71. hr=m__dxj_DirectSound3dBuffer->QueryInterface(IID_IDirectSound3DListener,(void**)&pdsb);
  72. if FAILED(hr) return hr;
  73. INTERNAL_CREATE(_dxj_DirectSound3dListener,pdsb,retv);
  74. return hr;
  75. }