mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-10 22:01:52 +09:00
better scope view
This commit is contained in:
@@ -39,8 +39,8 @@ object SoftLim : TerrarumAudioFilter() {
|
||||
}
|
||||
|
||||
object Scope : TerrarumAudioFilter() {
|
||||
val backbufL = Array(8) { FloatArray(BUFFER_SIZE / 4) }
|
||||
val backbufR = Array(8) { FloatArray(BUFFER_SIZE / 4) }
|
||||
val backbufL = Array(BUFFER_SIZE / 16) { FloatArray(BUFFER_SIZE / 4) }
|
||||
val backbufR = Array(BUFFER_SIZE / 16) { FloatArray(BUFFER_SIZE / 4) }
|
||||
|
||||
private val sqrt2p = 0.7071067811865476
|
||||
|
||||
|
||||
@@ -550,16 +550,7 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
)
|
||||
|
||||
|
||||
private val scopePlotCol = arrayOf(
|
||||
Color(0x2ca3f3_aa),
|
||||
Color(0x2ca3f3_99),
|
||||
Color(0x2ca3f3_88),
|
||||
Color(0x2ca3f3_77),
|
||||
Color(0x2ca3f3_66),
|
||||
Color(0x2ca3f3_55),
|
||||
Color(0x2ca3f3_44),
|
||||
Color(0x2ca3f3_33),
|
||||
)
|
||||
private val scopePlotCol = Color(0x76c9fb_33)
|
||||
|
||||
private fun drawFilterParam(batch: SpriteBatch, x: Int, y: Int, filter: TerrarumAudioFilter, track: TerrarumAudioMixerTrack) {
|
||||
when (filter) {
|
||||
@@ -582,17 +573,24 @@ class BasicDebugInfoWindow : UICanvas() {
|
||||
App.fontSmallNumbers.draw(batch, "Bs:${BUFFER_SIZE/4}", x+3f, y+1f)
|
||||
}
|
||||
is Scope -> {
|
||||
batch.color = scopePlotCol
|
||||
val xxs = filter.backbufR
|
||||
val yys = filter.backbufL
|
||||
// var scopedSamples = 0
|
||||
for (t in xxs.lastIndex downTo 0) {
|
||||
batch.color = scopePlotCol[t]
|
||||
val xs = xxs[t]
|
||||
val ys = yys[t]
|
||||
|
||||
for (i in xs.indices) {
|
||||
for (i in xs.indices.reversed()) {
|
||||
/*val col = COL_METER_BAR.cpy().also {
|
||||
it.a *= 0.999f
|
||||
}
|
||||
batch.color = col*/
|
||||
val px = xs[i] * halfStripW + halfStripW
|
||||
val py = ys[i] * halfStripW + halfStripW
|
||||
Toolkit.fillArea(batch, x + px, y + py, 1f, 1f)
|
||||
|
||||
// scopedSamples++
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user