OSDN Git Service

Merge branch 'feature/#36529_SlimDXからSharpDXへの移行' into develop
[dtxmania/dtxmania.git] / SlimDXc_Jun2010(VC++2008) / source / xapo / BaseProcessor.cpp
diff --git a/SlimDXc_Jun2010(VC++2008)/source/xapo/BaseProcessor.cpp b/SlimDXc_Jun2010(VC++2008)/source/xapo/BaseProcessor.cpp
deleted file mode 100644 (file)
index d22e371..0000000
+++ /dev/null
@@ -1,193 +0,0 @@
-/*\r
-* Copyright (c) 2007-2010 SlimDX Group\r
-* \r
-* Permission is hereby granted, free of charge, to any person obtaining a copy\r
-* of this software and associated documentation files (the "Software"), to deal\r
-* in the Software without restriction, including without limitation the rights\r
-* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r
-* copies of the Software, and to permit persons to whom the Software is\r
-* furnished to do so, subject to the following conditions:\r
-* \r
-* The above copyright notice and this permission notice shall be included in\r
-* all copies or substantial portions of the Software.\r
-* \r
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
-* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r
-* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r
-* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r
-* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r
-* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r
-* THE SOFTWARE.\r
-*/\r
-#include "stdafx.h"\r
-\r
-#include "../ComObject.h"\r
-#include "../DataStream.h"\r
-#include "../stack_array.h"\r
-\r
-const IID IID_CXAPOBase = __uuidof(IXAPO);\r
-\r
-#include "BaseProcessor.h"\r
-\r
-using namespace System;\r
-using namespace SlimDX::Multimedia;\r
-\r
-namespace SlimDX\r
-{\r
-namespace XAPO\r
-{\r
-       BaseProcessor::BaseProcessor( SlimDX::XAPO::RegistrationProperties properties )\r
-       {\r
-               XAPO_REGISTRATION_PROPERTIES props = properties.ToUnmanaged();\r
-\r
-               Construct( new XAPOBaseImpl( this, &props ) );\r
-       }\r
-\r
-       int BaseProcessor::CalculateInputFrames( int outputFrameCount )\r
-       {\r
-               return InternalPointer->CalcInputFrames( outputFrameCount );\r
-       }\r
-\r
-       int BaseProcessor::CalculateOutputFrames( int inputFrameCount )\r
-       {\r
-               return InternalPointer->CalcOutputFrames( inputFrameCount );\r
-       }\r
-\r
-       Result BaseProcessor::Initialize( DataStream^ data )\r
-       {\r
-               HRESULT hr = InternalPointer->Initialize( data->PositionPointer, static_cast<UINT32>( data->RemainingLength ) );\r
-               return Result( hr );\r
-       }\r
-\r
-       bool BaseProcessor::IsInputFormatSupported( SlimDX::Multimedia::WaveFormat^ outputFormat, SlimDX::Multimedia::WaveFormat^ requestedInputFormat, [Out] SlimDX::Multimedia::WaveFormat^% supportedInputFormat )\r
-       {\r
-               auto_array<WAVEFORMATEX> output = WaveFormat::ToUnmanaged( outputFormat );\r
-               auto_array<WAVEFORMATEX> input = WaveFormat::ToUnmanaged( requestedInputFormat );\r
-               WAVEFORMATEX *supported = NULL;\r
-\r
-               HRESULT hr = InternalPointer->IsInputFormatSupported( output.get(), input.get(), &supported );\r
-               supportedInputFormat = WaveFormat::FromUnmanaged( *supported );\r
-               return hr == S_OK;\r
-       }\r
-\r
-       bool BaseProcessor::IsOutputFormatSupported( SlimDX::Multimedia::WaveFormat^ inputFormat, SlimDX::Multimedia::WaveFormat^ requestedOutputFormat, [Out] SlimDX::Multimedia::WaveFormat^% supportedOutputFormat )\r
-       {\r
-               auto_array<WAVEFORMATEX> input = WaveFormat::ToUnmanaged( inputFormat );\r
-               auto_array<WAVEFORMATEX> output = WaveFormat::ToUnmanaged( requestedOutputFormat );\r
-               WAVEFORMATEX *supported = NULL;\r
-\r
-               HRESULT hr = InternalPointer->IsOutputFormatSupported( input.get(), output.get(), &supported );\r
-               supportedOutputFormat = WaveFormat::FromUnmanaged( *supported );\r
-               return hr == S_OK;\r
-       }\r
-\r
-       Result BaseProcessor::LockForProcess( array<LockParameter>^ inputParameters, array<LockParameter>^ outputParameters )\r
-       {\r
-               stack_array<XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS> input = stackalloc( XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS, inputParameters->Length );\r
-               stack_array<XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS> output = stackalloc( XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS, outputParameters->Length );\r
-\r
-               for( int i = 0; i < inputParameters->Length; i++ )\r
-               {\r
-                       XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS p;\r
-                       p.pFormat = WaveFormat::ToUnmanaged( inputParameters[i].Format ).release();\r
-                       p.MaxFrameCount = inputParameters[i].MaxFrameCount;\r
-\r
-                       input[i] = p;\r
-               }\r
-\r
-               for( int i = 0; i < outputParameters->Length; i++ )\r
-               {\r
-                       XAPO_LOCKFORPROCESS_BUFFER_PARAMETERS p;\r
-                       p.pFormat = WaveFormat::ToUnmanaged( outputParameters[i].Format ).release();\r
-                       p.MaxFrameCount = outputParameters[i].MaxFrameCount;\r
-\r
-                       output[i] = p;\r
-               }\r
-\r
-               HRESULT hr = InternalPointer->LockForProcess( inputParameters->Length, &input[0], outputParameters->Length, &output[0] );\r
-               return Result( hr );\r
-       }\r
-\r
-       void BaseProcessor::Reset()\r
-       {\r
-               InternalPointer->Reset();\r
-       }\r
-\r
-       void BaseProcessor::UnlockForProcess()\r
-       {\r
-               InternalPointer->UnlockForProcess();\r
-       }\r
-\r
-       void BaseProcessor::ProcessThru( DataStream^ inputBuffer, array<float>^ outputBuffer, int frameCount, int inputChannelCount, int outputChannelCount, bool mixWithDestination )\r
-       {\r
-               pin_ptr<float> pinnedOutput = &outputBuffer[0];\r
-               ImplPointer->ProcessThru( inputBuffer->PositionPointer, pinnedOutput, frameCount, static_cast<WORD>( inputChannelCount ), static_cast<WORD>( outputChannelCount ), mixWithDestination );\r
-       }\r
-\r
-       Result BaseProcessor::ValidateFormatDefault( SlimDX::Multimedia::WaveFormat^ format )\r
-       {\r
-               auto_array<WAVEFORMATEX> wave = WaveFormat::ToUnmanaged( format );\r
-               HRESULT hr = ImplPointer->ValidateFormatDefault( wave.get(), FALSE );\r
-\r
-               return Result( hr );\r
-       }\r
-\r
-       Result BaseProcessor::ValidateFormatPair( SlimDX::Multimedia::WaveFormat^ supportedFormat, SlimDX::Multimedia::WaveFormat^ requestedFormat )\r
-       {\r
-               auto_array<WAVEFORMATEX> supported = WaveFormat::ToUnmanaged( supportedFormat );\r
-               auto_array<WAVEFORMATEX> requested = WaveFormat::ToUnmanaged( requestedFormat );\r
-\r
-               HRESULT hr = ImplPointer->ValidateFormatPair( supported.get(), requested.get(), FALSE );\r
-               return Result( hr );\r
-       }\r
-\r
-       SlimDX::XAPO::RegistrationProperties BaseProcessor::RegistrationProperties::get()\r
-       {\r
-               return SlimDX::XAPO::RegistrationProperties::FromUnmanaged( *ImplPointer->GetRegistrationPropertiesInternal() );\r
-       }\r
-\r
-       bool BaseProcessor::IsLocked::get()\r
-       {\r
-               return ImplPointer->IsLocked() > 0;\r
-       }\r
-\r
-       XAPOBaseImpl::XAPOBaseImpl( BaseProcessor^ processor, XAPO_REGISTRATION_PROPERTIES *pRegProperties )\r
-               : CXAPOBase( pRegProperties )\r
-       {\r
-               m_processor = processor;\r
-       }\r
-\r
-       void XAPOBaseImpl::Process( UINT32 InputProcessParameterCount, const XAPO_PROCESS_BUFFER_PARAMETERS *pInputProcessParameters, UINT32 OutputProcessParameterCount, XAPO_PROCESS_BUFFER_PARAMETERS *pOutputProcessParameters, BOOL IsEnabled )\r
-       {\r
-               try\r
-               {\r
-                       array<BufferParameter>^ input = gcnew array<BufferParameter>( InputProcessParameterCount );\r
-                       for( int i = 0; i < input->Length; i++ )\r
-                       {\r
-                               BufferParameter p;\r
-                               p.Buffer = IntPtr( pInputProcessParameters[i].pBuffer );\r
-                               p.Flags = static_cast<BufferFlags>( pInputProcessParameters[i].BufferFlags );\r
-                               p.ValidFrameCount = pInputProcessParameters[i].ValidFrameCount;\r
-\r
-                               input[i] = p;\r
-                       }\r
-\r
-                       array<BufferParameter>^ output = gcnew array<BufferParameter>( OutputProcessParameterCount );\r
-                       for( int i = 0; i < output->Length; i++ )\r
-                       {\r
-                               BufferParameter p;\r
-                               p.Buffer = IntPtr( pOutputProcessParameters[i].pBuffer );\r
-                               p.Flags = static_cast<BufferFlags>( pOutputProcessParameters[i].BufferFlags );\r
-                               p.ValidFrameCount = pOutputProcessParameters[i].ValidFrameCount;\r
-\r
-                               output[i] = p;\r
-                       }\r
-\r
-                       m_processor->Process( input, output, IsEnabled > 0 );\r
-               }\r
-               catch(...)\r
-               {\r
-               }\r
-       }\r
-}\r
-}
\ No newline at end of file