Move stuff in base

This commit is contained in:
2024-08-09 19:54:36 +02:00
parent 8d529b0a45
commit 40ba59e7bd
27 changed files with 1595 additions and 36 deletions

View File

@@ -0,0 +1,37 @@
package nl.astraeus.vst.ui.components
import nl.astraeus.vst.util.formatDouble
import kotlin.math.log10
import kotlin.math.pow
/**
* User: rnentjes
* Date: 26-11-17
* Time: 16:52
*/
class ExpKnobComponent(
value: Double = 1.0,
label: String = "",
minValue: Double = 0.0,
maxValue: Double = 5.0,
step: Double = 0.1,
width: Int = 50,
height: Int = 60,
renderer: (Double) -> String = { nv -> formatDouble(nv, 3) },
callback: (Double) -> Unit = {}
) : BaseKnobComponent(
value,
label,
minValue,
maxValue,
log10(maxValue / (maxValue - step)),
false,
width,
height,
0.005,
{ log10(it) },
{ 10.0.pow(it) },
renderer,
callback
)