Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions dlclivegui/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,8 @@ def _connect_signals(self) -> None:
self._dlc.initialized.connect(self._on_dlc_initialised)
self.dlc_camera_combo.currentIndexChanged.connect(self._on_dlc_camera_changed)
self.dlc_camera_combo.currentTextChanged.connect(self.dlc_camera_combo.update_shrink_width)
self.allow_processor_ctrl_checkbox.stateChanged.connect(lambda _s: self._update_dlc_controls_enabled())
self.allow_processor_ctrl_checkbox.stateChanged.connect(lambda _s: self._update_processor_status())

# Recording settings
## Session name persistence + preview updates
Expand Down Expand Up @@ -1425,6 +1427,7 @@ def _on_multi_camera_started(self) -> None:
self.statusBar().showMessage(f"Multi-camera preview started: {active_count} camera(s)", 5000)
self._update_inference_buttons()
self._update_camera_controls_enabled()
self._update_dlc_controls_enabled()

def _on_multi_camera_stopped(self) -> None:
"""Handle all cameras stopped event."""
Expand All @@ -1440,6 +1443,7 @@ def _on_multi_camera_stopped(self) -> None:
self.statusBar().showMessage("Multi-camera preview stopped", 3000)
self._update_inference_buttons()
self._update_camera_controls_enabled()
self._update_dlc_controls_enabled()

def _on_multi_camera_error(self, camera_id: str, message: str) -> None:
"""Handle error from a camera in multi-camera mode."""
Expand Down Expand Up @@ -1653,24 +1657,28 @@ def _update_inference_buttons(self) -> None:
def _update_dlc_controls_enabled(self) -> None:
"""Enable/disable DLC settings based on inference state."""
allow_changes = not self._dlc_active
processor_controls = allow_changes and self._processor_control_enabled()

widgets = [
self.model_path_edit,
self.browse_model_button,
self.dlc_camera_combo,
# self.additional_options_edit,
]

processor_widgets = [
self.processor_folder_edit,
self.browse_processor_folder_button,
self.refresh_processors_button,
self.processor_combo,
]

for widget in widgets:
widget.setEnabled(allow_changes)

for widget in processor_widgets:
widget.setEnabled(processor_controls)
widget.setEnabled(allow_changes)

if hasattr(self, "allow_processor_ctrl_checkbox"):
self.allow_processor_ctrl_checkbox.setEnabled(allow_changes)

def _update_camera_controls_enabled(self) -> None:
multi_cam_recording = self._rec_manager.is_active
Expand Down
10 changes: 3 additions & 7 deletions dlclivegui/processors/PLUGIN_SYSTEM.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Processors are Python classes (typically subclasses of `dlclive.Processor`) that

### Useful files

- `dlclivegui/processors/dlc_processor_socket.py` — Example socket-based processor base class + examples
- `dlclivegui/processors/dlc_processor_socket.py` — Example socket-based processor base class
- `dlclivegui/processors/examples.py` — Example processor implementations (e.g., One-Euro filter)
- `dlclivegui/processors/processor_utils.py` — Scanning + instantiation helpers used by the GUI

---
Expand Down Expand Up @@ -204,12 +205,7 @@ The built-in `BaseProcessorSocket` (in `dlc_processor_socket.py`) demonstrates a

```python
from dlclive import Processor

PROCESSOR_REGISTRY = {}

def register_processor(cls):
PROCESSOR_REGISTRY[getattr(cls, "PROCESSOR_ID", cls.__name__)] = cls
return cls
from dlclivegui.processors import register_processor, PROCESSOR_REGISTRY

@register_processor
class MyNewProcessor(Processor):
Expand Down
3 changes: 3 additions & 0 deletions dlclivegui/processors/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .registry import PROCESSOR_REGISTRY, register_processor

__all__ = ["register_processor", "PROCESSOR_REGISTRY"]
Loading
Loading