Auto commit Sun Mar 22 12:01:01 AM CDT 2026
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user