Skip to content

Commit 59490a9

Browse files
Create README.md of UI/Description
1 parent a178952 commit 59490a9

1 file changed

Lines changed: 118 additions & 0 deletions

File tree

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# 📝 UI: Description Mode
2+
3+
This directory contains the user interface components specifically designed for the **Description (Global Captioning)** mode.
4+
5+
In this mode, the focus is on providing a holistic text description for video content. The interface is divided into a **Composite Media Player** (Center) and a **Text Event Editor** (Right).
6+
7+
## 📂 Directory Structure
8+
9+
```text
10+
ui/description/
11+
├── event_editor/
12+
│ ├── __init__.py
13+
│ └── editor.py # Right Panel: Text Input & Action Buttons
14+
15+
└── media_player/
16+
├── __init__.py # Center Panel: Composite Widget (Combines Preview + Controls)
17+
├── player_panel.py # Internal: Video Surface, Slider, & Time Label
18+
└── controls.py # Internal: Navigation Toolbar (Play/Pause, Next/Prev)
19+
20+
```
21+
22+
---
23+
24+
## 🧩 Components
25+
26+
### 1. Media Player (Center Panel)
27+
28+
The Center Panel is a **Composite Widget** defined in `media_player/__init__.py`. It orchestrates the video display and the navigation controls into a single layout.
29+
30+
#### A. Main Wrapper (`media_player/__init__.py`)
31+
32+
* **Class:** `DescriptionMediaPlayer`
33+
* **Purpose:** Acts as the main container for the center of the screen.
34+
* **Layout:** A `QVBoxLayout` that stacks:
35+
1. `DescriptionMediaPreview` (The Video & Slider) - *Stretches to fill space*.
36+
2. `DescriptionNavToolbar` (The Buttons) - *Fixed height at bottom*.
37+
38+
39+
* **API:** It exposes crucial UI elements (`player`, `play_btn`, `next_clip`, etc.) so the Controller can easily connect signals without digging into child widgets.
40+
41+
#### B. Visual Preview (`media_player/player_panel.py`)
42+
43+
* **Class:** `DescriptionMediaPreview`
44+
* **Purpose:** Renders the video and handles timeline interaction.
45+
* **Key Features:**
46+
* **Shared Surface:** Uses the common `VideoSurface` for consistent rendering.
47+
* **Infinite Loop:** Sets `QMediaPlayer.Loops.Infinite` to allow repeated viewing while typing.
48+
* **Clickable Slider:** A custom `QSlider` allowing absolute positioning on click.
49+
* **Time Label:** Displays current position vs. total duration.
50+
51+
52+
53+
#### C. Navigation Toolbar (`media_player/controls.py`)
54+
55+
* **Class:** `DescriptionNavToolbar`
56+
* **Purpose:** Provides playback and navigation controls.
57+
* **Buttons:**
58+
* **Action Navigation:** `<< Prev Action` / `Next Action >>` (Navigates logical events).
59+
* **Clip Navigation:** `< Prev Clip` / `Next Clip >` (Navigates physical video files).
60+
* **Playback:** `Play / Pause` toggle.
61+
62+
63+
64+
---
65+
66+
### 2. Event Editor (Right Panel)
67+
68+
Located in `event_editor/editor.py`.
69+
70+
* **Class:** `DescriptionEventEditor`
71+
* **Purpose:** The input interface for the captioning task.
72+
* **Components:**
73+
* **Text Area:** A `QTextEdit` for multi-line description entry.
74+
* **History:** `Undo` and `Redo` buttons (linked to the generic history manager).
75+
* **Actions:**
76+
* **Clear:** Resets the text field.
77+
* **Confirm:** Submits the text as the description for the current clip.
78+
79+
80+
81+
82+
83+
---
84+
85+
## 🎨 Component Composition
86+
87+
The Description UI is assembled hierarchically:
88+
89+
```mermaid
90+
graph TD
91+
subgraph "Center Panel (DescriptionMediaPlayer)"
92+
Container[media_player/__init__.py]
93+
94+
Preview[player_panel.py]
95+
Controls[controls.py]
96+
97+
Container --> Preview
98+
Container --> Controls
99+
100+
subgraph "Preview Components"
101+
Video[VideoSurface]
102+
Slider[ClickableSlider]
103+
end
104+
105+
Preview --> Video
106+
Preview --> Slider
107+
end
108+
109+
subgraph "Right Panel (DescriptionEventEditor)"
110+
Editor[event_editor/editor.py]
111+
Input[QTextEdit]
112+
Confirm[Confirm Button]
113+
114+
Editor --> Input
115+
Editor --> Confirm
116+
end
117+
118+
```

0 commit comments

Comments
 (0)