Table of Contents

Class ModulationSourceButton

Namespace
PluginUI
Assembly
PluginUI.dll

Draggable chip representing a ModulationSource: drag it onto a knob or slider whose AcceptsModulation is true; the target raises ModulationDropped and the application creates the routing (and usually sets ModulationAmount to show it).

public class ModulationSourceButton : Control
Inheritance
ModulationSourceButton
Inherited Members

Examples

var lfo1 = new ModulationSourceButton { Source = new ModulationSource("LFO 1", Color.FromRgb(0xFFB74D), 0) };
cutoffKnob.AcceptsModulation = true;
cutoffKnob.ModulationDropped += (target, source) =>
{
    matrix.Add(source.Id, target.Parameter);
    ((Knob)target).ModulationAmount = 0.25;
};

Constructors

ModulationSourceButton()

Creates a modulation source chip.

public ModulationSourceButton()

Properties

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

IsDragging

true while the chip is being dragged.

[Browsable(false)]
public bool IsDragging { get; }

Property Value

bool

Source

The source carried by drags (null = inactive).

[Browsable(false)]
public ModulationSource? Source { get; set; }

Property Value

ModulationSource

Methods

OnMouseDown(MouseEventArgs)

Mouse button pressed over the element (or captured).

protected override void OnMouseDown(MouseEventArgs e)

Parameters

e MouseEventArgs

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

Events

DragCompleted

Raised after a drag ended: true if a control accepted the drop.

public event Action<ModulationSourceButton, bool>? DragCompleted

Event Type

Action<ModulationSourceButton, bool>