Exemplo n.º 1
0
        public override bool OnGUI(IAudioEffectPlugin plugin)
        {
            float blend = (!plugin.IsPluginEditableAndEnabled()) ? 0.5f : 1f;
            float value;

            plugin.GetFloatParameter(DuckVolumeGUI.kThresholdName, out value);
            float value2;

            plugin.GetFloatParameter(DuckVolumeGUI.kRatioName, out value2);
            float value3;

            plugin.GetFloatParameter(DuckVolumeGUI.kMakeupGainName, out value3);
            float value4;

            plugin.GetFloatParameter(DuckVolumeGUI.kAttackTimeName, out value4);
            float value5;

            plugin.GetFloatParameter(DuckVolumeGUI.kReleaseTimeName, out value5);
            float value6;

            plugin.GetFloatParameter(DuckVolumeGUI.kKneeName, out value6);
            float[] array;
            plugin.GetFloatBuffer("Metering", out array, 2);
            GUILayout.Space(5f);
            Rect rect = GUILayoutUtility.GetRect(200f, 160f, new GUILayoutOption[]
            {
                GUILayout.ExpandWidth(true)
            });

            if (DuckVolumeGUI.CurveDisplay(plugin, rect, ref value, ref value2, ref value3, ref value4, ref value5, ref value6, array[0], array[1], blend))
            {
                plugin.SetFloatParameter(DuckVolumeGUI.kThresholdName, value);
                plugin.SetFloatParameter(DuckVolumeGUI.kRatioName, value2);
                plugin.SetFloatParameter(DuckVolumeGUI.kMakeupGainName, value3);
                plugin.SetFloatParameter(DuckVolumeGUI.kAttackTimeName, value4);
                plugin.SetFloatParameter(DuckVolumeGUI.kReleaseTimeName, value5);
                plugin.SetFloatParameter(DuckVolumeGUI.kKneeName, value6);
            }
            return(true);
        }
Exemplo n.º 2
0
        public override bool OnGUI(IAudioEffectPlugin plugin)
        {
            float blend = !plugin.IsPluginEditableAndEnabled() ? 0.5f : 1f;
            float threshold;

            plugin.GetFloatParameter(DuckVolumeGUI.kThresholdName, out threshold);
            float ratio;

            plugin.GetFloatParameter(DuckVolumeGUI.kRatioName, out ratio);
            float makeupGain;

            plugin.GetFloatParameter(DuckVolumeGUI.kMakeupGainName, out makeupGain);
            float attackTime;

            plugin.GetFloatParameter(DuckVolumeGUI.kAttackTimeName, out attackTime);
            float releaseTime;

            plugin.GetFloatParameter(DuckVolumeGUI.kReleaseTimeName, out releaseTime);
            float knee;

            plugin.GetFloatParameter(DuckVolumeGUI.kKneeName, out knee);
            float[] data;
            plugin.GetFloatBuffer("Metering", out data, 2);
            GUILayout.Space(5f);
            Rect rect = GUILayoutUtility.GetRect(200f, 160f, new GUILayoutOption[1]
            {
                GUILayout.ExpandWidth(true)
            });

            if (DuckVolumeGUI.CurveDisplay(plugin, rect, ref threshold, ref ratio, ref makeupGain, ref attackTime, ref releaseTime, ref knee, data[0], data[1], blend))
            {
                plugin.SetFloatParameter(DuckVolumeGUI.kThresholdName, threshold);
                plugin.SetFloatParameter(DuckVolumeGUI.kRatioName, ratio);
                plugin.SetFloatParameter(DuckVolumeGUI.kMakeupGainName, makeupGain);
                plugin.SetFloatParameter(DuckVolumeGUI.kAttackTimeName, attackTime);
                plugin.SetFloatParameter(DuckVolumeGUI.kReleaseTimeName, releaseTime);
                plugin.SetFloatParameter(DuckVolumeGUI.kKneeName, knee);
            }
            return(true);
        }