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.

122 lines
3.2 KiB

  1. #include "stdafx.h"
  2. #include "Direct.h"
  3. #include "dms.h"
  4. #include "dSoundWaveObj.h"
  5. #include "dmdls.h"
  6. extern void *g_dxj_DirectSoundWave;
  7. ///////////////////////////////////////////////////////////////////
  8. // InternalAddRef
  9. ///////////////////////////////////////////////////////////////////
  10. DWORD C_dxj_DirectSoundWaveObject::InternalAddRef(){
  11. DWORD i;
  12. i=CComObjectRoot::InternalAddRef();
  13. DPF2(1,"DirectSoundWave [%d] AddRef %d \n",creationid,i);
  14. return i;
  15. }
  16. ///////////////////////////////////////////////////////////////////
  17. // InternalRelease
  18. ///////////////////////////////////////////////////////////////////
  19. DWORD C_dxj_DirectSoundWaveObject::InternalRelease(){
  20. DWORD i;
  21. i=CComObjectRoot::InternalRelease();
  22. DPF2(1,"DirectSoundWave [%d] Release %d \n",creationid,i);
  23. return i;
  24. }
  25. ///////////////////////////////////////////////////////////////////
  26. // C_dxj_DirectSoundWaveObject
  27. ///////////////////////////////////////////////////////////////////
  28. C_dxj_DirectSoundWaveObject::C_dxj_DirectSoundWaveObject(){
  29. DPF1(1,"Constructor Creation DirectSoundWave Object[%d] \n ",g_creationcount);
  30. m__dxj_DirectSoundWave = NULL;
  31. parent = NULL;
  32. pinterface = NULL;
  33. nextobj = g_dxj_DirectSoundWave;
  34. creationid = ++g_creationcount;
  35. g_dxj_DirectSoundWave = (void *)this;
  36. }
  37. ///////////////////////////////////////////////////////////////////
  38. // ~C_dxj_DirectSoundWaveObject
  39. ///////////////////////////////////////////////////////////////////
  40. C_dxj_DirectSoundWaveObject::~C_dxj_DirectSoundWaveObject()
  41. {
  42. DPF(1,"Entering ~C_dxj_DirectSoundWaveObject destructor \n");
  43. C_dxj_DirectSoundWaveObject *prev=NULL;
  44. for(C_dxj_DirectSoundWaveObject *ptr=(C_dxj_DirectSoundWaveObject*)g_dxj_DirectSoundWave ; ptr; ptr=(C_dxj_DirectSoundWaveObject *)ptr->nextobj)
  45. {
  46. if(ptr == this)
  47. {
  48. if(prev)
  49. prev->nextobj = ptr->nextobj;
  50. else
  51. g_dxj_DirectSoundWave = (void*)ptr->nextobj;
  52. DPF(1,"DirectSoundWave found in g_dxj list now removed\n");
  53. break;
  54. }
  55. prev = ptr;
  56. }
  57. if(m__dxj_DirectSoundWave){
  58. int count = IUNK(m__dxj_DirectSoundWave)->Release();
  59. #ifdef DEBUG
  60. char buffer[256];
  61. wsprintf(buffer,"DirectX IDirectSoundWave Ref count [%d] \n",count);
  62. #endif
  63. if(count==0) m__dxj_DirectSoundWave = NULL;
  64. }
  65. if(parent) IUNK(parent)->Release();
  66. }
  67. HRESULT C_dxj_DirectSoundWaveObject::InternalGetObject(IUnknown **pUnk){
  68. *pUnk=(IUnknown*)m__dxj_DirectSoundWave;
  69. return S_OK;
  70. }
  71. HRESULT C_dxj_DirectSoundWaveObject::InternalSetObject(IUnknown *pUnk){
  72. m__dxj_DirectSoundWave=(LPDIRECTSOUNDWAVE)pUnk;
  73. return S_OK;
  74. }
  75. HRESULT C_dxj_DirectSoundWaveObject::GetWaveArticulation(DMUS_WAVEART_CDESC *Articulation)
  76. {
  77. HRESULT hr;
  78. DMUS_WAVEART *wavart = NULL;
  79. wavart = (DMUS_WAVEART*)malloc(sizeof(DMUS_WAVEART));
  80. ZeroMemory(wavart, sizeof(DMUS_WAVEART));
  81. if (FAILED (hr = m__dxj_DirectSoundWave->GetWaveArticulation(wavart) ) )
  82. return hr;
  83. Articulation = (DMUS_WAVEART_CDESC*)wavart;
  84. return S_OK;
  85. }
  86. HRESULT C_dxj_DirectSoundWaveObject::CreateSource(WAVEFORMATEX_CDESC format, long lFlags, I_dxj_DirectSoundSource **Source)
  87. {
  88. HRESULT hr;
  89. return S_OK;
  90. }
  91. HRESULT C_dxj_DirectSoundWaveObject::GetFormat(WAVEFORMATEX_CDESC *format, long lFlags)
  92. {
  93. HRESULT hr;
  94. return S_OK;
  95. }