Table of Contents

Class EnvelopeEditor

Namespace
PluginUI
Assembly
PluginUI.dll

Graphical ADSR editor: drag the peak (attack), the decay corner (decay + sustain), the sustain plateau (sustain) or the end point (release). Values are normalized (times scaled by the plug-in) and each can be bound to a parameter; double-click a point resets it.

public class EnvelopeEditor : Control
Inheritance
EnvelopeEditor
Inherited Members

Constructors

EnvelopeEditor()

Creates an envelope editor.

public EnvelopeEditor()

Properties

Attack

Attack time (normalized).

public double Attack { get; set; }

Property Value

double

AttackParameter

Parameter bound to the attack time.

public IParameter? AttackParameter { get; set; }

Property Value

IParameter

Curvature

Curve bend of the segments (0 = straight lines, 1 = strongly exponential).

public float Curvature { get; set; }

Property Value

float

Decay

Decay time (normalized).

public double Decay { get; set; }

Property Value

double

DecayParameter

Parameter bound to the decay time.

public IParameter? DecayParameter { get; set; }

Property Value

IParameter

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

FineFactor

Sensitivity multiplier while Shift is held.

public float FineFactor { get; set; }

Property Value

float

this[EnvelopeStage]

Value of a stage (normalized).

public double this[EnvelopeStage stage] { get; set; }

Parameters

stage EnvelopeStage

Property Value

double

Release

Release time (normalized).

public double Release { get; set; }

Property Value

double

ReleaseParameter

Parameter bound to the release time.

public IParameter? ReleaseParameter { get; set; }

Property Value

IParameter

Sustain

Sustain level (normalized).

public double Sustain { get; set; }

Property Value

double

SustainParameter

Parameter bound to the sustain level.

public IParameter? SustainParameter { get; set; }

Property Value

IParameter

ValueText

Text drawn in the value area (null = no value area).

public override string? ValueText { get; }

Property Value

string

Methods

OnAttached()

Called when the element joins a host (subscribe to external events here).

protected override void OnAttached()

OnCaptureLost()

The mouse capture was lost without a button release.

protected override void OnCaptureLost()

OnDetached()

Called when the element leaves its host (unsubscribe here).

protected override void OnDetached()

OnMouseDown(MouseEventArgs)

Mouse button pressed over the element (or captured).

protected override void OnMouseDown(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseLeave()

The mouse left the element.

protected override void OnMouseLeave()

OnMouseMove(MouseEventArgs)

Mouse moved over the element (or captured).

protected override void OnMouseMove(MouseEventArgs e)

Parameters

e MouseEventArgs

OnMouseUp(MouseEventArgs)

Mouse button released.

protected override void OnMouseUp(MouseEventArgs e)

Parameters

e MouseEventArgs

RenderVector(DrawingContext, Rect, VectorStyle)

Vector rendering of the widget area.

protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)

Parameters

dc DrawingContext
widget Rect
style VectorStyle

SetFormatter(EnvelopeStage, Func<double, string>?)

Sets the formatter of a stage's value text.

public void SetFormatter(EnvelopeStage stage, Func<double, string>? formatter)

Parameters

stage EnvelopeStage
formatter Func<double, string>

Events

StageChanged

Raised when a stage changes.

public event Action<EnvelopeEditor, EnvelopeStage, double>? StageChanged

Event Type

Action<EnvelopeEditor, EnvelopeStage, double>