ReactOS 0.4.15-dev-8109-gd7be748
minwave.hpp
Go to the documentation of this file.
1/*
2Copyright (c) 2006-2008 dogbert <dogber1@gmail.com>
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions
7are met:
81. Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
102. 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.
133. 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
16THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25THIS 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{
47private:
48 PCMIADAPTER CMIAdapter; // Adapter common object.
49#ifdef WAVERT
51#else
55#endif
59
60
64
66
67 NTSTATUS isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3);
69#ifndef WAVERT
71#endif
74public:
78#ifdef WAVERT
80#else
82#endif
83
84 STDMETHODIMP_(void) ServiceWaveISR(UInt32 streamIndex);
85 STDMETHODIMP_(void) powerUp();
86 STDMETHODIMP_(void) powerDown();
87
90};
91
92
94#ifdef WAVERT
95 public IMiniportWaveRTStream,
96#else
97 public IMiniportWaveCyclicStream,
98#endif
99 public IDrmAudioStream,
100 public CUnknown
101{
102private:
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
128public:
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_
unsigned char BOOLEAN
IPortWaveRT * PPORTWAVERT
Definition: interfaces.hpp:681
LONG NTSTATUS
Definition: precomp.h:26
DWORD UInt32
Definition: chm_lib.c:104
UInt32 requestedChannelMask
Definition: minwave.hpp:58
DEFINE_STD_CONSTRUCTOR(CMiniportWaveCMI)
PDMACHANNEL DMAChannel[3]
Definition: minwave.hpp:53
UInt32 requestedChannelCount
Definition: minwave.hpp:57
NTSTATUS validateFormat(PKSDATAFORMAT format, ULONG PinID, BOOLEAN capture)
Definition: minwave.cpp:413
bool isStreamRunning[3]
Definition: minwave.hpp:62
PCMIADAPTER CMIAdapter
Definition: minwave.hpp:48
STDMETHODIMP_(void) powerUp()
NTSTATUS processResources(PRESOURCELIST resourceList)
Definition: minwave.cpp:47
NTSTATUS newDMAChannel(PDMACHANNEL *dmaChannel, UInt32 bufferLength)
Definition: minwave.cpp:61
UInt32 notificationInterval
Definition: minwave.hpp:54
NTSTATUS isFormatAllowed(UInt32 sampleRate, BOOLEAN multiChan, BOOLEAN AC3)
Definition: minwave.cpp:380
STDMETHODIMP_(void) ServiceWaveISR(UInt32 streamIndex)
NTSTATUS loadChannelConfigFromRegistry()
Definition: minwave.cpp:232
PPORTWAVECYCLIC Port
Definition: minwave.hpp:52
friend NTSTATUS NTAPI PropertyHandler_ChannelConfig(PPCPROPERTY_REQUEST PropertyRequest)
Definition: minwave.cpp:847
CMI8738Info * cm
Definition: minwave.hpp:56
STDMETHODIMP_(void) powerDown()
NTSTATUS storeChannelConfigToRegistry()
Definition: minwave.cpp:294
NTSTATUS prepareStream()
Definition: minwave.cpp:924
NTSTATUS setDACChannels()
Definition: minwave.cpp:1005
CMiniportWaveCMI * Miniport
Definition: minwave.hpp:103
NTSTATUS setupAC3Passthru()
Definition: minwave.cpp:1136
PSERVICEGROUP ServiceGroup
Definition: minwave.hpp:111
NTSTATUS setupSPDIFPlayback(bool enableSPDIF)
Definition: minwave.cpp:1069
DEFINE_STD_CONSTRUCTOR(CMiniportWaveStreamCMI)
PDMACHANNEL DMAChannel
Definition: minwave.hpp:110
ICMIAdapter * PCMIADAPTER
Definition: interfaces.hpp:261
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
CPPORT Port[4]
Definition: headless.c:35
KSSTATE
Definition: ks.h:1214
NTSTATUS CreateMiniportWaveStreamCMI(CMiniportWaveStreamCMI **MiniportWaveStreamCMI, PUNKNOWN pUnknownOuter, POOL_TYPE PoolType)
Definition: minwave.cpp:906
IDmaChannel * PDMACHANNEL
Definition: portcls.h:784
IResourceList * PRESOURCELIST
Definition: portcls.h:442
IPortWaveRTStream * PPORTWAVERTSTREAM
Definition: portcls.h:1847
#define IMP_IMiniportWaveRT
Definition: portcls.h:1985
#define IMP_IMiniportWaveRTStream
Definition: portcls.h:1867
IPortWaveCyclic * PPORTWAVECYCLIC
Definition: portcls.h:1184
IServiceGroup * PSERVICEGROUP
Definition: portcls.h:614
Definition: parse.h:23
INT POOL_TYPE
Definition: typedefs.h:78
#define NTAPI
Definition: typedefs.h:36
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_In_opt_ PVOID _In_ ULONG bufferLength
Definition: wdfdriver.h:109