public override bool OnGUI(IAudioEffectPlugin plugin)
{
float blend = plugin.IsPluginEditableAndEnabled() ? 1.0f : 0.5f;
float threshold, ratio, makeupGain, attackTime, releaseTime, knee;
plugin.GetFloatParameter(kThresholdName, out threshold);
plugin.GetFloatParameter(kRatioName, out ratio);
plugin.GetFloatParameter(kMakeupGainName, out makeupGain);
plugin.GetFloatParameter(kAttackTimeName, out attackTime);
plugin.GetFloatParameter(kReleaseTimeName, out releaseTime);
plugin.GetFloatParameter(kKneeName, out knee);
float[] metering; plugin.GetFloatBuffer("Metering", out metering, 2);
GUILayout.Space(5f);
Rect r = GUILayoutUtility.GetRect(200, 160, GUILayout.ExpandWidth(true));
if (CurveDisplay(plugin, r, ref threshold, ref ratio, ref makeupGain, ref attackTime, ref releaseTime, ref knee, metering[0], metering[1], blend))
{
plugin.SetFloatParameter(kThresholdName, threshold);
plugin.SetFloatParameter(kRatioName, ratio);
plugin.SetFloatParameter(kMakeupGainName, makeupGain);
plugin.SetFloatParameter(kAttackTimeName, attackTime);
plugin.SetFloatParameter(kReleaseTimeName, releaseTime);
plugin.SetFloatParameter(kKneeName, knee);
}
return(true);
}