UX: seconds flash interval UI, hidden active controls, back-to-setup flow
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package com.mindmachine.mvp.session
|
||||
|
||||
import com.mindmachine.mvp.domain.RuntimeState
|
||||
|
||||
fun shouldShowActiveControlsByDefault(runtimeState: RuntimeState): Boolean {
|
||||
return runtimeState != RuntimeState.RUNNING && runtimeState != RuntimeState.COUNTDOWN
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mindmachine.mvp.session
|
||||
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
private const val MILLIS_PER_SECOND = 1000f
|
||||
|
||||
fun flashIntervalMsToSeconds(ms: Int): Float = ms / MILLIS_PER_SECOND
|
||||
|
||||
fun flashIntervalSecondsToMs(seconds: Float): Int = (seconds * MILLIS_PER_SECOND).roundToInt()
|
||||
@@ -6,7 +6,7 @@ import com.mindmachine.mvp.domain.SessionMode
|
||||
object SessionValidator {
|
||||
fun validate(config: SessionConfig, headsetAvailable: Boolean): String? {
|
||||
if (config.durationSec !in 60..(30 * 60)) return "Duration must be 1 to 30 minutes."
|
||||
if (config.flashIntervalMs !in 50..2000) return "Flash interval must be 50 to 2000 ms."
|
||||
if (config.flashIntervalMs !in 50..2000) return "Flash interval must be 0.05 to 2.00 seconds."
|
||||
if (config.carrierFrequencyHz !in 80f..400f) return "Carrier frequency must be 80 to 400 Hz."
|
||||
if (config.binauralDifferenceHz !in 0.5f..20f) return "Binaural difference must be 0.5 to 20 Hz."
|
||||
if (config.mode != SessionMode.VISUAL_ONLY && !headsetAvailable) {
|
||||
|
||||
Reference in New Issue
Block a user