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.

154 lines
5.3 KiB

  1. /********************************************************************************
  2. ** Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** Portions Copyright (c) 1998-1999 Intel Corporation
  5. **
  6. ********************************************************************************/
  7. #ifndef _MINWAVE_H_
  8. #define _MINWAVE_H_
  9. #include "shared.h"
  10. /*****************************************************************************
  11. * Constants
  12. *****************************************************************************
  13. */
  14. const int WAVE_SAMPLERATES_TESTED = 7;
  15. const int MIC_SAMPLERATES_TESTED = 4;
  16. const DWORD dwWaveSampleRates[WAVE_SAMPLERATES_TESTED] =
  17. {48000, 44100, 32000, 22050, 16000, 11025, 8000};
  18. const DWORD dwMicSampleRates[MIC_SAMPLERATES_TESTED] =
  19. {48000, 32000, 16000, 8000};
  20. const int PIN_WAVEOUT_OFFSET = (PIN_WAVEOUT / 2);
  21. const int PIN_WAVEIN_OFFSET = (PIN_WAVEIN / 2);
  22. const int PIN_MICIN_OFFSET = (PIN_MICIN / 2);
  23. /*****************************************************************************
  24. * Forward References
  25. *****************************************************************************
  26. */
  27. class CMiniportWaveICHStream;
  28. extern NTSTATUS CreateMiniportWaveICHStream
  29. (
  30. OUT CMiniportWaveICHStream ** pWaveIchStream,
  31. IN PUNKNOWN pUnknown,
  32. IN POOL_TYPE PoolType
  33. );
  34. /*****************************************************************************
  35. * Classes
  36. *****************************************************************************
  37. */
  38. /*****************************************************************************
  39. * CMiniportWaveICH
  40. *****************************************************************************
  41. * ICH wave PCI miniport. This object is associated with the device and is
  42. * created when the device is started. The class inherits IMiniportWavePci
  43. * so it can expose this interface, CUnknown so it automatically gets
  44. * reference counting and aggregation support, and IPowerNotify for ACPI
  45. * power management notification.
  46. */
  47. class CMiniportWaveICH : public IMiniportWavePci,
  48. public IPowerNotify,
  49. public CUnknown
  50. {
  51. private:
  52. // The stream class accesses a lot of private member variables.
  53. // A better way would be to abstract the access through member
  54. // functions which on the other hand would produce more overhead
  55. // both in CPU time and programming time.
  56. friend class CMiniportWaveICHStream;
  57. //
  58. // CMiniportWaveICH private variables
  59. //
  60. CMiniportWaveICHStream *Streams[PIN_MICIN_OFFSET + 1];
  61. PPORTWAVEPCI Port; // Port driver object.
  62. PADAPTERCOMMON AdapterCommon; // Adapter common object.
  63. PADAPTER_OBJECT AdapterObject;
  64. PINTERRUPTSYNC InterruptSync; // Interrupt Sync.
  65. PDMACHANNEL DmaChannel; // Bus master support.
  66. DEVICE_POWER_STATE m_PowerState; // advanced power control.
  67. DWORD m_dwChannelMask; // Channel config for speaker positions.
  68. WORD m_wChannels; // Number of channels.
  69. /*************************************************************************
  70. * CMiniportWaveICH methods
  71. *************************************************************************
  72. * These are private member functions used internally by the object. See
  73. * MINWAVE.CPP for specific descriptions.
  74. */
  75. //
  76. // Checks and connects the miniport to the resources.
  77. //
  78. NTSTATUS ProcessResources
  79. (
  80. IN PRESOURCELIST ResourceList
  81. );
  82. //
  83. // Tests the data format but not the sample rate.
  84. //
  85. NTSTATUS TestDataFormat
  86. (
  87. IN PKSDATAFORMAT Format,
  88. IN WavePins Pin
  89. );
  90. // Test for standard sample rate support and fill the data range information
  91. // in the structures below.
  92. NTSTATUS BuildDataRangeInformation (void);
  93. public:
  94. /*************************************************************************
  95. * The following two macros are from STDUNK.H. DECLARE_STD_UNKNOWN()
  96. * defines inline IUnknown implementations that use CUnknown's aggregation
  97. * support. NonDelegatingQueryInterface() is declared, but it cannot be
  98. * implemented generically. Its definition appears in MINWAVE.CPP.
  99. * DEFINE_STD_CONSTRUCTOR() defines inline a constructor which accepts
  100. * only the outer unknown, which is used for aggregation. The standard
  101. * create macro (in MINWAVE.CPP) uses this constructor.
  102. */
  103. DECLARE_STD_UNKNOWN ();
  104. DEFINE_STD_CONSTRUCTOR (CMiniportWaveICH);
  105. ~CMiniportWaveICH ();
  106. //
  107. // Include IMiniportWavePci (public/exported) methods
  108. //
  109. IMP_IMiniportWavePci;
  110. //
  111. // IPowerNotify methods
  112. //
  113. IMP_IPowerNotify;
  114. //
  115. // This static functions is the interrupt service routine which is
  116. // not stream related, but services all streams at once.
  117. //
  118. static NTSTATUS InterruptServiceRoutine
  119. (
  120. IN PINTERRUPTSYNC InterruptSync,
  121. IN PVOID StaticContext
  122. );
  123. //
  124. // This is the property handler for KSPROPERTY_AUDIO_CHANNEL_CONFIG of the
  125. // DAC node.
  126. //
  127. static NTSTATUS PropertyChannelConfig
  128. (
  129. IN PPCPROPERTY_REQUEST PropertyRequest
  130. );
  131. };
  132. #endif // _MINWAVE_H_