// Copyright (c) 2010-2014 SharpDX - Alexandre Mutel // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; using SharpDX.Mathematics.Interop; namespace SharpDX.DirectSound { public partial class SoundBuffer3D { /// /// Default cone angle, in degrees. /// public const float DefaultConeAngle = 360f; /// /// Default outside cone volume. Volume levels are expressed as attenuation, in hundredths of a decibel. /// public const int DefaultConeOutsideVolume = 0; /// /// Default maximum distance, in meters. /// public const float DefaultMaxDistance = 1E+09f; /// /// Default minimum distance, in meters. /// public const float DefaultMinDistance = 1f; /// /// Maximum cone angle, in degrees. /// public const float MaxConeAngle = 360f; /// /// Minimum cone angle, in degrees. /// public const float MinConeAngle = 0f; /// /// Initializes a new instance of the class. /// /// /// public SoundBuffer3D(SoundBuffer soundBuffer) { QueryInterfaceFrom(soundBuffer); } /// /// Gets or sets all the parameters of a buffer /// public Buffer3DSettings AllParameters { get { Buffer3DSettings temp; GetAllParameters(out temp); return temp; } set { SetAllParameters(value, Deferred ? 1 : 0); } } /// /// The orientation of the sound projection cone. /// public RawVector3 ConeOrientation { get { RawVector3 temp; GetConeOrientation(out temp); return temp; } set { SetConeOrientation(value.X, value.Y, value.Z, Deferred ? 1 : 0); } } /// /// The volume of the sound outside the outside angle of the sound projection cone. /// public int ConeOutsideVolume { get { int temp; GetConeOutsideVolume(out temp); return temp; } set { SetConeOutsideVolume(value, Deferred ? 1 : 0); } } /// /// Settings are not applied until the application calls the SoundListener3D.CommitDeferredSettings() if true. /// public bool Deferred { get; set; } /// /// The inside angle of the sound projection cone. /// public int InsideConeAngle { get { int insideCondeAngle; int outsideConeAngle; GetConeAngles(out insideCondeAngle, out outsideConeAngle); return insideCondeAngle; } set { SetConeAngles(value, OutsideConeAngle, Deferred ? 1 : 0); } } /// /// The maximum distance, which is the distance from the listener beyond which sounds in this buffer are no longer attenuated. /// public float MaxDistance { get { float temp; GetMaxDistance(out temp); return temp; } set { SetMaxDistance(value, Deferred ? 1 : 0); } } /// /// The minimum distance, which is the distance from the listener at which sounds in this buffer begin to be attenuated. /// public float MinDistance { get { float temp; GetMinDistance(out temp); return temp; } set { SetMinDistance(value, Deferred ? 1 : 0); } } /// /// The operation mode for 3-D sound processing. /// public Mode3D Mode { get { int temp; GetMode(out temp); return (Mode3D)temp; } set { SetMode((int)value, Deferred ? 1 : 0); } } /// /// The outside angle of the sound projection cone. /// public int OutsideConeAngle { get { int insideCondeAngle; int outsideConeAngle; GetConeAngles(out insideCondeAngle, out outsideConeAngle); return outsideConeAngle; } set { SetConeAngles(InsideConeAngle, value, Deferred ? 1 : 0); } } /// /// The position of the sound source. /// public RawVector3 Position { get { RawVector3 temp; GetPosition(out temp); return temp; } set { SetPosition(value.X, value.Y, value.Z, Deferred ? 1 : 0); } } /// /// The velocity of the sound source. /// public RawVector3 Velocity { get { RawVector3 temp; GetVelocity(out temp); return temp; } set { SetVelocity(value.X, value.Y, value.Z, Deferred ? 1 : 0); } } } }