|
| 1 | +# 🧠 Controllers: Description |
| 2 | + |
| 3 | +This directory contains the business logic for the **Description** mode (Global Video Captioning). |
| 4 | + |
| 5 | +Unlike other modes, this controller set must handle **Multi-Clip Actions** (where one logical "Action" ID might consist of multiple video files/camera angles) and legacy **Q&A formatting**. |
| 6 | + |
| 7 | +## 📂 Files |
| 8 | + |
| 9 | +### `desc_navigation_manager.py` |
| 10 | + |
| 11 | +**Playback & Navigation Logic.** |
| 12 | +Manages the Center Panel (Video Player) and the Left Sidebar (Tree View). |
| 13 | + |
| 14 | +* **Key Responsibilities:** |
| 15 | +* **Media Control:** Wraps the shared `MediaController`. It implements the "Stop -> Clear -> Load -> Play" sequence to ensure smooth video transitions without artifacts. |
| 16 | +* **Tree Navigation:** Handles logic for moving between **Actions** (logical items) vs. **Clips** (physical files within an action). |
| 17 | +* **Dynamic Loading:** Resolves video paths based on the project's root directory. |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | +### `desc_annotation_manager.py` |
| 22 | + |
| 23 | +**Editor & Data Logic.** |
| 24 | +Manages the Right Panel (Text Input). |
| 25 | + |
| 26 | +* **Key Responsibilities:** |
| 27 | +* **Q&A Formatting:** If the loaded JSON contains `questions`, it formats them into a readable "Q: ... A: ..." block in the text editor. |
| 28 | +* **Flattening:** Upon saving, it consolidates the text into a single description block (unless strict schema enforcement is added later). |
| 29 | +* **Undo/Redo:** Pushes `CmdType.DESC_EDIT` commands to the global history stack. |
| 30 | +* **State Tracking:** Updates the tree icon (Checkmark/Empty) immediately after a save. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +### `desc_file_manager.py` |
| 35 | + |
| 36 | +**The I/O Handler.** |
| 37 | +Manages the specific JSON schema for Global Captioning tasks. |
| 38 | + |
| 39 | +* **Key Responsibilities:** |
| 40 | +* **Multi-Clip Support:** Can parse JSON where one `id` has multiple entries in the `inputs` list. It ensures all related files are registered in the `ProjectTreeModel`. |
| 41 | +* **Legacy Support:** Handles older JSON formats where captions might be split by questions. |
| 42 | +* **Export:** Reconstructs the `inputs` array during export to ensure the output JSON matches the input structure (preserving `name`, `fps`, etc.). |
0 commit comments