+++ /dev/null
-#include "stdafx.h"\r
-/*\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 <windows.h>\r
-#include <dsound.h>\r
-\r
-#include "../ComObject.h"\r
-#include "../math/Vector3.h"\r
-\r
-#include "DirectSoundException.h"\r
-\r
-#include "DirectSound.h"\r
-#include "SoundBuffer3D.h"\r
-\r
-using namespace System;\r
-\r
-namespace SlimDX\r
-{\r
-namespace DirectSound\r
-{\r
- SoundBuffer3D::SoundBuffer3D( SoundBuffer^ soundBuffer )\r
- {\r
- IDirectSound3DBuffer8* buffer;\r
-\r
- HRESULT hr = soundBuffer->InternalPointer->QueryInterface( IID_IDirectSound3DBuffer8, reinterpret_cast<void**>( &buffer ) );\r
- if( RECORD_DSOUND( hr ).IsFailure )\r
- throw gcnew DirectSoundException( Result::Last );\r
- \r
- Construct( buffer );\r
- }\r
-\r
- Buffer3DSettings SoundBuffer3D::AllParameters::get()\r
- {\r
- DS3DBUFFER result;\r
- result.dwSize = sizeof( DS3DBUFFER );\r
- HRESULT hr = InternalPointer->GetAllParameters( &result );\r
- RECORD_DSOUND( hr );\r
-\r
- return Buffer3DSettings( result );\r
- }\r
-\r
- void SoundBuffer3D::AllParameters::set( Buffer3DSettings value )\r
- {\r
- DS3DBUFFER result = value.ToUnmanaged();\r
- HRESULT hr = InternalPointer->SetAllParameters( &result, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- int SoundBuffer3D::InsideConeAngle::get()\r
- {\r
- DWORD inside = 0;\r
- HRESULT hr = InternalPointer->GetConeAngles( &inside, NULL );\r
- RECORD_DSOUND( hr );\r
-\r
- return inside; \r
- }\r
-\r
- void SoundBuffer3D::InsideConeAngle::set( int value )\r
- {\r
- HRESULT hr = InternalPointer->SetConeAngles( value, NULL, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- int SoundBuffer3D::OutsideConeAngle::get()\r
- {\r
- DWORD outside = 0;\r
- HRESULT hr = InternalPointer->GetConeAngles( NULL, &outside );\r
- RECORD_DSOUND( hr );\r
-\r
- return outside; \r
- }\r
-\r
- void SoundBuffer3D::OutsideConeAngle::set( int value )\r
- {\r
- HRESULT hr = InternalPointer->SetConeAngles( NULL, value, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- Vector3 SoundBuffer3D::ConeOrientation::get()\r
- {\r
- D3DVECTOR orientation = D3DVECTOR();\r
- HRESULT hr = InternalPointer->GetConeOrientation( &orientation );\r
- RECORD_DSOUND( hr );\r
-\r
- return Vector3( orientation.x, orientation.y, orientation.z );\r
- }\r
-\r
- void SoundBuffer3D::ConeOrientation::set( Vector3 value )\r
- {\r
- HRESULT hr = InternalPointer->SetConeOrientation( value.X, value.Y, value.Z, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- int SoundBuffer3D::ConeOutsideVolume::get()\r
- {\r
- LONG volume = 0;\r
- HRESULT hr = InternalPointer->GetConeOutsideVolume( &volume );\r
- RECORD_DSOUND( hr );\r
-\r
- return static_cast<int>( volume );\r
- }\r
-\r
- void SoundBuffer3D::ConeOutsideVolume::set( int value )\r
- {\r
- HRESULT hr = InternalPointer->SetConeOutsideVolume( static_cast<LONG>( value ), Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- float SoundBuffer3D::MaxDistance::get()\r
- {\r
- float maxDistance = 0.0f;\r
- HRESULT hr = InternalPointer->GetMaxDistance( &maxDistance );\r
- RECORD_DSOUND( hr );\r
-\r
- return maxDistance;\r
- }\r
-\r
- void SoundBuffer3D::MaxDistance::set( float value )\r
- {\r
- HRESULT hr = InternalPointer->SetMaxDistance( value, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- float SoundBuffer3D::MinDistance::get()\r
- {\r
- float minDistance = 0.0f;\r
- HRESULT hr = InternalPointer->GetMinDistance( &minDistance );\r
- RECORD_DSOUND( hr );\r
-\r
- return minDistance;\r
- }\r
-\r
- void SoundBuffer3D::MinDistance::set( float value )\r
- {\r
- HRESULT hr = InternalPointer->SetMinDistance( value, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- Mode3D SoundBuffer3D::Mode::get()\r
- {\r
- DWORD mode = 0;\r
- HRESULT hr = InternalPointer->GetMode( &mode );\r
- RECORD_DSOUND( hr );\r
- \r
- return static_cast<Mode3D>( mode );\r
- }\r
-\r
- void SoundBuffer3D::Mode::set( Mode3D value )\r
- {\r
- HRESULT hr = InternalPointer->SetMode( static_cast<DWORD>( value ), Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- Vector3 SoundBuffer3D::Position::get()\r
- {\r
- D3DVECTOR position = D3DVECTOR();\r
- HRESULT hr = InternalPointer->GetPosition( &position );\r
- RECORD_DSOUND( hr );\r
-\r
- return Vector3( position.x, position.y, position.z );\r
- }\r
-\r
- void SoundBuffer3D::Position::set( Vector3 value )\r
- {\r
- HRESULT hr = InternalPointer->SetPosition( value.X, value.Y, value.Z, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-\r
- Vector3 SoundBuffer3D::Velocity::get()\r
- {\r
- D3DVECTOR velocity = D3DVECTOR();\r
- HRESULT hr = InternalPointer->GetVelocity( &velocity );\r
- RECORD_DSOUND( hr );\r
-\r
- return Vector3( velocity.x, velocity.y, velocity.z );\r
- }\r
-\r
- void SoundBuffer3D::Velocity::set( Vector3 value )\r
- {\r
- HRESULT hr = InternalPointer->SetVelocity( value.X, value.Y, value.Z, Deferred ? DS3D_DEFERRED : DS3D_IMMEDIATE );\r
- RECORD_DSOUND( hr );\r
- }\r
-}\r
-}
\ No newline at end of file