mirror of
https://github.com/Boof2015/astra-mobile.git
synced 2026-08-16 00:01:59 +02:00
adjust smoothing in now playing spectrum
This commit is contained in:
+4
-4
@@ -21,8 +21,8 @@ class AstraScopeModule : Module() {
|
||||
}
|
||||
|
||||
// Fill `out` with the latest dB spectrum; returns the number of bins written.
|
||||
Function("getSpectrumFrame") { out: Float32Array ->
|
||||
ScopeBridge.nativeFillSpectrum(out.toDirectBuffer(), out.length)
|
||||
Function("getSpectrumFrame") { out: Float32Array, smoothing: Double ->
|
||||
ScopeBridge.nativeFillSpectrum(out.toDirectBuffer(), out.length, smoothing.toFloat())
|
||||
}
|
||||
|
||||
// Fill `out` with render-ready oscilloscope points (~[-1,1]).
|
||||
@@ -36,8 +36,8 @@ class AstraScopeModule : Module() {
|
||||
ScopeBridge.postEqActive = active
|
||||
}
|
||||
|
||||
Function("getSpectrumFramePostEq") { out: Float32Array ->
|
||||
ScopeBridge.nativeFillSpectrumPostEq(out.toDirectBuffer(), out.length)
|
||||
Function("getSpectrumFramePostEq") { out: Float32Array, smoothing: Double ->
|
||||
ScopeBridge.nativeFillSpectrumPostEq(out.toDirectBuffer(), out.length, smoothing.toFloat())
|
||||
}
|
||||
|
||||
// --- M4: EQ params + per-track gain (consumed by the kotlin-audio processors) ---
|
||||
|
||||
@@ -40,7 +40,11 @@ object ScopeBridge {
|
||||
* memory) with the latest dB spectrum, up to `capacityFloats` floats.
|
||||
* Returns the number of bins written. Zero-copy: writes straight into JS memory.
|
||||
*/
|
||||
external fun nativeFillSpectrum(buffer: java.nio.ByteBuffer, capacityFloats: Int): Int
|
||||
external fun nativeFillSpectrum(
|
||||
buffer: java.nio.ByteBuffer,
|
||||
capacityFloats: Int,
|
||||
smoothing: Float
|
||||
): Int
|
||||
|
||||
/**
|
||||
* Render thread. Fill `buffer` (a direct ByteBuffer over the JS Float32Array's
|
||||
@@ -57,5 +61,9 @@ object ScopeBridge {
|
||||
* Render thread. Fill `buffer` with the latest POST-EQ dB spectrum (feeds the
|
||||
* EQ screen's response-curve overlay). Returns bins written. Zero-copy.
|
||||
*/
|
||||
external fun nativeFillSpectrumPostEq(buffer: java.nio.ByteBuffer, capacityFloats: Int): Int
|
||||
external fun nativeFillSpectrumPostEq(
|
||||
buffer: java.nio.ByteBuffer,
|
||||
capacityFloats: Int,
|
||||
smoothing: Float
|
||||
): Int
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user