37 lines
611 B
Kotlin
37 lines
611 B
Kotlin
package nl.astraeus.vst.ui.components
|
|
|
|
import nl.astraeus.vst.util.formatDouble
|
|
|
|
/**
|
|
* User: rnentjes
|
|
* Date: 26-11-17
|
|
* Time: 16:52
|
|
*/
|
|
|
|
class KnobComponent(
|
|
value: Double = 1.0,
|
|
label: String = "",
|
|
minValue: Double = 0.0,
|
|
maxValue: Double = 5.0,
|
|
step: Double = 0.1,
|
|
pixelStep: Double = step / 25.0,
|
|
width: Int = 50,
|
|
height: Int = 60,
|
|
renderer: (Double) -> String = { nv -> formatDouble(nv, 2) },
|
|
callback: (Double) -> Unit = {}
|
|
) : BaseKnobComponent(
|
|
value,
|
|
label,
|
|
minValue,
|
|
maxValue,
|
|
step,
|
|
true,
|
|
width,
|
|
height,
|
|
pixelStep,
|
|
{ it },
|
|
{ it },
|
|
renderer,
|
|
callback
|
|
)
|