ReactOS  0.4.15-dev-1384-g878186b
minwave.hpp
Go to the documentation of this file.
1 /*
2 Copyright (c) 2006-2008 dogbert <dogber1@gmail.com>
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions
7 are met:
8 1. Redistributions of source code must retain the above copyright
9  notice, this list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright
11  notice, this list of conditions and the following disclaimer in the
12  documentation and/or other materials provided with the distribution.
13 3. The name of the author may not be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 #ifndef _MINWAVE_HPP_
29 #define _MINWAVE_HPP_
30 
31 #define PC_IMPLEMENTATION // for the implementation of IDMAChannel
32 
33 #include "common.hpp"
34 #include "property.h"
35 
37 
39 #ifdef WAVERT
40  public IMiniportWaveRT,
41 #else
42  public IMiniportWaveCyclic,
43 #endif
44  public IMiniportWaveCMI,
45  public CUnknown
46 {
47 private:
48  PCMIADAPTER CMIAdapter; // Adapter common object.
49 #ifdef WAVERT
51 #else
55 #endif
59 
60 
62  bool isStreamRunning[3];
64 
66 
67  NTSTATUS isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3);
69 #ifndef WAVERT
71 #endif
74 public:
78 #ifdef WAVERT
80 #else
82 #endif
83 
84  STDMETHODIMP_(void) ServiceWaveISR(UInt32 streamIndex);
85  STDMETHODIMP_(void) powerUp();
86  STDMETHODIMP_(void) powerDown();
87 
89  friend class CMiniportWaveStreamCMI;
90 };
91 
92 
94 #ifdef WAVERT
95  public IMiniportWaveRTStream,
96 #else
97  public IMiniportWaveCyclicStream,
98 #endif
99  public IDrmAudioStream,
100  public CUnknown
101 {
102 private:
104 #ifdef WAVERT
106  PMDL audioBufferMDL;
107  UInt32 dmaAddress;
108  UInt32 dmaMemorySize;
109 #else
111  PSERVICEGROUP ServiceGroup; // For notification.
112 #endif
113 
114  bool isCaptureStream;// Capture or render.
116  UInt32 channelNumber; // hardware channel number: 0/A or 1/B
117  KSSTATE state; // Stop, pause, run.
118  UInt32 periodSize; // process n frames until the interrupt is fired in frames, NOT in bytes
119  UInt32 dmaSize; // size of the DMA buffer in frames, NOT in bytes
122 
127 
128 public:
132 #ifdef WAVERT
134 #else
136 #endif
137 
139 
140 #ifdef WAVERT
141  NTSTATUS Init(CMiniportWaveCMI* Miniport_, UInt32 streamIndex_, bool isCaptureStream_, PKSDATAFORMAT DataFormat, PPORTWAVERTSTREAM PortStream_);
142 #else
143  NTSTATUS Init(CMiniportWaveCMI* Miniport_, UInt32 streamIndex_, bool isCaptureStream_, PKSDATAFORMAT DataFormat, PDMACHANNEL DMAChannel_, PSERVICEGROUP* OutServiceGroup);
144 #endif
145  friend class CMiniportWaveCMI;
146 };
147 
149 
150 #endif //_MINWAVE_HPP_
IPortWaveRTStream * PPORTWAVERTSTREAM
Definition: portcls.h:1791
STDMETHODIMP_(void) ServiceWaveISR(UInt32 streamIndex)
IServiceGroup * PSERVICEGROUP
Definition: portcls.h:614
UInt32 requestedChannelCount
Definition: minwave.hpp:57
CPPORT Port[4]
Definition: headless.c:34
IPortWaveRT * PPORTWAVERT
Definition: interfaces.hpp:682
IDmaChannel * PDMACHANNEL
Definition: portcls.h:772
#define IMP_IMiniportWaveRTStream
Definition: portcls.h:1813
NTSTATUS isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
Definition: minwave.cpp:380
NTSTATUS processResources(PRESOURCELIST resourceList)
Definition: minwave.cpp:47
DWORD UInt32
Definition: chm_lib.c:104
ICMIAdapter * PCMIADAPTER
Definition: interfaces.hpp:260
NTSTATUS Init(CMiniportWaveCMI *Miniport_, UInt32 streamIndex_, bool isCaptureStream_, PKSDATAFORMAT DataFormat, PDMACHANNEL DMAChannel_, PSERVICEGROUP *OutServiceGroup)
NTSTATUS loadChannelConfigFromRegistry()
Definition: minwave.cpp:232
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS CreateMiniportWaveStreamCMI(CMiniportWaveStreamCMI **MiniportWaveStreamCMI, PUNKNOWN pUnknownOuter, POOL_TYPE PoolType)
NTSTATUS validateFormat(PKSDATAFORMAT format, ULONG PinID, BOOLEAN capture)
Definition: minwave.cpp:413
PCMIADAPTER CMIAdapter
Definition: minwave.hpp:48
#define IMP_IMiniportWaveRT
Definition: portcls.h:1931
_In_opt_ PVOID _In_ ULONG bufferLength
Definition: wdfdriver.h:107
DEFINE_STD_CONSTRUCTOR(CMiniportWaveCMI)
NTSTATUS setupSPDIFPlayback(bool enableSPDIF)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
PDMACHANNEL DMAChannel
Definition: minwave.hpp:110
PDMACHANNEL DMAChannel[3]
Definition: minwave.hpp:53
PSERVICEGROUP ServiceGroup
Definition: minwave.hpp:111
UInt32 notificationInterval
Definition: minwave.hpp:54
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTSTATUS newDMAChannel(PDMACHANNEL *dmaChannel, UInt32 bufferLength)
Definition: minwave.cpp:61
bool isStreamRunning[3]
Definition: minwave.hpp:62
PPORTWAVECYCLIC Port
Definition: minwave.hpp:52
unsigned char BOOLEAN
friend NTSTATUS NTAPI PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest)
NTSTATUS setupAC3Passthru()
DEFINE_STD_CONSTRUCTOR(CMiniportWaveStreamCMI)
CMI8738Info * cm
Definition: minwave.hpp:56
UInt32 requestedChannelMask
Definition: minwave.hpp:58
INT POOL_TYPE
Definition: typedefs.h:78
CMiniportWaveCMI * Miniport
Definition: minwave.hpp:103
Definition: parse.h:22
IResourceList * PRESOURCELIST
Definition: portcls.h:442
KSSTATE
Definition: ks.h:1214
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
unsigned int ULONG
Definition: retypes.h:1
IPortWaveCyclic * PPORTWAVECYCLIC
Definition: portcls.h:1172
NTSTATUS storeChannelConfigToRegistry()
Definition: minwave.cpp:294