Jni Bridge
JNI bridge object — every method corresponds to a C function in uapmd_jni.cpp. Handles are jlong (opaque C pointer cast to uintptr_t). Callback objects are plain Kotlin lambdas / SAM interfaces.
Functions
cb: (trackIndex: Int, error: String?) -> Unit
Packed seconds, tick, bpm per point.
Packed seconds, tick, numerator, denominator per point.
cb.invoke(success: Boolean, error: String?, importedTrackCount: Int)
cb: (error: String?) -> Unit
cb: (error: String?) -> Unit
cb: (trackIndex: Int, error: String?) -> Unit
cb: (success: Boolean, error: String?) -> Unit
Returns Object[]{ int3{running, processed, total}, String currentBundle }.
cb: (error: String?) -> Unit
Returns long3{numFrames, numChannels, sampleRate} or null
Fills outStrings0..1 = {name, filepath}; returns the 7 numeric clip fields.
cb: (success: Boolean, path: String?, error: String?) -> Unit
progress, renderedSeconds, totalSeconds, renderedFrames, totalFrames, or null when idle.
cb: (instanceId: Int, data: IntArray, sizeInBytes: Int) -> Unit, nullable
Fills out-arrays and returns true on success. outIndex0 = parameter index outStrings3 = {stableId, name, path} outDoubles3 = {defaultVal, minVal, maxVal} outBools3 = {automatable, hidden, discrete} outNamedCount0 = number of named values (not filled here — caller must query separately)
Returns int2{width, height} or null
cb: (error: String?) -> Unit
receiver: (ump: IntArray, timestamp: Long) -> Unit; returns handler ID
Returns int[] of instance IDs
Returns String4: {success("1"/"0"), canceled("1"/"0"), renderedSeconds, error?} progressCb: (progress, renderedSecs, totalSecs, renderedFrames, totalFrames) -> Unit (nullable) cancelCb: () -> Boolean (nullable)
All callback args are nullable Any? with SAM-compatible invoke signatures: slowStartCb: (total: Int) -> Unit bundleStartCb: (path: String?) -> Unit bundleCompleteCb: (path: String?) -> Unit slowCompleteCb: () -> Unit errorCb: (msg: String?) -> Unit cancelCb: () -> Boolean
Returns double5{hasContent, firstSample, lastSample, firstSecs, lastSecs}
cb: (fragmentHandle: Long, error: String?) -> Unit
Returns double12 or null: 0=playhead.samples 1=playhead.beats 2=isPlaying 3=loopEnabled 4=loopStart.samples 5=loopStart.beats 6=loopEnd.samples 7=loopEnd.beats 8=tempo 9=timeNum 10=timeDen 11=sampleRate
Returns the number of clips on this timeline track.
Fills outStrings (size = count*2) with name, filepath per clip. Returns doublecount*7 where each clip occupies 7 doubles: clipId, positionSamples, positionBeats, durationSamples, gain, muted, clipType or null on failure.
cb: (statusOrdinal: Int, error: String?) -> Unit