Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
zrythm::structure::project::Project Class Referencefinal

Core functionality of a Zrythm project. More...

#include <src/structure/project/project.h>

Inheritance diagram for zrythm::structure::project::Project:
Collaboration diagram for zrythm::structure::project::Project:

Public Types

using TrackUuid = structure::tracks::TrackUuid
using PluginPtrVariant = plugins::PluginPtrVariant
using PluginRegistry = plugins::PluginRegistry

Public Member Functions

 Project (utils::AppSettings &app_settings, std::shared_ptr< juce::AudioDeviceManager > device_manager, std::shared_ptr< juce::AudioPluginFormatManager > plugin_format_manager, plugins::PluginHostWindowFactory plugin_host_window_provider, dsp::Fader &monitor_fader, utils::Utf8String zrythm_version, QObject *parent=nullptr)
QString getTitle () const
void setTitle (const QString &title)
QString directory () const
void setDirectory (const QString &directory)
structure::tracks::Tracklisttracklist () const
structure::scenes::ClipLauncherclipLauncher () const
structure::scenes::ClipPlaybackServiceclipPlaybackService () const
dsp::Metronomemetronome () const
dsp::TransportgetTransport () const
dsp::AudioEngineengine () const
dsp::TempoMapWrappergetTempoMap () const
dsp::SnapGridsnapGridTimeline () const
dsp::SnapGridsnapGridEditor () const
structure::arrangement::TempoObjectManagertempoObjectManager () const
Q_SIGNAL void titleChanged (const QString &title)
Q_SIGNAL void directoryChanged (const QString &directory)
Q_SIGNAL void aboutToBeDeleted ()
dsp::Fadermonitor_fader ()
fs::path get_directory (bool for_backup) const
auto * arrangerObjectFactory () const
Q_INVOKABLE Project * clone (bool for_backup) const
 Deep-clones the given project.
std::optional< fs::path > get_newer_backup ()
 Returns the filepath of a backup (directory), if any, if it has a newer timestamp than main project file.
Q_INVOKABLE void activate ()
 Connects things up, exposes ports to the backend, calculates the graph and begins processing.
void add_default_tracks ()
 Adds the default undeletable tracks to the project.
structure::tracks::FinalTrackDependencies get_final_track_dependencies () const
auto & get_file_audio_source_registry () const
auto & get_track_registry () const
auto & get_plugin_registry () const
auto & get_port_registry () const
auto & get_param_registry () const
auto & get_arranger_object_registry () const
std::optional< dsp::PortPtrVariant > find_port_by_id (const dsp::Port::Uuid &id) const
 Finds the Port corresponding to the identifier.
dsp::ProcessorParameterfind_param_by_id (const dsp::ProcessorParameter::Uuid &id) const
std::optional< plugins::PluginPtrVariant > find_plugin_by_id (plugins::Plugin::Uuid id) const
std::optional< zrythm::structure::tracks::TrackPtrVariant > find_track_by_id (structure::tracks::Track::Uuid id) const
std::optional< zrythm::structure::arrangement::ArrangerObjectPtrVariant > find_arranger_object_by_id (structure::arrangement::ArrangerObject::Uuid id) const
const auto & get_tempo_map () const

Data Fields

utils::Utf8String title_
 Project title.
utils::Utf8String datetime_str_
 Datetime string to add to the project file.
fs::path dir_
 Path to save the project in.
std::optional< fs::path > backup_dir_
 Backup dir to save the project during the current save call.
utils::Utf8String version_
 Zrythm version, for serialization.
bool loading_from_backup_ = false
 Whether the current is currently being loaded from a backup file.
std::shared_ptr< juce::AudioDeviceManager > device_manager_
std::shared_ptr< juce::AudioPluginFormatManager > plugin_format_manager_
utils::QObjectUniquePtr< dsp::PortConnectionsManagerport_connections_manager_
 Must be free'd after engine.
utils::QObjectUniquePtr< dsp::SnapGridsnap_grid_editor_
 Snap/Grid info for the editor.
utils::QObjectUniquePtr< dsp::SnapGridsnap_grid_timeline_
 Snap/Grid info for the timeline.
utils::QObjectUniquePtr< dsp::Metronomemetronome_
utils::QObjectUniquePtr< dsp::Transporttransport_
 Timeline metadata like BPM, time signature, etc.
utils::QObjectUniquePtr< dsp::AudioEngineaudio_engine_
 The audio backend.
std::unique_ptr< dsp::AudioPoolpool_
 Audio file pool.
utils::QObjectUniquePtr< structure::tracks::Tracklisttracklist_
 Manager for region link groups.
boost::unordered_flat_map< structure::tracks::TrackUuid, structure::tracks::TrackPtrVariant > tracks_rt_
 Realtime cache of tracks.
utils::QObjectUniquePtr< structure::scenes::ClipLauncherclip_launcher_
utils::QObjectUniquePtr< structure::scenes::ClipPlaybackServiceclip_playback_service_
std::unique_ptr< structure::arrangement::ArrangerObjectFactoryarranger_object_factory_
utils::QObjectUniquePtr< plugins::PluginFactoryplugin_factory_
std::unique_ptr< structure::tracks::TrackFactorytrack_factory_
utils::QObjectUniquePtr< structure::arrangement::TempoObjectManagertempo_object_manager_
dsp::Fadermonitor_fader_
dsp::DspGraphDispatcher graph_dispatcher_
 Graph dispatcher.
int format_major_ = 0
 Used when deserializing projects.
int format_minor_ = 0

Properties

QML_ELEMENT QString title
QString directory
zrythm::structure::tracks::Tracklisttracklist
zrythm::structure::scenes::ClipLauncherclipLauncher
zrythm::structure::scenes::ClipPlaybackServiceclipPlaybackService
zrythm::dsp::AudioEngineengine
zrythm::dsp::Metronomemetronome
zrythm::dsp::Transporttransport
zrythm::dsp::TempoMapWrappertempoMap
zrythm::structure::arrangement::TempoObjectManagertempoObjectManager
zrythm::dsp::SnapGridsnapGridTimeline
zrythm::dsp::SnapGridsnapGridEditor

Friends

struct PluginBuilderForDeserialization
void init_from (Project &obj, const Project &other, utils::ObjectCloneType clone_type)
void to_json (nlohmann::json &j, const Project &project)
void from_json (const nlohmann::json &j, Project &project)

Detailed Description

Core functionality of a Zrythm project.

Definition at line 44 of file project.h.

Member Typedef Documentation

◆ PluginPtrVariant

using zrythm::structure::project::Project::PluginPtrVariant = plugins::PluginPtrVariant

Definition at line 67 of file project.h.

◆ PluginRegistry

using zrythm::structure::project::Project::PluginRegistry = plugins::PluginRegistry

Definition at line 68 of file project.h.

◆ TrackUuid

using zrythm::structure::project::Project::TrackUuid = structure::tracks::TrackUuid

Definition at line 66 of file project.h.

Member Function Documentation

◆ add_default_tracks()

void zrythm::structure::project::Project::add_default_tracks ( )

Adds the default undeletable tracks to the project.

To be called when creating new projects.

◆ arrangerObjectFactory()

auto * zrythm::structure::project::Project::arrangerObjectFactory ( ) const
inline

Definition at line 114 of file project.h.

◆ clone()

Q_INVOKABLE Project * zrythm::structure::project::Project::clone ( bool for_backup) const

Deep-clones the given project.

To be used during save on the main thread.

Parameters
for_backupWhether the resulting project is for a backup.
Exceptions
ZrythmExceptionIf an error occurs.

◆ find_arranger_object_by_id()

std::optional< zrythm::structure::arrangement::ArrangerObjectPtrVariant > zrythm::structure::project::Project::find_arranger_object_by_id ( structure::arrangement::ArrangerObject::Uuid id) const
inline

Definition at line 210 of file project.h.

◆ find_param_by_id()

dsp::ProcessorParameter * zrythm::structure::project::Project::find_param_by_id ( const dsp::ProcessorParameter::Uuid & id) const
inline

Definition at line 187 of file project.h.

◆ find_plugin_by_id()

std::optional< plugins::PluginPtrVariant > zrythm::structure::project::Project::find_plugin_by_id ( plugins::Plugin::Uuid id) const
inline

Definition at line 198 of file project.h.

◆ find_port_by_id()

std::optional< dsp::PortPtrVariant > zrythm::structure::project::Project::find_port_by_id ( const dsp::Port::Uuid & id) const
inline

Finds the Port corresponding to the identifier.

Parameters
idThe PortIdentifier to use for searching.
Note
Ported from Port::find_from_identifier() in older code.

Definition at line 181 of file project.h.

◆ find_track_by_id()

std::optional< zrythm::structure::tracks::TrackPtrVariant > zrythm::structure::project::Project::find_track_by_id ( structure::tracks::Track::Uuid id) const
inline

Definition at line 204 of file project.h.

◆ get_arranger_object_registry()

auto & zrythm::structure::project::Project::get_arranger_object_registry ( ) const
inline

Definition at line 168 of file project.h.

◆ get_file_audio_source_registry()

auto & zrythm::structure::project::Project::get_file_audio_source_registry ( ) const
inline

Definition at line 160 of file project.h.

◆ get_newer_backup()

std::optional< fs::path > zrythm::structure::project::Project::get_newer_backup ( )

Returns the filepath of a backup (directory), if any, if it has a newer timestamp than main project file.

Returns nullopt if there were errors or no backup was found.

◆ get_param_registry()

auto & zrythm::structure::project::Project::get_param_registry ( ) const
inline

Definition at line 167 of file project.h.

◆ get_plugin_registry()

auto & zrythm::structure::project::Project::get_plugin_registry ( ) const
inline

Definition at line 165 of file project.h.

◆ get_port_registry()

auto & zrythm::structure::project::Project::get_port_registry ( ) const
inline

Definition at line 166 of file project.h.

◆ get_tempo_map()

const auto & zrythm::structure::project::Project::get_tempo_map ( ) const
inline

Definition at line 216 of file project.h.

◆ get_track_registry()

auto & zrythm::structure::project::Project::get_track_registry ( ) const
inline

Definition at line 164 of file project.h.

◆ PluginBuilderForDeserialization

friend struct PluginBuilderForDeserialization
friend

Definition at line 63 of file project.h.

Field Documentation

◆ arranger_object_factory_

std::unique_ptr<structure::arrangement::ArrangerObjectFactory> zrythm::structure::project::Project::arranger_object_factory_

Definition at line 343 of file project.h.

◆ audio_engine_

utils::QObjectUniquePtr<dsp::AudioEngine> zrythm::structure::project::Project::audio_engine_

The audio backend.

Definition at line 315 of file project.h.

◆ backup_dir_

std::optional<fs::path> zrythm::structure::project::Project::backup_dir_

Backup dir to save the project during the current save call.

For example, Project.dir /backups/myproject.bak3.

Definition at line 273 of file project.h.

◆ clip_launcher_

utils::QObjectUniquePtr<structure::scenes::ClipLauncher> zrythm::structure::project::Project::clip_launcher_

Definition at line 338 of file project.h.

◆ clip_playback_service_

utils::QObjectUniquePtr<structure::scenes::ClipPlaybackService> zrythm::structure::project::Project::clip_playback_service_

Definition at line 340 of file project.h.

◆ datetime_str_

utils::Utf8String zrythm::structure::project::Project::datetime_str_

Datetime string to add to the project file.

Definition at line 263 of file project.h.

◆ device_manager_

std::shared_ptr<juce::AudioDeviceManager> zrythm::structure::project::Project::device_manager_

Definition at line 288 of file project.h.

◆ dir_

fs::path zrythm::structure::project::Project::dir_

Path to save the project in.

Definition at line 266 of file project.h.

◆ format_major_

int zrythm::structure::project::Project::format_major_ = 0

Used when deserializing projects.

Definition at line 361 of file project.h.

◆ format_minor_

int zrythm::structure::project::Project::format_minor_ = 0

Definition at line 362 of file project.h.

◆ graph_dispatcher_

dsp::DspGraphDispatcher zrythm::structure::project::Project::graph_dispatcher_

Graph dispatcher.

Note
Needs to be deleted after the audio engine so placed here torwards the end.

Definition at line 358 of file project.h.

◆ loading_from_backup_

bool zrythm::structure::project::Project::loading_from_backup_ = false

Whether the current is currently being loaded from a backup file.

This is useful when instantiating plugins from state and should be set to false after the project is loaded.

Definition at line 286 of file project.h.

◆ metronome_

utils::QObjectUniquePtr<dsp::Metronome> zrythm::structure::project::Project::metronome_

Definition at line 305 of file project.h.

◆ monitor_fader_

dsp::Fader& zrythm::structure::project::Project::monitor_fader_

Definition at line 350 of file project.h.

◆ plugin_factory_

utils::QObjectUniquePtr<plugins::PluginFactory> zrythm::structure::project::Project::plugin_factory_

Definition at line 344 of file project.h.

◆ plugin_format_manager_

std::shared_ptr<juce::AudioPluginFormatManager> zrythm::structure::project::Project::plugin_format_manager_

Definition at line 290 of file project.h.

◆ pool_

std::unique_ptr<dsp::AudioPool> zrythm::structure::project::Project::pool_

Audio file pool.

Definition at line 318 of file project.h.

◆ port_connections_manager_

utils::QObjectUniquePtr<dsp::PortConnectionsManager> zrythm::structure::project::Project::port_connections_manager_

Must be free'd after engine.

Definition at line 297 of file project.h.

◆ snap_grid_editor_

utils::QObjectUniquePtr<dsp::SnapGrid> zrythm::structure::project::Project::snap_grid_editor_

Snap/Grid info for the editor.

Definition at line 300 of file project.h.

◆ snap_grid_timeline_

utils::QObjectUniquePtr<dsp::SnapGrid> zrythm::structure::project::Project::snap_grid_timeline_

Snap/Grid info for the timeline.

Definition at line 303 of file project.h.

◆ tempo_object_manager_

utils::QObjectUniquePtr<structure::arrangement::TempoObjectManager> zrythm::structure::project::Project::tempo_object_manager_

Definition at line 348 of file project.h.

◆ title_

utils::Utf8String zrythm::structure::project::Project::title_

Project title.

Definition at line 260 of file project.h.

◆ track_factory_

std::unique_ptr<structure::tracks::TrackFactory> zrythm::structure::project::Project::track_factory_

Definition at line 345 of file project.h.

◆ tracklist_

utils::QObjectUniquePtr<structure::tracks::Tracklist> zrythm::structure::project::Project::tracklist_

Manager for region link groups.

Tracklist.

Must be free'd before engine and port connection manager.

Definition at line 328 of file project.h.

◆ tracks_rt_

boost::unordered_flat_map< structure::tracks::TrackUuid, structure::tracks::TrackPtrVariant> zrythm::structure::project::Project::tracks_rt_

Realtime cache of tracks.

Definition at line 336 of file project.h.

◆ transport_

utils::QObjectUniquePtr<dsp::Transport> zrythm::structure::project::Project::transport_

Timeline metadata like BPM, time signature, etc.

Definition at line 310 of file project.h.

◆ version_

utils::Utf8String zrythm::structure::project::Project::version_

Zrythm version, for serialization.

Definition at line 278 of file project.h.

Property Documentation

◆ clipLauncher

zrythm::structure::scenes::ClipLauncher * zrythm::structure::project::Project::clipLauncher
read

Definition at line 52 of file project.h.

◆ clipPlaybackService

zrythm::structure::scenes::ClipPlaybackService * zrythm::structure::project::Project::clipPlaybackService
read

Definition at line 53 of file project.h.

◆ directory

QString zrythm::structure::project::Project::directory
readwrite

Definition at line 49 of file project.h.

◆ engine

zrythm::dsp::AudioEngine * zrythm::structure::project::Project::engine
read

Definition at line 54 of file project.h.

◆ metronome

zrythm::dsp::Metronome * zrythm::structure::project::Project::metronome
read

Definition at line 55 of file project.h.

◆ snapGridEditor

zrythm::dsp::SnapGrid * zrythm::structure::project::Project::snapGridEditor
read

Definition at line 60 of file project.h.

◆ snapGridTimeline

zrythm::dsp::SnapGrid * zrythm::structure::project::Project::snapGridTimeline
read

Definition at line 59 of file project.h.

◆ tempoMap

zrythm::dsp::TempoMapWrapper * zrythm::structure::project::Project::tempoMap
read

Definition at line 57 of file project.h.

◆ tempoObjectManager

zrythm::structure::arrangement::TempoObjectManager * zrythm::structure::project::Project::tempoObjectManager
read

Definition at line 58 of file project.h.

◆ title

QML_ELEMENT QString zrythm::structure::project::Project::title
readwrite

Definition at line 48 of file project.h.

◆ tracklist

zrythm::structure::tracks::Tracklist * zrythm::structure::project::Project::tracklist
read

Definition at line 51 of file project.h.

◆ transport

zrythm::dsp::Transport * zrythm::structure::project::Project::transport
read

Definition at line 56 of file project.h.


The documentation for this class was generated from the following file: