Zrythm
a highly automated and intuitive digital audio workstation
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Zrythm Class Reference

To be used throughout the program. More...

#include <zrythm.h>

Collaboration diagram for Zrythm:

Public Member Functions

 Zrythm (const char *exe_path, bool have_ui, bool optimized_dsp)
 
void init ()
 
void add_to_recent_projects (const char *filepath)
 
void remove_recent_project (char *filepath)
 
bool init_user_dirs_and_files (GError **error)
 Initializes/creates the default dirs/files in the user directory.
 
void init_templates ()
 Initializes the array of project templates.
 

Static Public Member Functions

static char * get_version (bool with_v)
 Returns the version string.
 
static bool is_release (bool official)
 Returns whether the current Zrythm version is a release version.
 
static char * fetch_latest_release_ver_finish (GAsyncResult *result, GError **error)
 
static void fetch_latest_release_ver_async (GAsyncReadyCallback callback, gpointer callback_data)
 
static bool is_latest_release (const char *remote_latest_release)
 Returns whether the given release string is the latest release.
 
static void get_version_with_capabilities (char *buf, bool include_system_info)
 Returns the version and the capabilities.
 
static char * get_system_info ()
 Returns system info (mainly used for bug reports).
 
static char * get_prefix ()
 Returns the prefix or in the case of windows the root dir (C/program files/zrythm) or in the case of macos the bundle path.
 

Data Fields

const char * exe_path_ = nullptr
 argv[0].
 
PluginManagerplugin_manager = nullptr
 Manages plugins (loading, instantiating, etc.)
 
std::unique_ptr< Settingssettings
 Application settings.
 
Projectproject = nullptr
 Project data.
 
std::unique_ptr< StringArrayrecent_projects_
 +1 to ensure last element is NULL in case full.
 
char ** templates = nullptr
 NULL terminated array of project template absolute paths.
 
char * demo_template = nullptr
 Demo project template used when running for the first time.
 
bool opening_template = false
 Whether the open file is a template to be used to create a new project from.
 
bool creating_project = false
 Whether creating a new project, either from a template or blank.
 
char * create_project_path = nullptr
 Path to create a project in, including its title.
 
char * open_filename = nullptr
 Filename to open passed through the command line.
 
EventManagerevent_manager = nullptr
 
RecordingManagerrecording_manager = nullptr
 Recording manager.
 
FileManagerfile_manager = nullptr
 File manager.
 
ChordPresetPackManagerchord_preset_pack_manager = nullptr
 Chord preset pack manager.
 
std::unique_ptr< ZrythmDirectoryManagerdir_mgr
 
Symapsymap = nullptr
 String interner for internal things.
 
Symaperror_domain_symap = nullptr
 String interner for error domains.
 
PCGRand * rand = nullptr
 Random number generator.
 
bool debug = false
 In debug mode or not (determined by GSetting).
 
bool generating_project = false
 Whether this is a dummy instance used when generating projects.
 
bool have_ui_ = false
 1 if Zrythm has a UI, 0 if headless (eg, when unit-testing).
 
bool use_optimized_dsp = false
 Whether to use optimized DSP when available.
 
CairoCachescairo_caches = nullptr
 
int undo_stack_len = 0
 Undo stack length, used during tests.
 
char * version = nullptr
 Cached version (without 'v').
 
bool open_newer_backup = false
 Whether to open a newer backup if found.
 
bool use_pipewire_in_tests = false
 Whether to use pipewire in tests.
 
GPid pipewire_pid = 0
 Process ID for pipewire (used in tests).
 

Detailed Description

To be used throughout the program.

Everything here should be global and function regardless of the project.

Definition at line 215 of file zrythm.h.

Constructor & Destructor Documentation

◆ Zrythm()

Zrythm::Zrythm ( const char * exe_path,
bool have_ui,
bool optimized_dsp )
explicit
Parameters
have_uiWhether Zrythm is instantiated with a UI (false if headless).
testingWhether this is a unit test.

Member Function Documentation

◆ fetch_latest_release_ver_async()

static void Zrythm::fetch_latest_release_ver_async ( GAsyncReadyCallback callback,
gpointer callback_data )
static
Parameters
callbackA GAsyncReadyCallback to call when the request is satisfied.
callback_dataData to pass to callback.

◆ get_prefix()

static char * Zrythm::get_prefix ( )
static

Returns the prefix or in the case of windows the root dir (C/program files/zrythm) or in the case of macos the bundle path.

In all cases, "share" is expected to be found in this dir.

Returns
A newly allocated string.

◆ get_version()

static char * Zrythm::get_version ( bool with_v)
static

Returns the version string.

Must be g_free()'d.

Parameters
with_vInclude a starting "v".

◆ get_version_with_capabilities()

static void Zrythm::get_version_with_capabilities ( char * buf,
bool include_system_info )
static

Returns the version and the capabilities.

Parameters
bufBuffer to write the string to.
include_system_infoWhether to include additional system info (for bug reports).

◆ init_user_dirs_and_files()

bool Zrythm::init_user_dirs_and_files ( GError ** error)

Initializes/creates the default dirs/files in the user directory.

Returns
Whether successful.

◆ is_release()

static bool Zrythm::is_release ( bool official)
static

Returns whether the current Zrythm version is a release version.

Note
This only does regex checking.

Field Documentation

◆ cairo_caches

CairoCaches* Zrythm::cairo_caches = nullptr

Definition at line 404 of file zrythm.h.

◆ chord_preset_pack_manager

ChordPresetPackManager* Zrythm::chord_preset_pack_manager = nullptr

Chord preset pack manager.

Definition at line 371 of file zrythm.h.

◆ create_project_path

char* Zrythm::create_project_path = nullptr

Path to create a project in, including its title.

Definition at line 351 of file zrythm.h.

◆ creating_project

bool Zrythm::creating_project = false

Whether creating a new project, either from a template or blank.

Definition at line 348 of file zrythm.h.

◆ debug

bool Zrythm::debug = false

In debug mode or not (determined by GSetting).

Definition at line 391 of file zrythm.h.

◆ demo_template

char* Zrythm::demo_template = nullptr

Demo project template used when running for the first time.

This is a copy of one of the strings in Zrythm.templates.

Definition at line 341 of file zrythm.h.

◆ dir_mgr

std::unique_ptr<ZrythmDirectoryManager> Zrythm::dir_mgr

Definition at line 373 of file zrythm.h.

◆ error_domain_symap

Symap* Zrythm::error_domain_symap = nullptr

String interner for error domains.

Definition at line 383 of file zrythm.h.

◆ event_manager

EventManager* Zrythm::event_manager = nullptr

Definition at line 362 of file zrythm.h.

◆ exe_path_

const char* Zrythm::exe_path_ = nullptr

argv[0].

Definition at line 309 of file zrythm.h.

◆ file_manager

FileManager* Zrythm::file_manager = nullptr

File manager.

Definition at line 368 of file zrythm.h.

◆ generating_project

bool Zrythm::generating_project = false

Whether this is a dummy instance used when generating projects.

Definition at line 395 of file zrythm.h.

◆ have_ui_

bool Zrythm::have_ui_ = false

1 if Zrythm has a UI, 0 if headless (eg, when unit-testing).

Definition at line 399 of file zrythm.h.

◆ open_filename

char* Zrythm::open_filename = nullptr

Filename to open passed through the command line.

Used only when a filename is passed. E.g., zrytm myproject.xml

Definition at line 360 of file zrythm.h.

◆ open_newer_backup

bool Zrythm::open_newer_backup = false

Whether to open a newer backup if found.

This is only used during tests where there is no UI to choose.

Definition at line 417 of file zrythm.h.

◆ opening_template

bool Zrythm::opening_template = false

Whether the open file is a template to be used to create a new project from.

Definition at line 345 of file zrythm.h.

◆ pipewire_pid

GPid Zrythm::pipewire_pid = 0

Process ID for pipewire (used in tests).

Definition at line 430 of file zrythm.h.

◆ plugin_manager

PluginManager* Zrythm::plugin_manager = nullptr

Manages plugins (loading, instantiating, etc.)

Definition at line 314 of file zrythm.h.

◆ project

Project* Zrythm::project = nullptr

Project data.

This is what should be exported/imported when saving/loading projects.

The only reason this is a pointer is to easily deserialize.

Definition at line 328 of file zrythm.h.

◆ rand

PCGRand* Zrythm::rand = nullptr

Random number generator.

Definition at line 386 of file zrythm.h.

◆ recent_projects_

std::unique_ptr<StringArray> Zrythm::recent_projects_

+1 to ensure last element is NULL in case full.

Definition at line 331 of file zrythm.h.

◆ recording_manager

RecordingManager* Zrythm::recording_manager = nullptr

Recording manager.

Definition at line 365 of file zrythm.h.

◆ settings

std::unique_ptr<Settings> Zrythm::settings

Application settings.

Definition at line 319 of file zrythm.h.

◆ symap

Symap* Zrythm::symap = nullptr

String interner for internal things.

Definition at line 378 of file zrythm.h.

◆ templates

char** Zrythm::templates = nullptr

NULL terminated array of project template absolute paths.

Definition at line 334 of file zrythm.h.

◆ undo_stack_len

int Zrythm::undo_stack_len = 0

Undo stack length, used during tests.

Definition at line 407 of file zrythm.h.

◆ use_optimized_dsp

bool Zrythm::use_optimized_dsp = false

Whether to use optimized DSP when available.

Definition at line 402 of file zrythm.h.

◆ use_pipewire_in_tests

bool Zrythm::use_pipewire_in_tests = false

Whether to use pipewire in tests.

If this is false, the dummy engine will be used.

Some tests do sample rate changes so it's more convenient to use the dummy engine instead.

Definition at line 427 of file zrythm.h.

◆ version

char* Zrythm::version = nullptr

Cached version (without 'v').

Definition at line 410 of file zrythm.h.


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