# artemizmaylov/aimp_projectm architecture

> Architecture diagram of the GitHub repository artemizmaylov/aimp_projectm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/artemizmaylov/aimp_projectm
- Repository: https://github.com/artemizmaylov/aimp_projectm

## Overview

aimp_projectM is an AIMP visualization plugin that feeds AIMP waveform data into ProjectM and returns rendered frames to AIMP. The workflow begins with plugin registration, continues through the visualization adapter and ProjectM rendering core, and ends with pixel output through AIMP’s canvas or direct-output interface. The core also manages randomized and manually selected presets, texture lookup, configurable rendering, and an optional preset-name overlay. Relationships shown are supported by the excerpts or README; external library internals are not represented.

Main entry points: [`sources/VisualizationCore.cpp`](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp) (ProjectM render core), [`sources/Visualization.cpp`](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp) (Visualization adapter), [`sources/Plugin.cpp`](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Plugin.cpp) (Plugin entry), [`sources/Logger.cpp`](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Logger.cpp) (Logging callback)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["AIMP integration"]
  node_plugin_entry["Plugin entry<br/>[Plugin.cpp]"]
  node_visualization_adapter["Visualization adapter<br/>[Visualization.cpp]"]
  node_direct_output["Direct output adapter<br/>[Visualization.cpp]"]
  node_canvas_output["Canvas output<br/>[Visualization.cpp]"]
end

subgraph group_render["Visualization runtime"]
  node_render_core["ProjectM render core"]
  node_projectm["ProjectM engine"]
end

subgraph group_assets["Presets and settings"]
  node_playlist["Preset playlist"]
  node_preset_assets["Preset and texture files"]
  node_settings["Settings and paths"]
end

subgraph group_support["Rendering support"]
  node_title_overlay["Preset title overlay<br/>[gltext.h]"]
  node_opengl["OpenGL frame target"]
  node_logger["Logging callback<br/>[Logger.cpp]"]
end

node_aimp(("AIMP player"))

node_aimp -->|"loads plugin"| node_plugin_entry
node_plugin_entry -->|"registers visualization"| node_aimp
node_aimp -->|"sends waveform"| node_visualization_adapter
node_visualization_adapter -->|"creates and drives"| node_render_core
node_visualization_adapter -->|"returns canvas pixels"| node_aimp
node_visualization_adapter -->|"exposes interface"| node_direct_output
node_direct_output -->|"draws and reads pixels"| node_render_core
node_render_core -->|"feeds audio and renders"| node_projectm
node_render_core -->|"creates and controls"| node_playlist
node_playlist -.->|"loads preset files"| node_preset_assets
node_render_core -->|"sets texture search path"| node_preset_assets
node_render_core -->|"loads configuration"| node_settings
node_visualization_adapter -->|"loads display limits"| node_settings
node_render_core -->|"renders frame target"| node_opengl
node_render_core -->|"draws preset name"| node_title_overlay
node_visualization_adapter -.->|"logs via core"| node_logger
node_render_core -->|"logs runtime events"| node_logger
node_plugin_entry -->|"configures callback"| node_logger

click node_plugin_entry "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Plugin.cpp"
click node_visualization_adapter "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp"
click node_direct_output "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp"
click node_canvas_output "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp"
click node_render_core "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp"
click node_playlist "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp"
click node_settings "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationSettings.h"
click node_title_overlay "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/gltext.h"
click node_opengl "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp"
click node_logger "https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Logger.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin_entry,node_visualization_adapter,node_direct_output,node_canvas_output toneBlue
class node_render_core,node_projectm toneAmber
class node_playlist,node_preset_assets,node_settings toneMint
class node_title_overlay,node_opengl,node_logger toneRose
class node_aimp toneIndigo
```

## Components

### AIMP integration

- [Plugin entry](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Plugin.cpp): `sources/Plugin.cpp`
- [Visualization adapter](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp): `sources/Visualization.cpp`
- [Direct output adapter](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp): `sources/Visualization.cpp`
- [Canvas output](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Visualization.cpp): `sources/Visualization.cpp`

### Visualization runtime

- [ProjectM render core](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp): `sources/VisualizationCore.cpp`
- **ProjectM engine**

### Presets and settings

- [Preset playlist](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp): `sources/VisualizationCore.cpp`
- **Preset and texture files**
- [Settings and paths](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationSettings.h): `sources/VisualizationSettings.h`

### Rendering support

- [Preset title overlay](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/gltext.h): `sources/gltext.h`
- [OpenGL frame target](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/VisualizationCore.cpp): `sources/VisualizationCore.cpp`
- [Logging callback](https://github.com/artemizmaylov/aimp_projectm/blob/main/sources/Logger.cpp): `sources/Logger.cpp`

### Other components

- **AIMP player**

## Connections

- AIMP player → Plugin entry: loads plugin (evidence: `sources/Plugin.cpp`)
- Plugin entry → AIMP player: registers visualization (evidence: `sources/Plugin.cpp`)
- AIMP player → Visualization adapter: sends waveform (evidence: `sources/Visualization.cpp`)
- Visualization adapter → ProjectM render core: creates and drives (evidence: `sources/Visualization.cpp`)
- Visualization adapter → AIMP player: returns canvas pixels (evidence: `sources/Visualization.cpp`)
- Visualization adapter → Direct output adapter: exposes interface (evidence: `sources/Visualization.cpp`)
- Direct output adapter → ProjectM render core: draws and reads pixels (evidence: `sources/Visualization.cpp`)
- ProjectM render core → ProjectM engine: feeds audio and renders (evidence: `sources/VisualizationCore.cpp`)
- ProjectM render core → Preset playlist: creates and controls (evidence: `sources/VisualizationCore.cpp`)
- Preset playlist → Preset and texture files: loads preset files (evidence: `README.md`)
- ProjectM render core → Preset and texture files: sets texture search path (evidence: `sources/VisualizationCore.cpp`)
- ProjectM render core → Settings and paths: loads configuration (evidence: `sources/VisualizationCore.cpp`)
- Visualization adapter → Settings and paths: loads display limits (evidence: `sources/Visualization.cpp`)
- ProjectM render core → OpenGL frame target: renders frame target (evidence: `sources/VisualizationCore.cpp`)
- ProjectM render core → Preset title overlay: draws preset name (evidence: `sources/VisualizationCore.cpp`)
- Visualization adapter → Logging callback: logs via core
- ProjectM render core → Logging callback: logs runtime events (evidence: `sources/VisualizationCore.cpp`)
- Plugin entry → Logging callback: configures callback (evidence: `sources/Plugin.cpp`)
