Class HistoryGraph
- Namespace
- PluginUI
- Assembly
- PluginUI.dll
Rolling graph of a value over time, newest on the right (iPlug2 IVDisplayControl): gain reduction history,
envelope follower, LFO output, CPU load… Values come from Push(float) (UI thread), from a lock-free
PeakValue published by the audio thread (PeakSource), or from a function polled every
frame (ValueSource).
public class HistoryGraph : Control
- Inheritance
-
HistoryGraph
- Inherited Members
Examples
// Audio thread: _grPeak.Push(gainReductionDb); UI:
var history = new HistoryGraph { PeakSource = processor.GainReduction, Minimum = 0, Maximum = 24, FillFromTop = true,
Mode = HistoryGraphMode.Filled, Unit = " dB" };
Constructors
HistoryGraph()
Creates a history graph.
public HistoryGraph()
Properties
Capacity
Number of values kept (and spread across the width).
public int Capacity { get; set; }
Property Value
Count
Number of values currently stored.
[Browsable(false)]
public int Count { get; }
Property Value
Decimals
Decimals of the displayed value.
public int Decimals { get; set; }
Property Value
DefaultSize
Natural size used when no explicit size is given.
protected override Size DefaultSize { get; }
Property Value
FillFromTop
Fills (and draws bars) from the top instead of the bottom, e.g. for gain reduction.
public bool FillFromTop { get; set; }
Property Value
IsFrozen
Stops scrolling (values pushed meanwhile are ignored).
public bool IsFrozen { get; set; }
Property Value
Latest
Most recent value (0 when empty).
[Browsable(false)]
public float Latest { get; }
Property Value
LineThickness
Line thickness.
public float LineThickness { get; set; }
Property Value
Maximum
Value at the top of the graph.
public float Maximum { get; set; }
Property Value
Minimum
Value at the bottom of the graph.
public float Minimum { get; set; }
Property Value
Mode
Drawing mode.
public HistoryGraphMode Mode { get; set; }
Property Value
PeakSource
Lock-free value published by the audio thread; its maximum since the previous frame is plotted.
[Browsable(false)]
public PeakValue? PeakSource { get; set; }
Property Value
SamplesPerSecond
Values plotted per second when polling a source (default 30).
public float SamplesPerSecond { get; set; }
Property Value
ShowCurrentValue
Shows the latest value in the top-right corner.
public bool ShowCurrentValue { get; set; }
Property Value
ShowGrid
Draws horizontal grid lines (4 divisions).
public bool ShowGrid { get; set; }
Property Value
TraceColor
Trace color (null = theme accent).
public Color? TraceColor { get; set; }
Property Value
Unit
Unit appended to the displayed value (e.g. " dB").
public string? Unit { get; set; }
Property Value
ValueSource
Function polled once per sample period (UI thread).
[Browsable(false)]
public Func<float>? ValueSource { get; set; }
Property Value
Methods
Advance(double)
Advances the polling clock (called every frame; public for offscreen hosts and tests).
public void Advance(double elapsedSeconds)
Parameters
elapsedSecondsdoubleTime since the previous call.
Clear()
Removes every value.
public void Clear()
OnAttached()
Called when the element joins a host (subscribe to external events here).
protected override void OnAttached()
OnDetached()
Called when the element leaves its host (unsubscribe here).
protected override void OnDetached()
Push(float)
Appends a value (UI thread).
public void Push(float value)
Parameters
valuefloatThe value (NaN is ignored).
RenderVector(DrawingContext, Rect, VectorStyle)
Vector rendering of the widget area.
protected override void RenderVector(DrawingContext dc, Rect widget, VectorStyle style)
Parameters
dcDrawingContextwidgetRectstyleVectorStyle
Snapshot()
Copy of the stored values, oldest first.
public float[] Snapshot()