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.

🧭 Core & Application

The app object and process-wide services: startup wiring, profiles, logging.

Core & Application
🎬 Recording

Session coordination and cross-camera timestamp bookkeeping.

Recording
📹 Video

Per-camera capture, encoding, and the GigE Action-Command trigger.

Video
🎙 Audio

Per-microphone capture and WAV writing.

Audio
📐 Calibration & Room

Intrinsic checkerboard calibration and multi-camera extrinsic (“room”) calibration.

Calibration & Room
⚡ Trigger & Sync

Keyboard/serial/parallel-port trigger sources and post-hoc trigger-to-frame resolution.

Trigger & Sync
🧠 Analysis orchestration

Launching Python analysis jobs and the Real-time tab’s live subprocess workers.

Analysis orchestration
🔗 Analysis result types

The Python ↔ C++ bridge — one loader class per analysis plugin’s JSON output.

Analysis result types — the Python ↔ C++ bridge

Core & Application#

Class

What it does

mosaic::Application

Top-level application object — owns and wires together every subsystem manager (video, audio, trigger, record, analysis) at startup.

mosaic::ProfileManager

Manages the on-disk research-group profile manifest and each profile’s isolated settings directory. See Research-group profiles.

mosaic::Logger

File-based logger with severity levels, backing mosaic.log.

Recording#

Class

What it does

mosaic::RecordManager

Central coordinator for a recording session — creates the session folder, writes session_meta.json immediately on start, and starts/stops the trigger, audio, and video pipelines in the correct order. See Recording workflow.

mosaic::SyncManifest

Resolves every camera’s frame timestamps onto one shared, uniform master-tick grid, for frame-accurate synchronized multi-camera playback.

mosaic::FrameTimestampWriter

Writes one CSV row per grabbed frame (frame_id, elapsed_ns, wall_ns, hw_timestamp_ns) that downstream sync tools read.

mosaic::RingBuffer

Lock-free single-producer/single-consumer ring buffer handing frames from the grab thread to the encoder thread.

Video#

Class

What it does

mosaic::VideoManager

Orchestrates one VideoGrabber + VideoEncoder pair per configured camera, including arming and firing the shared GigE Action-Command trigger.

mosaic::VideoGrabber

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.

mosaic::VideoEncoder

Consumes frames from a ring buffer and encodes them to an MP4 file — NVENC, VideoToolbox, or a libx264 software fallback depending on what’s available at compile time.

mosaic::VideoFeedProvider

QQuickImageProvider that serves the latest live camera frame to the QML monitor view.

mosaic::ActionCommandSession

Owns the GigE transport-layer handle used to fire continuous per-frame Action-Command triggers across every armed camera.

Audio#

Class

What it does

mosaic::AudioManager

Coordinates all AudioRecorder instances for a recording session.

mosaic::AudioRecorder

Records one configured microphone to a WAV file and emits live RMS/envelope signals that drive the waveform and VU-meter displays.

mosaic::WavWriter

Writes PCM audio to a WAV file, fixing up the RIFF/data chunk sizes when closed.

Calibration & Room#

Class

What it does

mosaic::CalibrationManager

Runs a full single-camera checkerboard intrinsic calibration pipeline using OpenCV. See Camera calibration.

mosaic::RoomCalibrationManager

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

mosaic::TriggerManager

Central trigger coordinator — aggregates events from every configured trigger source and logs them.

mosaic::TriggerRecorder

Writes TriggerEvents to trigger.csv during a recording session; thread-safe.

mosaic::KeyboardTrigger

Fires a trigger event on a configured key binding, installed as an app-wide event filter.

mosaic::SerialTrigger

Receives trigger events from an RS-232/USB-serial port.

mosaic::ParallelPortTrigger

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.

mosaic::TriggerFrameMap

Resolves every trigger.csv event to the nearest actually-captured frame in every camera, for the EEG/Trigger ↔ Frame Sync Analysis-tab plugin.

Analysis orchestration#

Class

What it does

mosaic::AnalysisManager

Manages the Python analysis subprocess(es) for every post-recording Analysis-tab plugin (Pose, Face Masking, Diarization, …).

mosaic::PoseWorker

Owns the long-lived live pose/gaze estimation subprocess behind the Real-time tab’s camera tiles.

mosaic::TranscriptWorker

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.

mosaic::DetectionRateTracker

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

mosaic::PoseAnalysisResult

Loads a pose/<video>.<model>.pose.json sidecar for the Pose plugin’s skeleton overlay and kinematics chart.

Python Analysis API

mosaic::ExpressionResult

Loads an expression/<video>.expression.json sidecar for the Facial Expression plugin’s overlay and blendshape/Action-Unit charts.

Python Analysis API

mosaic::GazeFusionResult

Loads a session-root gaze_fusion.json for the Multi-Camera Gaze Fusion plugin’s per-camera overlay and 3D room view.

Python Analysis API

mosaic::TranscriptResult

Loads an audio/<mic>.transcript.json sidecar for the Speaker Diarization plugin’s transcript table and speaker-shaded waveform.

Python Analysis API

mosaic::RppgResult

Loads a rppg/<video>.<backend>.rppg.json sidecar for the experimental Remote Heart Rate plugin’s BPM chart and debug ROI overlay.

Python Analysis API

mosaic::Skeleton3DResult

Loads a session-root skeleton3d.json for the 3D Pose Reconstruction plugin’s reprojected overlay and interactive 3D room view.

Python Analysis API


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:

📖 Full API index

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.

API Reference