C++ API Reference#
MOSAIC’s C++ layer owns the UI, hardware I/O (cameras, microphones, trigger
lines), and orchestration — starting/stopping recordings, launching Python
analysis subprocesses, and rendering results. The heavy lifting for machine
learning and signal processing lives in the separate analysis/ Python
project (see Python Analysis API) instead. The bridge between the two is a
small family of result classes — plain C++ structures that parse the
JSON a Python plugin wrote and expose it to Qt for drawing overlays and
charts; see Analysis result types — the Python ↔ C++ bridge below.
This page is a curated, hand-grouped tour of the classes you’re actually likely to want — organized by subsystem, each with a one-sentence description. For the full, alphabetical, auto-generated listing of every documented class, struct, function, and file (useful for exhaustive browsing or following a specific cross-reference), see API Reference.
The app object and process-wide services: startup wiring, profiles, logging.
Session coordination and cross-camera timestamp bookkeeping.
Per-camera capture, encoding, and the GigE Action-Command trigger.
Per-microphone capture and WAV writing.
Intrinsic checkerboard calibration and multi-camera extrinsic (“room”) calibration.
Keyboard/serial/parallel-port trigger sources and post-hoc trigger-to-frame resolution.
Launching Python analysis jobs and the Real-time tab’s live subprocess workers.
The Python ↔ C++ bridge — one loader class per analysis plugin’s JSON output.
Core & Application#
Class |
What it does |
|---|---|
Top-level application object — owns and wires together every subsystem manager (video, audio, trigger, record, analysis) at startup. |
|
Manages the on-disk research-group profile manifest and each profile’s isolated settings directory. See Research-group profiles. |
|
File-based logger with severity levels, backing |
Recording#
Class |
What it does |
|---|---|
Central coordinator for a recording session — creates the session
folder, writes |
|
Resolves every camera’s frame timestamps onto one shared, uniform master-tick grid, for frame-accurate synchronized multi-camera playback. |
|
Writes one CSV row per grabbed frame ( |
|
Lock-free single-producer/single-consumer ring buffer handing frames from the grab thread to the encoder thread. |
Video#
Class |
What it does |
|---|---|
Orchestrates one |
|
Grabs frames from one camera (Basler Pylon SDK, or a test-pattern stub when no camera hardware is enabled) and pushes them into a shared ring buffer. |
|
Consumes frames from a ring buffer and encodes them to an MP4 file
— NVENC, VideoToolbox, or a |
|
|
|
Owns the GigE transport-layer handle used to fire continuous per-frame Action-Command triggers across every armed camera. |
Audio#
Class |
What it does |
|---|---|
Coordinates all |
|
Records one configured microphone to a WAV file and emits live RMS/envelope signals that drive the waveform and VU-meter displays. |
|
Writes PCM audio to a WAV file, fixing up the RIFF/ |
Calibration & Room#
Class |
What it does |
|---|---|
Runs a full single-camera checkerboard intrinsic calibration pipeline using OpenCV. See Camera calibration. |
|
Solves multi-camera extrinsic (“room”) calibration from a shared ChArUco board seen by several cameras at once — see Room (Extrinsic) Calibration for the underlying pose-graph math. |
Trigger & Sync#
Class |
What it does |
|---|---|
Central trigger coordinator — aggregates events from every configured trigger source and logs them. |
|
Writes |
|
Fires a trigger event on a configured key binding, installed as an app-wide event filter. |
|
Receives trigger events from an RS-232/USB-serial port. |
|
Polls a parallel port’s Data register for incoming TTL trigger pulses (e.g. from an EEG amplifier), and can drive the Control register’s INIT pin to mark recording start/stop back to that same equipment. |
|
Resolves every |
Analysis orchestration#
Class |
What it does |
|---|---|
Manages the Python analysis subprocess(es) for every post-recording Analysis-tab plugin (Pose, Face Masking, Diarization, …). |
|
Owns the long-lived live pose/gaze estimation subprocess behind the Real-time tab’s camera tiles. |
|
Owns the long-lived live speech-to-text subprocess behind the Real-time tab’s caption panel. See Live Transcription (Real-time tab) for its Python counterpart. |
|
Buckets a stream of detected/not-detected observations into fixed time windows, for the Real-time tab’s per-camera detection-rate sparkline. |
Analysis result types — the Python ↔ C++ bridge#
Every post-hoc Analysis-tab plugin follows the same shape: a Python script
under analysis/ writes a JSON file, and one of these classes loads it
back into a queryable, typed C++ structure for the Analysis tab to draw an
overlay or chart from. Each row below links to the Python plugin section
that actually produces the file it loads.
Class |
What it does |
Written by |
|---|---|---|
Loads a |
||
Loads an |
||
Loads a session-root |
||
Loads an |
||
Loads a |
||
Loads a session-root |
Full generated API index#
The curated tour above covers the classes you’re most likely to look for. For everything else — every documented function, struct, enum, and header, browsable alphabetically or by file — see the full Doxygen/Breathe/Exhale-generated reference:
Every documented C++ entity in src/ (excluding the Qt/QML UI
layer), auto-generated from source on every build. Regenerates from
scratch each time — never hand-edited.