Table of Contents

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

count int

Properties

BarSpacing

Gap between bars in DIPs.

public float BarSpacing { get; set; }

Property Value

float

Count

Number of bars (setting it keeps existing local values, drops parameter bindings).

public int Count { get; set; }

Property Value

int

DefaultSize

Natural size used when no explicit size is given.

protected override Size DefaultSize { get; }

Property Value

Size

DefaultValue

Default value of unbound bars (reset).

public double DefaultValue { get; set; }

Property Value

double

HighlightedIndex

Highlighted bar (playhead of a sequencer; −1 = none).

public int HighlightedIndex { get; set; }

Property Value

int

IsBipolar

Bars grow up and down from the middle.

public bool IsBipolar { get; set; }

Property Value

bool

this[int]

Value of a bar (normalized).

public double this[int index] { get; set; }

Parameters

index int

Property Value

double

StepCount

Discrete steps for unbound bars (0 = continuous); a grid is drawn when > 0.

public int StepCount { get; set; }

Property Value

int

ValueText

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

public override string? ValueText { get; }

Property Value

string

Methods

BindParameters(IReadOnlyList<IParameter>)

Binds one parameter per bar (replaces Count).

public void BindParameters(IReadOnlyList<IParameter> parameters)

Parameters

parameters IReadOnlyList<IParameter>

GetParameter(int)

Parameter bound to a bar (null when local).

public IParameter? GetParameter(int index)

Parameters

index int

Returns

IParameter

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

style VectorStyle
label Rect
widget Rect
value Rect

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

OnMouseWheel(MouseEventArgs)

Mouse wheel over the element.

protected override void OnMouseWheel(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

SetValues(ReadOnlySpan<double>)

Sets all values (normalized) at once.

public void SetValues(ReadOnlySpan<double> values)

Parameters

values ReadOnlySpan<double>

Events

GestureEnded

Raised when a drawing gesture ends.

public event Action<MultiSlider>? GestureEnded

Event Type

Action<MultiSlider>

GestureStarted

Raised when a drawing gesture starts.

public event Action<MultiSlider>? GestureStarted

Event Type

Action<MultiSlider>

ValueChanged

Raised when a bar changes (index, normalized value).

public event Action<MultiSlider, int, double>? ValueChanged

Event Type

Action<MultiSlider, int, double>