|
|
|
|
@ -5,18 +5,18 @@ import androidx.lifecycle.ViewModel |
|
|
|
|
class ReplayerModel : ViewModel() { |
|
|
|
|
|
|
|
|
|
enum class Multiplier(val value: Double) { |
|
|
|
|
SLOW(0.75), |
|
|
|
|
BASIC(1.0), |
|
|
|
|
FAST(1.5) |
|
|
|
|
SLOW(1.0), |
|
|
|
|
BASIC(1.5), |
|
|
|
|
FAST(2.0) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var configuration: ReplayerConfiguration? = null |
|
|
|
|
|
|
|
|
|
var isPlaying: Boolean = false |
|
|
|
|
|
|
|
|
|
private val actionSpeed = 1000L |
|
|
|
|
private val actionSpeed = 1500L |
|
|
|
|
|
|
|
|
|
var speedMultiplier: Multiplier = Multiplier.BASIC |
|
|
|
|
var speedMultiplier: Multiplier = Multiplier.SLOW |
|
|
|
|
private set |
|
|
|
|
|
|
|
|
|
fun previousStep() { |
|
|
|
|
@ -28,7 +28,7 @@ class ReplayerModel : ViewModel() { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
val actionDelay: Long |
|
|
|
|
get() { return (speedMultiplier.value * actionSpeed).toLong() } |
|
|
|
|
get() { return (this.actionSpeed / this.speedMultiplier.value).toLong() } |
|
|
|
|
|
|
|
|
|
/*** |
|
|
|
|
* Rotate in cycles the speed |
|
|
|
|
|