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.

143 lines
4.4 KiB

  1. /*
  2. Copyright (c) 1996-2000 Microsoft Corporation. All rights reserved.
  3. */
  4. #ifndef _PRIVATE
  5. #define _PRIVATE_
  6. #include "clist.h"
  7. #include "plclock.h"
  8. #define STATIC_CLSID_DDKWDMSynth\
  9. 0x820DC38AL, 0x1F81, 0x11d3, 0xA8, 0x2E, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1
  10. DEFINE_GUIDSTRUCT("820DC38A-1F81-11d3-A82E-0060083316C1", CLSID_DDKWDMSynth);
  11. #define CLSID_DDKWDMSynth DEFINE_GUIDNAMED(CLSID_DDKWDMSynth)
  12. #define STATIC_KSNODETYPE_DMDDKSYNTH\
  13. 0xD2D37597L, 0xA312, 0x434C, 0xA2, 0xDD, 0x2B, 0x4C, 0x32, 0xE6, 0x65, 0x8A
  14. DEFINE_GUIDSTRUCT("D2D37597-A312-434C-A2DD-2B4C32E6658A", KSNODETYPE_DMDDKSYNTH);
  15. #define KSNODETYPE_DMDDKSYNTH DEFINE_GUIDNAMED(KSNODETYPE_DMDDKSYNTH)
  16. #ifdef USE_OBSOLETE_FUNCS
  17. NTSTATUS CreateMiniportDmSynth(OUT PUNKNOWN * Unknown,
  18. IN PUNKNOWN UnknownOuter OPTIONAL,
  19. IN POOL_TYPE PoolType);
  20. #else
  21. NTSTATUS CreateMiniportDmSynth(OUT PUNKNOWN * Unknown,
  22. IN PUNKNOWN UnknownOuter OPTIONAL,
  23. IN POOL_TYPE PoolType,
  24. IN PDEVICE_OBJECT pDeviceObject);
  25. #endif
  26. class CDmSynthStream;
  27. /*****************************************************************************
  28. * class CMiniportDmSynth
  29. *****************************************************************************
  30. * Each miniport instance corresponds to a port instance of type DMus.
  31. * This miniport implements the standard IMP_IMiniportDMus.
  32. */
  33. class CMiniportDmSynth : public IMiniportDMus, public CUnknown
  34. {
  35. friend class CDmSynthStream;
  36. public:
  37. IMP_IMiniportDMus;
  38. // IUnknown
  39. //
  40. DECLARE_STD_UNKNOWN();
  41. DEFINE_STD_CONSTRUCTOR(CMiniportDmSynth);
  42. ~CMiniportDmSynth();
  43. private:
  44. PPORTDMUS m_pPort;
  45. CList m_StreamList;
  46. CRITICAL_SECTION m_CriticalSection;
  47. #ifndef USE_OBSOLETE_FUNCS
  48. PDEVICE_OBJECT m_pDeviceObject;
  49. friend NTSTATUS CreateMiniportDmSynth(OUT PUNKNOWN * Unknown,
  50. IN PUNKNOWN UnknownOuter OPTIONAL,
  51. IN POOL_TYPE PoolType,
  52. IN PDEVICE_OBJECT pDeviceObject);
  53. #endif
  54. };
  55. /*****************************************************************************
  56. * class CDmSynthStream
  57. *****************************************************************************
  58. * The stream implements the standard MXF functions. This stream handles
  59. * DLS and running statistics on a per-stream basis.
  60. */
  61. class CDmSynthStream : public ISynthSinkDMus, public CUnknown, public CListItem
  62. {
  63. friend class CMiniportDmSynth;
  64. public:
  65. IMP_ISynthSinkDMus;
  66. // IUnknown
  67. //
  68. DECLARE_STD_UNKNOWN();
  69. DEFINE_STD_CONSTRUCTOR(CDmSynthStream);
  70. ~CDmSynthStream();
  71. // Class
  72. //
  73. #ifdef USE_OBSOLETE_FUNCS
  74. NTSTATUS Init(CMiniportDmSynth * Miniport);
  75. #else
  76. NTSTATUS Init(CMiniportDmSynth * Miniport, PDEVICE_OBJECT pDeviceObject);
  77. #endif
  78. NTSTATUS InitMidiIn(PAllocatorMXF AllocatorMXF, PMASTERCLOCK MasterClock);
  79. NTSTATUS InitWaveOut(PKSDATAFORMAT DataFormat);
  80. NTSTATUS HandlePropertySupport(PPCPROPERTY_REQUEST pRequest);
  81. NTSTATUS HandlePropertyEffects(PPCPROPERTY_REQUEST pRequest);
  82. NTSTATUS HandlePropertySynth(PPCPROPERTY_REQUEST pRequest);
  83. NTSTATUS HandlePortParams(PPCPROPERTY_REQUEST pRequest);
  84. NTSTATUS HandleRunningStats(PPCPROPERTY_REQUEST pRequest);
  85. NTSTATUS HandlePropertySynthDls(PPCPROPERTY_REQUEST pRequest);
  86. NTSTATUS HandleDownload(PPCPROPERTY_REQUEST pRequest);
  87. NTSTATUS HandleUnload(PPCPROPERTY_REQUEST pRequest);
  88. void PutMessageInternal(void);
  89. private:
  90. CMiniportDmSynth * m_pMiniport;
  91. BOOL m_fWaveOutCreated;
  92. BOOL m_fMidiInCreated;
  93. PAllocatorMXF m_pAllocator;
  94. PMASTERCLOCK m_pMasterClock;
  95. CSynth * m_pSynth;
  96. SYNTH_PORTPARAMS m_PortParams;
  97. KSSTATE m_State;
  98. LONG m_lVolume;
  99. LONG m_lBoost;
  100. CSampleClock m_SampleClock;
  101. LONGLONG m_llStartPosition;
  102. LONGLONG m_llLastPosition;
  103. PDMUS_KERNEL_EVENT m_EventList;
  104. KSPIN_LOCK m_EventListLock;
  105. #ifdef USE_OBSOLETE_FUNCS
  106. WORK_QUEUE_ITEM m_EventListWorkItem;
  107. #else
  108. PIO_WORKITEM m_pEventListWorkItem;
  109. #endif
  110. };
  111. typedef CDmSynthStream *PDMSYNTHSTREAM;
  112. #endif // _PRIVATE_