# ggarra13/mrv2 architecture

> Architecture diagram of the GitHub repository ggarra13/mrv2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ggarra13/mrv2
- Repository: https://github.com/ggarra13/mrv2

## Overview

##### Main Components
- Core Playback Engine – Include the custom media processing layer (tlRender integration) and media I/O (handling movie files, image sequences, audio, etc.). This component interacts with external libraries like FFmpeg (compiled with different license modes) and image format handlers.
- User Interface Layer – Capture the UI framework areas, such as:
– mrvWidgets: for all custom UI widgets (buttons, tables, panels, menus).
– mrvUI: which binds everything together, including the main window, docking, and panelling.
– mrvPanels: dedicated to specific UI panels such as annotations, media info, timelines, logs, preferences, etc.
– mrvFLU/mrvFl/mrvFlmm: these modules integrate with the underlying FLTK-like libraries and help build the GUI.
- Plugin & Python API – Highlight the role of the Python API (src/mrvPy and associated demos) that allows for extending functionality and scripting. Emphasize the demo and plug-in directories.
- Network & Communication Modules – Include mrvNetwork, which handles client/server communication, file model synchronization, and other network-based interactions.
- Auxiliary Tools & Build Scripts – Although not part of runtime architecture, include a representation of the build system (CMake configuration scripts in the cmake/ directory, runme.sh family scripts), translation tools (src/po and bin/po scripts), and packaging utilities.
- External Dependencies – Represent external tools like FFmpeg (with toggle for GPL vs. LGPL builds) and integrated third-party libraries (as built via custom cmake modules) and also the core dependency on tlRender.

##### Establish Relationships and Interactions
- That the plugin system (Python API) acts as an extensibility point: plugins may intercept editing events or augment the UI functionality.
- That the build system (CMake plus shell scripts) orchestrates the integration of all submodules, linking libraries like mrvCore, mrvApp, mrvDraw, etc., and also packaging them into the final executable.
- Communication between the network layer and the UI/core components, where network messages (for file paths, timelines, etc.) flow from mrvNetwork modules to relevant components.

##### Architectural Patterns and Design Principles
- A layered architecture is visible: lower-level core processing and media handling libraries (mrvCore, mrvDraw, mrvNetwork) feed into higher-level application logic (mrvApp, mrvUI) which then interface with the user via the widget layers (mrvWidgets, mrvPanels).
- There is also a clear separation of concerns: dedicated modules for media, UI, networking, and configuration (including translation and packaging).
- Integration with continuous integration workflows, and multiple platform-specific build scripts, also suggests that the platform abstraction and portability are important architectural concerns.

##### Relevant Technologies, Frameworks, and Libraries
- Mention C++20 as the language and CMake as the build system.
- Third-party libraries such as FFmpeg, OpenEXR, and the custom tlRender engine.
- Use of FLTK (or a derivative like pyFLTK/mrvFLU) for building the GUI.
- Python’s role within the plugin system and for automation scripts.
- That translations (via gettext) and documentation (using Doxygen and Sphinx) are part of the ecosystem.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build/Deployment Layer
    subgraph "Build/Deployment Layer"
        B1["CMake Scripts"]:::build
        B2["Shell Scripts"]:::build
        B3["Translation Tools"]:::build
    end

    %% Core Engine & Media Processing
    subgraph "Core Engine & Media Processing"
        C1["Core Playback Engine"]:::core
        C2["mrvCore"]:::core
        C3["mrvDraw"]:::core
        C4["mrvEdit"]:::core
    end

    %% Application Layer
    subgraph "Application Layer"
        A1["mrvApp"]:::app
    end

    %% UI Layer
    subgraph "UI Layer"
        U1["mrvUI"]:::ui
        U2["mrvWidgets"]:::ui
        U3["mrvPanels"]:::ui
        U4["mrvFLU"]:::ui
        U5["mrvFl"]:::ui
        U6["mrvFlmm"]:::ui
    end

    %% Extensibility & Networking
    subgraph "Extensibility & Networking"
        E1["Python API"]:::ext
        E2["Python Demos"]:::ext
        E3["Python Plugins"]:::ext
        E4["mrvNetwork"]:::ext
    end

    %% Build/Deployment connections
    B1 -->|"builds"| C1
    B1 -->|"builds"| A1
    B1 -->|"builds"| U1
    B1 -->|"integrates"| E1

    %% Core Engine & Media Processing connections
    C1 -->|"initializes"| C2
    C2 -->|"renders overlays"| C3
    C2 -->|"handles editing"| C4
    C2 -->|"supplies data"| A1

    %% Application Layer connections
    A1 -->|"controls"| U1

    %% UI Layer connections
    U1 -->|"contains"| U2
    U1 -->|"contains"| U3
    U1 -->|"integrates"| U4
    U1 -->|"integrates"| U5
    U1 -->|"integrates"| U6

    %% Extensibility & Networking connections
    E1 -->|"demonstrates"| E2
    E1 -->|"demonstrates"| E3
    E1 -->|"extends"| A1
    E1 -->|"augments"| U1
    E4 -->|"communicates with"| A1
    E4 -->|"communicates with"| U1

    %% Class assignments
    classDef build fill:#c8e6c9,stroke:#388e3c,stroke-width:2px;
    classDef core fill:#ffe082,stroke:#f57f17,stroke-width:2px;
    classDef app fill:#bbdefb,stroke:#1e88e5,stroke-width:2px;
    classDef ui fill:#d1c4e9,stroke:#673ab7,stroke-width:2px;
    classDef ext fill:#ffcdd2,stroke:#e53935,stroke-width:2px;

    %% Click Events
    click C1 "https://github.com/ggarra13/mrv2/tree/main//tlRender"
    click A1 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvApp"
    click C2 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvCore"
    click C3 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvDraw"
    click C4 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvEdit"
    click U2 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvWidgets"
    click U1 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvUI"
    click U3 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvPanels"
    click U4 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvFLU"
    click U5 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvFl"
    click U6 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvFlmm"
    click E1 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvPy"
    click E2 "https://github.com/ggarra13/mrv2/tree/main//src/python/demos"
    click E3 "https://github.com/ggarra13/mrv2/tree/main//src/python/plug-ins"
    click E4 "https://github.com/ggarra13/mrv2/tree/main//src/lib/mrvNetwork"
    click B1 "https://github.com/ggarra13/mrv2/tree/main//cmake"
    click B2 "https://github.com/ggarra13/mrv2/tree/main//bin"
    click B3 "https://github.com/ggarra13/mrv2/tree/main//src/po"
```
