Files
lockstep-player/app/src/main/java/at/lockstep/player/util/RunAccelSample.kt

25 lines
856 B
Kotlin
Raw Normal View History

2026-05-24 10:57:09 +02:00
package at.lockstep.player.util
data class RunAccelSample(
/** Nanoseconds since the current song started ([android.hardware.SensorEvent.timestamp] base). */
val timestampNanos: Long,
/** ExoPlayer position in ms when this sample was taken — frozen while paused. */
val positionMs: Long,
val values: FloatArray,
) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is RunAccelSample) return false
return timestampNanos == other.timestampNanos &&
positionMs == other.positionMs &&
values.contentEquals(other.values)
}
override fun hashCode(): Int {
var result = timestampNanos.hashCode()
result = 31 * result + positionMs.hashCode()
result = 31 * result + values.contentHashCode()
return result
}
}