Microsoft DirectX 9.0 SDK Update (October 2004)

EffectsDistortion.Gain Property

Language:

Note: This documentation is preliminary and is subject to change.
How Do I...?

Retrieves and sets the amount of signal change after distortion, in the EffectsDistortion structure.

Definition

Visual Basic .NET Public Property Gain As Single
C# public float Gain { get; set; }
Managed C++ public: __property float get_Gain();
public: __property void set_Gain(float);
JScript .NET public function get Gain() : float
public function set Gain(float);

Property Value

System.Single . Amount of signal change after distortion.

This property is read/write. 

Remarks

Can range from DistortionEffect.GainMin to DistortionEffect.GainMax.

The default value is -18 dB.

How Do I...?

Use Effect Parameters

This C# example demonstrates how to use the parameters of an effect object from a SecondaryBuffer object.

The buffer object in this code snippet is assumed to be the SecondaryBuffer from the code in Add Effects to a SecondaryBuffer Object.

              [C#]
              
//Retrieve the effects object and //the effect param sturctures and edit parameters. EchoEffect echo = (EchoEffect)buffer.GetEffects(0); EffectsEcho echo_params = echo.AllParameters; echo_params.LeftDelay = 250.0f; echo_params.RightDelay = 100.0f; echo_params.Feedback = 85.0f; echo_params.PanDelay = 1; echo_params.WetDryMix = 50.0f; ChorusEffect chorus = (ChorusEffect)buffer.GetEffects(1); EffectsChorus chorus_params = chorus.AllParameters; chorus_params.Delay = 15.0f; chorus_params.Depth = ChorusEffect.DepthMax; chorus_params.Phase = ChorusEffect.PhaseNegative90; chorus_params.Waveform = ChorusEffect.WaveSin; chorus_params.WetDryMix = 50.0f; //Set the new parameters and play the buffer. echo.AllParameters = echo_params; chorus.AllParameters = chorus_params; buffer.Play(0,BufferPlayFlags.Default);


© 2004 Microsoft Corporation. All rights reserved. Terms of use.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center