Auto commit Sun Mar 22 12:01:01 AM CDT 2026

This commit is contained in:
Tretzi
2026-03-22 00:01:01 -05:00
parent 869c98a47c
commit 88723bf214
10 changed files with 226 additions and 56 deletions

View File

@@ -210,6 +210,13 @@ class MainViewModel(
)
}
fun setCurveGranularitySec(seconds: Int) = _ui.update {
it.copy(
timeline = it.timeline.setCurveGranularitySec(seconds),
error = null,
)
}
fun updateTimeline(newState: TimelineEditorState) = _ui.update {
it.copy(
timeline = newState,
@@ -227,21 +234,22 @@ class MainViewModel(
fun updateGuidance(value: Boolean) = viewModelScope.launch { settingsRepository.updateGuidance(value) }
fun updateShowImmersiveProgressBar(value: Boolean) = viewModelScope.launch { settingsRepository.updateShowImmersiveProgressBar(value) }
fun startSession() {
fun startSession(): Boolean {
val state = _ui.value
if (!(state.settings.safetyAcknowledged && state.settings.safetyAcknowledgedVersion >= SAFETY_VERSION)) {
_ui.update { it.copy(error = "You must acknowledge safety before starting sessions.") }
return
return false
}
val headset = headsetMonitor.isStereoHeadsetAvailable()
val validation = SessionValidator.validate(state.config, headset)
if (validation != null) {
_ui.update { it.copy(error = validation) }
return
return false
}
elapsedBeforePauseSec = 0f
runProgram(startElapsedSec = 0f, includeCountdown = true)
return true
}
fun pause(reason: String? = null) {