public override bool OnGUI(IAudioEffectPlugin plugin) { float blend = !plugin.IsPluginEditableAndEnabled() ? 0.5f : 1f; float centerFreq; plugin.GetFloatParameter(ParamEqGUI.kCenterFreqName, out centerFreq); float bandwidth; plugin.GetFloatParameter(ParamEqGUI.kOctaveRangeName, out bandwidth); float gain; plugin.GetFloatParameter(ParamEqGUI.kFrequencyGainName, out gain); GUILayout.Space(5f); Rect rect = GUILayoutUtility.GetRect(200f, 100f, new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (ParamEqGUI.ParamEqualizerCurveEditor(plugin, rect, ref centerFreq, ref bandwidth, ref gain, blend)) { plugin.SetFloatParameter(ParamEqGUI.kCenterFreqName, centerFreq); plugin.SetFloatParameter(ParamEqGUI.kOctaveRangeName, bandwidth); plugin.SetFloatParameter(ParamEqGUI.kFrequencyGainName, gain); } return(true); }
public override bool OnGUI(IAudioEffectPlugin plugin) { float blend = (!plugin.IsPluginEditableAndEnabled()) ? 0.5f : 1f; float value; plugin.GetFloatParameter(ParamEqGUI.kCenterFreqName, out value); float value2; plugin.GetFloatParameter(ParamEqGUI.kOctaveRangeName, out value2); float value3; plugin.GetFloatParameter(ParamEqGUI.kFrequencyGainName, out value3); GUILayout.Space(5f); Rect rect = GUILayoutUtility.GetRect(200f, 100f, new GUILayoutOption[] { GUILayout.ExpandWidth(true) }); if (ParamEqGUI.ParamEqualizerCurveEditor(plugin, rect, ref value, ref value2, ref value3, blend)) { plugin.SetFloatParameter(ParamEqGUI.kCenterFreqName, value); plugin.SetFloatParameter(ParamEqGUI.kOctaveRangeName, value2); plugin.SetFloatParameter(ParamEqGUI.kFrequencyGainName, value3); } return(true); }