Application Adapter
app.application.adapters.application_adapterExplicit adapter wrapping Application to ApplicationInterface.
Important Note
All methods of ApplicationAdapter are intended for use only by application services.
See Also
Application— provides the concrete workflow operationsUIApplicationInterface— defines the contract exposed to callers
Layer: Application. Context: Adapts infrastructure implementations to application contracts.
ApplicationAdapter
Bases: UIApplicationInterface
Explicit adapter that wraps the top-level Application façade and exposes only
the ApplicationInterface contract used by services and managers.
The Application class already satisfies ApplicationInterface via
structural subtyping (Protocol), so this adapter is not required for
runtime correctness. It exists to:
- Provide an explicit, typed boundary between the application façade and the components that need only session access.
- Make session-repository dependencies visible and mockable in tests
without depending on the entire
Applicationinstance.
| PARAMETER | DESCRIPTION |
|---|---|
app
|
Concrete application wrapped to expose the session operations required by application services.
TYPE:
|
active_session: Session | None
property
Retrieve the currently active Session instance, or None if no session is active.
| RETURNS | DESCRIPTION |
|---|---|
Session | None
|
The active session, or |
active_session_id: SessionId | None
property
writable
Retrieve the SessionId of the currently active session, or None if none is active.
| RETURNS | DESCRIPTION |
|---|---|
SessionId | None
|
The active session identifier, or |
all_s_ids: Iterable[SessionId]
property
Iterate over all SessionId instances currently managed by the application.
| RETURNS | DESCRIPTION |
|---|---|
Iterable[SessionId]
|
Iterable view of the managed session identifiers. |
__init__(app: Application) -> None
get_selected_detection_model_name(s_id: SessionId) -> str
Retrieve the name of the currently selected detection model for s_id.
| PARAMETER | DESCRIPTION |
|---|---|
s_id
|
Identifier of the session whose model selection is queried.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
str
|
Name of the selected detection model. |
get_session_by_id(s_id: SessionId) -> Session
initialize_active_session() -> None
Set the first available session as the active session.
open_video_from_path(path: str) -> None
Open a video file and create a new session from path.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Filesystem path of the video to open.
TYPE:
|
set_session_state_is_playing(s_id: SessionId, is_playing: bool) -> None
Set the playback view_state (playing/paused) for the session s_id.
| PARAMETER | DESCRIPTION |
|---|---|
s_id
|
Identifier of the session whose playback state to update.
TYPE:
|
is_playing
|
TYPE:
|
stop_all_playback() -> None
Stop playback for all active sessions.