SoundSettingsViewModel

State holder for the Sound Settings screen.

Exposes reactive sound configuration and action methods for the UI layer. The default implementation is DefaultSoundSettingsViewModel.

This can be used standalone (without NavigationControlsState) to build a custom sound settings UI on top of a NavigationSettingsRepository.

See also

Inheritors

Properties

Link copied to clipboard
abstract val camerasEvents: StateFlow<EnumSet<CamerasEvent>>

Set of currently enabled camera-warning events.

Link copied to clipboard
abstract val otherEvents: StateFlow<EnumSet<OtherEvent>>

Set of currently enabled non-camera event warnings.

Link copied to clipboard
abstract val soundMode: StateFlow<SoundMode>

Current master sound mode.

Link copied to clipboard
abstract val soundVolume: StateFlow<Int>

Master output volume in the range 0..100.

Link copied to clipboard
abstract val speedExceeding: StateFlow<Boolean>

Whether the speed-exceeding warning is enabled.

Link copied to clipboard
abstract val speedExceedingThresholdsKph: StateFlow<Int>

Speed-exceeding threshold in km/h (negative values represent driving below the limit).

Functions

Link copied to clipboard
abstract fun onCleared()

Release resources. Must be called when the screen is destroyed.

Link copied to clipboard
abstract fun setCamerasEvent(camerasEvent: CamerasEvent, state: Boolean)

Toggle a single camera event on or off.

Link copied to clipboard
abstract fun setCamerasEvents(camerasEvents: EnumSet<CamerasEvent>)

Replace the full set of enabled camera events.

Link copied to clipboard
abstract fun setOtherEvent(otherEvent: OtherEvent, state: Boolean)

Toggle a single non-camera event on or off.

Link copied to clipboard
abstract fun setOtherEvents(otherEvents: EnumSet<OtherEvent>)

Replace the full set of enabled non-camera events.

Link copied to clipboard
abstract fun setSoundMode(type: SoundMode)

Set the master sound mode. Switching modes also resets the camera/event toggles and speed-exceeding flag to mode defaults.

Link copied to clipboard
abstract fun setSoundVolume(volume: Int)

Set master output volume. The value is coerced into 0..100.

Link copied to clipboard
abstract fun setSpeedExceedingEnabled(enabled: Boolean)

Enable or disable the speed-exceeding warning.

Link copied to clipboard
abstract fun setSpeedExceedingThresholdsKph(thresholdsKph: Int)

Set the speed-exceeding threshold in km/h.