# Controller

## Usage

    controller.exe [settings_file]
    controller.exe --help

If `settings_file` is omitted, defaults to `settings.txt` in the current directory.

## Overview

The controller is the main management interface. It launches, monitors, and stops all other processes. It provides a tabbed window with three panels.

## Processes Tab

Start and stop individual or all processes:

Button | Action
--- | ---
Start All | Launch capture (x3), motion (x3), and videogen
Stop All | Terminate all running child processes
Start Capture 0/1/2 | Launch a single capture process for the specified feed
Start Motion 0/1/2 | Launch motion detection for the specified feed
Start VideoGen | Launch the video generator
Start Viewer | Launch the live viewer

The process list shows each managed process with its name, PID, state (Running/Stopped/Failed), restart count, and command line.

### Auto-Restart

Processes launched via Start All or the individual buttons are configured with auto-restart. If a process crashes, the controller automatically relaunches it. The restart count column tracks how many times each process has been restarted.

## Feeds Tab

Toggle motion detection on/off for each camera feed. The current state is shown next to each button. This modifies the `feed_motion_on` setting in memory (not saved to file unless you also save settings).

## Settings Tab

A text editor showing the contents of the settings file:

- Load Settings — Re-read the file from disk into the editor
- Save Settings — Write editor contents to disk and reload into memory

See Settings Reference for parameter documentation.

## Help Menu

Use the Help menu or press `F1` to open this documentation in your web browser.

## Closing

Closing the controller window prompts for confirmation, then stops all child processes before exiting.

## See Also

- Capture
- Motion Detection
- Video Generator
- Viewer