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.

182 lines
7.1 KiB

  1. /*****************************************************************************
  2. * minwave.h - SB16 wave miniport private definitions
  3. *****************************************************************************
  4. * Copyright (c) 1997-2000 Microsoft Corporation. All Rights Reserved.
  5. */
  6. #ifndef _SB16WAVE_PRIVATE_H_
  7. #define _SB16WAVE_PRIVATE_H_
  8. #if OVERRIDE_DMA_CHANNEL
  9. #define PC_IMPLEMENTATION
  10. #endif // OVERRIDE_DMA_CHANNEL
  11. #include "common.h"
  12. /*****************************************************************************
  13. * Classes
  14. */
  15. /*****************************************************************************
  16. * CMiniportWaveCyclicSB16
  17. *****************************************************************************
  18. * SB16 wave miniport. This object is associated with the device and is
  19. * created when the device is started. The class inherits IMiniportWaveCyclic
  20. * so it can expose this interface and CUnknown so it automatically gets
  21. * reference counting and aggregation support.
  22. */
  23. class CMiniportWaveCyclicSB16
  24. : public IMiniportWaveCyclic,
  25. public IWaveMiniportSB16,
  26. public CUnknown
  27. {
  28. private:
  29. PADAPTERCOMMON AdapterCommon; // Adapter common object.
  30. PPORTWAVECYCLIC Port; // Callback interface.
  31. ULONG NotificationInterval; // In milliseconds.
  32. ULONG SamplingFrequency; // Frames per second.
  33. BOOLEAN AllocatedCapture; // Capture in use.
  34. BOOLEAN AllocatedRender; // Render in use.
  35. BOOLEAN Allocated8Bit; // 8-bit DMA in use.
  36. BOOLEAN Allocated16Bit; // 16-bit DMA in use.
  37. PDMACHANNELSLAVE DmaChannel8; // Abstracted channel.
  38. PDMACHANNELSLAVE DmaChannel16; // Abstracted channel.
  39. PSERVICEGROUP ServiceGroup; // For notification.
  40. KMUTEX SampleRateSync; // Sync for sample rate changes.
  41. /*************************************************************************
  42. * CMiniportWaveCyclicSB16 methods
  43. *
  44. * These are private member functions used internally by the object. See
  45. * MINIPORT.CPP for specific descriptions.
  46. */
  47. BOOLEAN ConfigureDevice
  48. (
  49. IN ULONG Interrupt,
  50. IN ULONG DMA8Bit,
  51. IN ULONG DMA16Bit
  52. );
  53. NTSTATUS ProcessResources
  54. (
  55. IN PRESOURCELIST ResourceList
  56. );
  57. NTSTATUS ValidateFormat
  58. (
  59. IN PKSDATAFORMAT Format
  60. );
  61. public:
  62. /*************************************************************************
  63. * The following two macros are from STDUNK.H. DECLARE_STD_UNKNOWN()
  64. * defines inline IUnknown implementations that use CUnknown's aggregation
  65. * support. NonDelegatingQueryInterface() is declared, but it cannot be
  66. * implemented generically. Its definition appears in MINIPORT.CPP.
  67. * DEFINE_STD_CONSTRUCTOR() defines inline a constructor which accepts
  68. * only the outer unknown, which is used for aggregation. The standard
  69. * create macro (in MINIPORT.CPP) uses this constructor.
  70. */
  71. DECLARE_STD_UNKNOWN();
  72. DEFINE_STD_CONSTRUCTOR(CMiniportWaveCyclicSB16);
  73. ~CMiniportWaveCyclicSB16();
  74. /*************************************************************************
  75. * This macro is from PORTCLS.H. It lists all the interface's functions.
  76. */
  77. IMP_IMiniportWaveCyclic;
  78. /*************************************************************************
  79. * IWaveMiniportSB16 methods
  80. */
  81. STDMETHODIMP_(void) RestoreSampleRate (void);
  82. STDMETHODIMP_(void) ServiceWaveISR (void);
  83. /*************************************************************************
  84. * Friends
  85. *
  86. * The miniport stream class is a friend because it needs to access the
  87. * private member variables of this class.
  88. */
  89. friend class CMiniportWaveCyclicStreamSB16;
  90. };
  91. /*****************************************************************************
  92. * CMiniportWaveCyclicStreamSB16
  93. *****************************************************************************
  94. * SB16 wave miniport stream. This object is associated with a streaming pin
  95. * and is created when a pin is created on the filter. The class inherits
  96. * IMiniportWaveCyclicStream so it can expose this interface and CUnknown so
  97. * it automatically gets reference counting and aggregation support.
  98. */
  99. class CMiniportWaveCyclicStreamSB16
  100. : public IMiniportWaveCyclicStream,
  101. public IDrmAudioStream,
  102. #if OVERRIDE_DMA_CHANNEL
  103. public IDmaChannel,
  104. #endif // OVERRIDE_DMA_CHANNEL
  105. public CUnknown
  106. {
  107. private:
  108. CMiniportWaveCyclicSB16 * Miniport; // Miniport that created us.
  109. ULONG Channel; // Index into channel list.
  110. BOOLEAN Capture; // Capture or render.
  111. BOOLEAN Format16Bit; // 16- or 8-bit samples.
  112. BOOLEAN FormatStereo; // Two or one channel.
  113. KSSTATE State; // Stop, pause, run.
  114. PDMACHANNELSLAVE DmaChannel; // DMA channel to use.
  115. BOOLEAN RestoreInputMixer; // Restore input mixer.
  116. UCHAR InputMixerLeft; // Cache for left input mixer.
  117. public:
  118. /*************************************************************************
  119. * The following two macros are from STDUNK.H. DECLARE_STD_UNKNOWN()
  120. * defines inline IUnknown implementations that use CUnknown's aggregation
  121. * support. NonDelegatingQueryInterface() is declared, but it cannot be
  122. * implemented generically. Its definition appears in MINIPORT.CPP.
  123. * DEFINE_STD_CONSTRUCTOR() defines inline a constructor which accepts
  124. * only the outer unknown, which is used for aggregation. The standard
  125. * create macro (in MINIPORT.CPP) uses this constructor.
  126. */
  127. DECLARE_STD_UNKNOWN();
  128. DEFINE_STD_CONSTRUCTOR(CMiniportWaveCyclicStreamSB16);
  129. ~CMiniportWaveCyclicStreamSB16();
  130. NTSTATUS
  131. Init
  132. (
  133. IN CMiniportWaveCyclicSB16 * Miniport,
  134. IN ULONG Channel,
  135. IN BOOLEAN Capture,
  136. IN PKSDATAFORMAT DataFormat,
  137. OUT PDMACHANNELSLAVE DmaChannel
  138. );
  139. /*************************************************************************
  140. * Include IMiniportWaveCyclicStream public/exported methods (portcls.h)
  141. */
  142. IMP_IMiniportWaveCyclicStream;
  143. /*************************************************************************
  144. * Include IDrmAudioStream public/exported methods (drmk.h)
  145. *************************************************************************
  146. */
  147. IMP_IDrmAudioStream;
  148. #if OVERRIDE_DMA_CHANNEL
  149. /*************************************************************************
  150. * Include IDmaChannel public/exported methods (portcls.h)
  151. *************************************************************************
  152. */
  153. IMP_IDmaChannel;
  154. #endif // OVERRIDE_DMA_CHANNEL
  155. };
  156. #endif