OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / SlimDXc_Jun2010(VC++2008) / source / xapo / IAudioProcessor.h
1 /*\r
2 * Copyright (c) 2007-2010 SlimDX Group\r
3\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
10\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
13\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
20 * THE SOFTWARE.\r
21 */\r
22 #pragma once\r
23 \r
24 #include "../ComObject.h"\r
25 #include "../SlimDXException.h"\r
26 #include "../multimedia/WaveFormat.h"\r
27 \r
28 #include "RegistrationProperties.h"\r
29 #include "LockParameter.h"\r
30 #include "BufferParameter.h"\r
31 #include "IParameterProvider.h"\r
32 \r
33 using System::Runtime::InteropServices::OutAttribute;\r
34 \r
35 namespace SlimDX\r
36 {\r
37         namespace XAPO\r
38         {\r
39                 public interface struct IAudioProcessor : IComObject\r
40                 {\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
50 \r
51                         virtual property RegistrationProperties RegistrationProperties\r
52                         {\r
53                                 SlimDX::XAPO::RegistrationProperties get();\r
54                         }\r
55                 };\r
56 \r
57                 class XAPOShim : public IXAPO, public IXAPOParameters\r
58                 {\r
59                 private:\r
60                         LONG refCount;\r
61                         gcroot<IAudioProcessor^> m_interface;\r
62                         gcroot<IParameterProvider^> m_parameters;\r
63 \r
64                 public:\r
65                         XAPOShim( IAudioProcessor^ wrappedInterface );\r
66 \r
67                         IAudioProcessor^ GetProcessor() { return m_interface; }\r
68 \r
69                 public:\r
70                         // IUnknown\r
71                         HRESULT WINAPI QueryInterface( const IID &iid, LPVOID *ppv );\r
72                         ULONG   WINAPI AddRef();\r
73                         ULONG   WINAPI Release();\r
74 \r
75                         // IXAPO\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
86 \r
87                         // IXAPOParameters\r
88                         void    WINAPI GetParameters( void *pParameters, UINT32 ParameterByteSize );\r
89                         void    WINAPI SetParameters( const void *pParameters, UINT32 ParameterByteSize );\r
90                 };\r
91         }\r
92 }