This document describes how the DISTRHO Cardinal project is structured, so developers and interested third-parties can have an easier time contributing code and resources.
On the root folder the following directories can be seen;
Going through one by one in alphebetical order we have...
This directory contains the source code for Carla, a modular plugin host created by falkTX, the same author of Cardinal, DPF and many other projects.
Cardinal uses Carla as the base for all internal plugin hosting.
Being GPLv2+ the code license is compatible with Cardinal's GPLv3+.
3rd-party libraries build setup.
No Cardinal specific code is hosted here, only external submodules and a Makefile with steps for fetching extra source code and build it.
The Makefile overrides Rack's dep.mk
things for a proper static build, and supporting more platforms.
Here you find several files (like this one you are reading now) describing the Cardinal project.
It is intentionally not using something like GitHub Wiki so that rehosting does not lose any information.
Also allows for offline hosting and reading.
This directory contains the source code for DPF, the plugin framework used by Cardinal that handles all the complex parts of plugin format support.
Implementing new plugin formats will be done here.
This directory contains special header files needed to build the original Rack code as required by Cardinal.
These headers are included before the official Rack ones, allowing us to override some implementation details.
Additionally a few compatiblity headers are present, helping compile the code for more targets than officially supported in Rack.
An experiment for building individual Rack modules directly as LV2 plugins.
Only quick&dirty hacks so far, nothing interesting to see here yet.
Public domain or CC0 licensed Rack patches, suitable for use in Cardinal.
Must be stored as plain text files (not zstd compressed) so they play nicely with git.
Module/Plugin related code and build setup.
Only Cardinal internal modules are hosted here, everything else uses a git submodule reference.
See DISTRHO#28 for how to add more modules yourself.
The main code for Cardinal, where the magic happens.
There are quite a few files here, so let's describe them in detail.
Directories that contain the supported Cardinal plugin variants.
Everything is a symlink except DistrhoPluginInfo.h
(setting plugin info) and Makefile
(set the unique name).
The source code is the same for all the variants, with compiler macros used to tweak behaviour and IO count.
A few extra files for having access to a few utilities, code borrowed from Carla, which in turn borrowed it from JUCE.
The important one is SharedResourcePointer
, as a way to easily manage a shared class lifecycle.
Here are files that are originally from Rack but fully reimplemented in Cardinal.
Some of them are just stubs to define function symbols but without an actual implementation, for example disabling network features.
Here are files that are very close to the original from Rack but required tweaks for Cardinal.
Extra care is needed to ensure these are kept in sync with the originals.
A git submodule reference to the official Rack source code repository.
Custom Cardinal code for showing a dialog in async fashion, optionally with a callback for when the user clicks "Ok".
The DSP/plugin side of the plugin, and also where the global/shared class lifecycle is managed.
This file implements the DPF Plugin
class.
The UI-specific side of the plugin, dealing with e.g. Window events.
This file implements the DPF UI
class.
The file describing rules for building Rack's code as a rack.a static library.
A makefile imported by each of Cardinal's plugin variants, which will build the actual plugin.
This same file is used by all variants, changing behaviour based on the plugin variant name.
And handy but perhaps somewhat hacky rack::Context
class extension, so internal modules can have direct access to DAW provided data.
This also extends the base Plugin
and UI
classes from DPF, to provide methods needed for Rack Audio/MIDI drivers.
Code that glues Rack Audio/MIDI drivers to the DPF side of things.
A DPF-related Widget that does what you think it does.
Handles all the resizing for us.
The default template patch as used by Cardinal
Defines a few methods for saving and restoring Rack Window state, in order to allow many Cardinal/Rack UIs to be open at once even though Rack settings
is a global.
Used by CardinalUI.cpp
and override/Window.cpp
.