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
IsDragging
true while the chip is being dragged.
[Browsable(false)]
public bool IsDragging { get; }
Property Value
Source
The source carried by drags (null = inactive).
[Browsable(false)]
public ModulationSource? Source { get; set; }
Property Value
Methods
OnMouseDown(MouseEventArgs)
Mouse button pressed over the element (or captured).
protected override void OnMouseDown(MouseEventArgs e)
Parameters
OnMouseMove(MouseEventArgs)
Mouse moved over the element (or captured).
protected override void OnMouseMove(MouseEventArgs e)
Parameters
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle
Events
DragCompleted
Raised after a drag ended: true if a control accepted the drop.
public event Action<ModulationSourceButton, bool>? DragCompleted