A level bar on an InstrumentScale - horizontal or vertical, with peak-hold. More...
| Import Statement: | import Clayground.Lab |
The face for a quantity read as "how far along" rather than as a number: a level, a load, a share of capacity, an audio meter. It draws whatever InstrumentScale it is given, so a music VU meter is this face on a log scale with peakHold on - not a component of its own.
Flat by construction: an ink-edged track, a fill in the colour the reading has earned, the severity bands tinted into the track behind it and the held peak as a single line. No bezel, no gloss, no gradient - the same paper and ink as the rest of the lab.
segments turns the continuous fill into the LED ladder a level meter has, which is worth having when the lesson is "which band am I in" rather than "what is the number".
Example usage:
import Clayground.Lab
InstrumentScale {
id: level
value: mixer.amplitude
unit: "dB"; min: -48; max: 6
okUntil: -6; warnUntil: 0
peakHold: true
}
BarFace {
width: panel.body.width
scale: level
label: "MASTER"
segments: 24
}
See also InstrumentScale, ColumnFace, DigitFace, and Gauge.
frameRadius : real |
Corner radius of the frame - 0 when baked into a Texture.
horizontal : bool |
True while the bar runs left to right.
label : string |
Caption above the bar; empty hides the row.
orientation : int |
Qt.Horizontal (default) or Qt.Vertical.
scale : InstrumentScale |
The measurement model this face draws.
segments : int |
Split the fill into this many cells - 0 (default) is a continuous bar.
showFrame : bool |
Draw the panel background and border behind the face.
showPeak : bool |
Mark the held peak. Follows scale.peakHold by default.
showTicks : bool |
Draw the scale's gradations along the bar.
showValue : bool |
Print the reading beside the label.
showZones : bool |
Tint the severity bands into the track.
thickness : real |
Across-the-bar size of the track.