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 "../ComObject.h"
\r
25 #include "../SlimDXException.h"
\r
26 #include "../multimedia/WaveFormat.h"
\r
28 #include "RegistrationProperties.h"
\r
29 #include "LockParameter.h"
\r
30 #include "BufferParameter.h"
\r
31 #include "IParameterProvider.h"
\r
33 using System::Runtime::InteropServices::OutAttribute;
\r
39 public interface struct IAudioProcessor : IComObject
\r
41 virtual int CalculateInputFrames( int outputFrameCount ) = 0;
\r
42 virtual int CalculateOutputFrames( int inputFrameCount ) = 0;
\r
43 virtual Result Initialize( DataStream^ data ) = 0;
\r
44 virtual bool IsInputFormatSupported( SlimDX::Multimedia::WaveFormat^ outputFormat, SlimDX::Multimedia::WaveFormat^ requestedInputFormat, [Out] SlimDX::Multimedia::WaveFormat^% supportedInputFormat ) = 0;
\r
45 virtual bool IsOutputFormatSupported( SlimDX::Multimedia::WaveFormat^ inputFormat, SlimDX::Multimedia::WaveFormat^ requestedOutputFormat, [Out] SlimDX::Multimedia::WaveFormat^% supportedOutputFormat ) = 0;
\r
46 virtual Result LockForProcess( array<LockParameter>^ inputParameters, array<LockParameter>^ outputParameters ) = 0;
\r
47 virtual void Process( array<BufferParameter>^ inputParameters, array<BufferParameter>^ outputParameters, bool isEnabled ) = 0;
\r
48 virtual void Reset() = 0;
\r
49 virtual void UnlockForProcess() = 0;
\r
51 virtual property RegistrationProperties RegistrationProperties
\r
53 SlimDX::XAPO::RegistrationProperties get();
\r
57 class XAPOShim : public IXAPO, public IXAPOParameters
\r
61 gcroot<IAudioProcessor^> m_interface;
\r
62 gcroot<IParameterProvider^> m_parameters;
\r
65 XAPOShim( IAudioProcessor^ wrappedInterface );
\r
67 IAudioProcessor^ GetProcessor() { return m_interface; }
\r
71 HRESULT WINAPI QueryInterface( const IID &iid, LPVOID *ppv );
\r
72 ULONG WINAPI AddRef();
\r
73 ULONG WINAPI Release();
\r
76 UINT32 WINAPI CalcInputFrames( UINT32 OutputFrameCount );
\r
77 UINT32 WINAPI CalcOutputFrames( UINT32 InputFrameCount );
\r
78 HRESULT WINAPI GetRegistrationProperties( XAPO_REGISTRATION_PROPERTIES **ppRegistrationProperties );
\r
79 HRESULT WINAPI Initialize( const void *pData, UINT32 DataByteSize );
\r
80 HRESULT WINAPI IsInputFormatSupported( const WAVEFORMATEX *pOutputFormat, const WAVEFORMATEX *pRequestedInputFormat, WAVEFORMATEX **ppSupportedInputFormat );
\r
81 HRESULT WINAPI IsOutputFormatSupported( const WAVEFORMATEX *pInputFormat, const WAVEFORMATEX *pRequestedOutputFormat, WAVEFORMATEX **ppSupportedOutputFormat );
\r
82 HRESULT WINAPI LockForProcess( UINT32 InputLockedParameterCount, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *pInputLockedParameters, UINT32 OutputLockedParameterCount, const XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS *pOutputLockedParameters );
\r
83 void WINAPI Process( UINT32 InputProcessParameterCount, const XAPO_PROCESS_BUFFER_PARAMETERS *pInputProcessParameters, UINT32 OutputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS *pOutputProcessParameters, BOOL IsEnabled );
\r
84 void WINAPI Reset();
\r
85 void WINAPI UnlockForProcess();
\r
88 void WINAPI GetParameters( void *pParameters, UINT32 ParameterByteSize );
\r
89 void WINAPI SetParameters( const void *pParameters, UINT32 ParameterByteSize );
\r