Session State
app.domain.session.session_stateSession view_state management — playback, settings, and frame data.
See Also
PlaybackState— tracks the active frame and playback statusProcessingSettings— stores per-session processing options
Layer: Domain. Context: Defines application concepts independently of UI and infrastructure implementations.
SessionState
dataclass
Manages runtime view_state for a single video processing session.
| ATTRIBUTE | DESCRIPTION |
|---|---|
s_id |
Session identifier for the open video.
TYPE:
|
metadata |
Video file metadata such as size, FPS, and frame count.
TYPE:
|
playback |
Current playback view_state for the session.
TYPE:
|
settings |
User-configurable processing settings.
TYPE:
|
current_frame_data |
Currently displayed RGB frame cache.
TYPE:
|
next_annotation_id |
Counter used for manual detection IDs.
TYPE:
|
Note
This class is a runtime data container rather than a business-logic
object. Bounding detection data lives separately in SessionDataStore,
while playback, settings, and the current frame cache are kept here for
fast UI access. Instances are created when a session opens, updated
during playback and settings changes, and cleared when the session ends.
Layer: Domain. Context: Represents application concepts without UI or infrastructure dependencies.
current_frame_data: RGBFrame | None = field(default=None, repr=False)
class-attribute
instance-attribute
is_at_last_frame: bool
property
Return whether playback is at or beyond the final video frame.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
is_playing_video: bool
property
Return whether video playback is active.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
metadata: VideoMetadata
instance-attribute
next_annotation_id: int = 1
class-attribute
instance-attribute
playback: PlaybackState = field(default_factory=PlaybackState)
class-attribute
instance-attribute
s_id: SessionId
instance-attribute
settings: ProcessingSettings = field(default_factory=ProcessingSettings)
class-attribute
instance-attribute
settings_view_model: SessionSettingsViewModel
property
Return the session settings as a view model.
| RETURNS | DESCRIPTION |
|---|---|
SessionSettingsViewModel
|
View model built from the current processing settings. |
__init__(s_id: SessionId, metadata: VideoMetadata, playback: PlaybackState = PlaybackState(), settings: ProcessingSettings = ProcessingSettings(), current_frame_data: RGBFrame | None = None, next_annotation_id: int = 1) -> None
update_current_frame_data_and_index(idx: int, frame_data: RGBFrame) -> None
Update current frame data and index.
| PARAMETER | DESCRIPTION |
|---|---|
idx
|
Zero-based index of the displayed frame.
TYPE:
|
frame_data
|
RGB pixel data for the displayed frame.
TYPE:
|