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.

101 lines
2.3 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1998 - 1998
  6. //
  7. // File: dmbandobj.cpp
  8. //
  9. //--------------------------------------------------------------------------
  10. // dmPerformanceObj.cpp
  11. #include "dmusici.h"
  12. #include "dmusicc.h"
  13. #include "dmusicf.h"
  14. #include "stdafx.h"
  15. #include "Direct.h"
  16. #include "dms.h"
  17. #include "dmSegmentObj.h"
  18. #include "dmPerformanceObj.h"
  19. #include "dmBandObj.h"
  20. extern void *g_dxj_DirectMusicSegment;
  21. extern void *g_dxj_DirectMusicBand;
  22. extern HRESULT BSTRtoGUID(LPGUID,BSTR);
  23. CONSTRUCTOR(_dxj_DirectMusicBand, {});
  24. DESTRUCTOR(_dxj_DirectMusicBand, {});
  25. GETSET_OBJECT(_dxj_DirectMusicBand);
  26. typedef IDirectMusicSegment8* LPDIRECTMUSICSEGMENT;
  27. typedef IDirectMusicPerformance8* LPDIRECTMUSICPERFORMANCE;
  28. HRESULT C_dxj_DirectMusicBandObject::createSegment(
  29. /* [retval][out] */ I_dxj_DirectMusicSegment __RPC_FAR *__RPC_FAR *ret)
  30. {
  31. HRESULT hr;
  32. LPDIRECTMUSICSEGMENT pSeg=NULL;
  33. IDirectMusicSegment* pSegment = NULL;
  34. hr=m__dxj_DirectMusicBand->CreateSegment(&pSegment);
  35. if FAILED(hr) return hr;
  36. if (!pSegment) return E_FAIL;
  37. hr = pSegment->QueryInterface(IID_IDirectMusicSegment8, (void**)&pSeg);
  38. pSegment->Release();
  39. if (FAILED (hr) ) return hr;
  40. if (!pSeg) return E_FAIL;
  41. INTERNAL_CREATE_NOADDREF(_dxj_DirectMusicSegment,pSeg,ret);
  42. return hr;
  43. }
  44. HRESULT C_dxj_DirectMusicBandObject::download(
  45. /* [in] */ I_dxj_DirectMusicPerformance __RPC_FAR *downloadpath)
  46. {
  47. HRESULT hr;
  48. IDirectMusicPerformance *lpPerf = NULL;
  49. DO_GETOBJECT_NOTNULL(IDirectMusicPerformance8*,pPer,downloadpath);
  50. hr = pPer->QueryInterface(IID_IDirectMusicPerformance,(void**)&lpPerf);
  51. if (FAILED(hr))
  52. {
  53. pPer->Release();
  54. return hr;
  55. }
  56. pPer->Release();
  57. hr=m__dxj_DirectMusicBand->Download(lpPerf);
  58. return hr;
  59. }
  60. HRESULT C_dxj_DirectMusicBandObject::unload(
  61. /* [in] */ I_dxj_DirectMusicPerformance __RPC_FAR *downloadpath)
  62. {
  63. HRESULT hr;
  64. IDirectMusicPerformance *lpPerf = NULL;
  65. DO_GETOBJECT_NOTNULL(IDirectMusicPerformance8*,pPer,downloadpath);
  66. hr = pPer->QueryInterface(IID_IDirectMusicPerformance,(void**)&lpPerf);
  67. if (FAILED(hr))
  68. {
  69. pPer->Release();
  70. return hr;
  71. }
  72. pPer->Release();
  73. hr=m__dxj_DirectMusicBand->Unload(lpPerf);
  74. return hr;
  75. }