Class MultiSlider
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Row of bars edited by drawing across them (step sequencer, harmonic levels, wave tables, graphic EQ). Drag paints values with line interpolation so fast strokes never skip bars; double-click resets a bar, Ctrl+drag draws straight lines from the press point. Values are local or bound to a list of parameters.
public class MultiSlider : Control
- Inheritance
-
MultiSlider
- Inherited Members
Constructors
MultiSlider(int)
Creates a multi-slider with count bars.
public MultiSlider(int count = 16)
Parameters
countint
Properties
BarSpacing
Gap between bars in DIPs.
public float BarSpacing { get; set; }
Property Value
Count
Number of bars (setting it keeps existing local values, drops parameter bindings).
public int Count { get; set; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
DefaultValue
Default value of unbound bars (reset).
public double DefaultValue { get; set; }
Property Value
HighlightedIndex
Highlighted bar (playhead of a sequencer; −1 = none).
public int HighlightedIndex { get; set; }
Property Value
IsBipolar
Bars grow up and down from the middle.
public bool IsBipolar { get; set; }
Property Value
this[int]
Value of a bar (normalized).
public double this[int index] { get; set; }
Parameters
indexint
Property Value
StepCount
Discrete steps for unbound bars (0 = continuous); a grid is drawn when > 0.
public int StepCount { get; set; }
Property Value
ValueText
Text drawn in the value area (null = no value area).
public override string? ValueText { get; }
Property Value
Methods
BindParameters(IReadOnlyList<IParameter>)
Binds one parameter per bar (replaces Count).
public void BindParameters(IReadOnlyList<IParameter> parameters)
Parameters
parametersIReadOnlyList<IParameter>
GetParameter(int)
Parameter bound to a bar (null when local).
public IParameter? GetParameter(int index)
Parameters
indexint
Returns
GetValues()
Copies all values (normalized).
public double[] GetValues()
Returns
- double[]
LayoutParts(VectorStyle, out Rect, out Rect, out Rect)
Splits the bounds into label (top), widget and value (bottom) areas according to the style. Override to change the arrangement (e.g. label on the left for sliders).
protected override void LayoutParts(VectorStyle style, out Rect label, out Rect widget, out Rect value)
Parameters
styleVectorStylelabelRectwidgetRectvalueRect
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
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
OnMouseUp(MouseEventArgs)
Mouse button released.
protected override void OnMouseUp(MouseEventArgs e)
Parameters
OnMouseWheel(MouseEventArgs)
Mouse wheel over the element.
protected override void OnMouseWheel(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
SetValues(ReadOnlySpan<double>)
Sets all values (normalized) at once.
public void SetValues(ReadOnlySpan<double> values)
Parameters
valuesReadOnlySpan<double>
Events
GestureEnded
Raised when a drawing gesture ends.
public event Action<MultiSlider>? GestureEnded
Event Type
GestureStarted
Raised when a drawing gesture starts.
public event Action<MultiSlider>? GestureStarted
Event Type
ValueChanged
Raised when a bar changes (index, normalized value).
public event Action<MultiSlider, int, double>? ValueChanged