Klang C++ 0.7.15
Language Reference (draft)
Loading...
Searching...
No Matches
Dial

Language Guide / Controls and Parameters · Generated API signature

Dial

klang::Dial

Creates a rotary control.

Use a dial for a continuous value such as cutoff in Hz. The optional minimum, maximum, and initial value default to 0, 1, and 0. The initial value uses the same units as the range.

Basic use

Add the control to the model’s Controls collection during setup.

controls = { Dial("Cutoff") };

Optional properties

Set the minimum, maximum, and initial value in the same units. This cutoff dial ranges from 20 to 12,000 Hz and starts at 1,000 Hz.

controls = { Dial("Cutoff", 20, 12000, 1000) };

Optional placement and size

Pass Control::Size as the last argument. Its values are x, y, width, and height. Omit it for automatic layout.

controls = { Dial("Cutoff", 20, 12000, 1000, { 0, 0, 48, 48 }) };