2 * Copyright (c) 2007-2010 SlimDX Group
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
5 * of this software and associated documentation files (the "Software"), to deal
\r
6 * in the Software without restriction, including without limitation the rights
\r
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
8 * copies of the Software, and to permit persons to whom the Software is
\r
9 * furnished to do so, subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in
\r
12 * all copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
24 #include "IAudioProcessor.h"
\r
26 extern const IID IID_CXAPOBase;
\r
34 public ref class BaseProcessor abstract : ComObject, IAudioProcessor
\r
36 COMOBJECT_BASE(CXAPOBase);
\r
41 property XAPOBaseImpl *ImplPointer
\r
43 XAPOBaseImpl *get() { return reinterpret_cast<XAPOBaseImpl*>( InternalPointer ); }
\r
47 BaseProcessor( RegistrationProperties properties );
\r
49 property bool IsLocked
\r
54 void ProcessThru( DataStream^ inputBuffer, array<float>^ outputBuffer, int frameCount, int inputChannelCount, int outputChannelCount, bool mixWithDestination );
\r
55 Result ValidateFormatDefault( SlimDX::Multimedia::WaveFormat^ format );
\r
56 Result ValidateFormatPair( SlimDX::Multimedia::WaveFormat^ supportedFormat, SlimDX::Multimedia::WaveFormat^ requestedFormat );
\r
59 virtual int CalculateInputFrames( int outputFrameCount );
\r
60 virtual int CalculateOutputFrames( int inputFrameCount );
\r
61 virtual Result Initialize( DataStream^ data );
\r
62 virtual bool IsInputFormatSupported( SlimDX::Multimedia::WaveFormat^ outputFormat, SlimDX::Multimedia::WaveFormat^ requestedInputFormat, [Out] SlimDX::Multimedia::WaveFormat^% supportedInputFormat );
\r
63 virtual bool IsOutputFormatSupported( SlimDX::Multimedia::WaveFormat^ inputFormat, SlimDX::Multimedia::WaveFormat^ requestedOutputFormat, [Out] SlimDX::Multimedia::WaveFormat^% supportedOutputFormat );
\r
64 virtual Result LockForProcess( array<LockParameter>^ inputParameters, array<LockParameter>^ outputParameters );
\r
65 virtual void Process( array<BufferParameter>^ inputParameters, array<BufferParameter>^ outputParameters, bool isEnabled ) abstract;
\r
66 virtual void Reset();
\r
67 virtual void UnlockForProcess();
\r
69 virtual property RegistrationProperties RegistrationProperties
\r
71 SlimDX::XAPO::RegistrationProperties get();
\r
75 class XAPOBaseImpl : public CXAPOBase
\r
78 gcroot<BaseProcessor^> m_processor;
\r
81 XAPOBaseImpl( BaseProcessor^ processor, XAPO_REGISTRATION_PROPERTIES *pRegProperties );
\r
83 const XAPO_REGISTRATION_PROPERTIES* WINAPI GetRegistrationPropertiesInternal() { return CXAPOBase::GetRegistrationPropertiesInternal(); }
\r
84 BOOL WINAPI IsLocked() { return CXAPOBase::IsLocked(); }
\r
85 void ProcessThru( void *pInputBuffer, FLOAT32 *pOutputBuffer, UINT32 FrameCount, WORD InputChannelCount, WORD OutputChannelCount, BOOL MixWithDestination ) { CXAPOBase::ProcessThru( pInputBuffer, pOutputBuffer, FrameCount, InputChannelCount, OutputChannelCount, MixWithDestination ); }
\r
86 HRESULT ValidateFormatDefault( WAVEFORMATEX *pFormat, BOOL fOverwrite ) { return CXAPOBase::ValidateFormatDefault( pFormat, fOverwrite ); }
\r
87 HRESULT ValidateFormatPair( const WAVEFORMATEX *pSupportedFormat, WAVEFORMATEX *pRequestedFormat, BOOL fOverwrite ) { return CXAPOBase::ValidateFormatPair( pSupportedFormat, pRequestedFormat, fOverwrite ); }
\r
89 void WINAPI Process( UINT32 InputProcessParameterCount, const XAPO_PROCESS_BUFFER_PARAMETERS *pInputProcessParameters, UINT32 OutputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS *pOutputProcessParameters, BOOL IsEnabled );
\r