13#include "zrythm-config.h"
32typedef struct PCGRand PCGRand;
40#define ZRYTHM (zrythm)
42#define ZRYTHM_PROJECTS_DIR "projects"
44#define MAX_RECENT_PROJECTS 20
45#define DEBUGGING (G_UNLIKELY (ZRYTHM && ZRYTHM->debug))
46#define ZRYTHM_TESTING \
47 (G_UNLIKELY (ZRYTHM && ZRYTHM->testing))
48#define ZRYTHM_GENERATING_PROJECT (ZRYTHM->generating_project)
49#define ZRYTHM_HAVE_UI (ZRYTHM && ZRYTHM->have_ui)
52# define ZRYTHM_USE_OPTIMIZED_DSP \
53 (G_LIKELY (ZRYTHM->use_optimized_dsp))
55# define ZRYTHM_USE_OPTIMIZED_DSP false
157 ZRYTHM_DIR_USER_TEMPLATES,
158 ZRYTHM_DIR_USER_THEMES,
217 int num_recent_projects;
350zrythm_add_to_recent_projects (
352 const char * filepath);
355zrythm_remove_recent_project (
char * filepath);
378zrythm_fetch_latest_release_ver_finish (
379 GAsyncResult * result,
389 GAsyncReadyCallback callback,
390 gpointer callback_data);
409 bool include_system_info);
488 const char * exe_path,
char * zrythm_get_system_info(void)
Returns system info (mainly used for bug reports).
void zrythm_fetch_latest_release_ver_async(GAsyncReadyCallback callback, gpointer callback_data)
void zrythm_free(Zrythm *self)
Frees the instance and any unfreed members.
char * zrythm_get_user_dir(bool force_default)
Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zryth...
Zrythm * zrythm
Global variable, should be available to all files.
ZrythmDirType
Type of Zrythm directory.
Zrythm * zrythm_new(const char *exe_path, bool have_ui, bool testing, bool optimized_dsp)
Creates a new Zrythm instance.
bool zrythm_is_latest_release(const char *remote_latest_release)
Returns whether the given release string is the latest release.
void zrythm_get_version_with_capabilities(char *buf, bool include_system_info)
Returns the version and the capabilities.
NONNULL bool zrythm_init_user_dirs_and_files(Zrythm *self, GError **error)
Initializes/creates the default dirs/files in the user directory.
bool zrythm_is_release(bool official)
Returns whether the current Zrythm version is a release version.
char * zrythm_get_dir(ZrythmDirType type)
Returns a Zrythm directory specified by type.
MALLOC char * zrythm_get_version(bool with_v)
Returns the version string.
char * zrythm_get_prefix(void)
Returns the prefix or in the case of windows the root dir (C/program files/zrythm) or in the case of ...
NONNULL void zrythm_init_templates(Zrythm *self)
Initializes the array of project templates.
char * zrythm_get_default_user_dir(void)
Returns the default user "zrythm" dir.
@ ZRYTHM_DIR_SYSTEM_THEMESDIR
Themes.
@ ZRYTHM_DIR_USER_GDB
Gdb backtrace files.
@ ZRYTHM_DIR_USER_PROJECTS
Subdirs of ZRYTHM_DIR_USER_TOP.
@ ZRYTHM_DIR_USER_BACKTRACE
Backtraces.
@ ZRYTHM_DIR_USER_PROFILING
Profiling files.
@ ZRYTHM_DIR_SYSTEM_PARENT_LIBDIR
libdir name under ZRYTHM_DIR_SYSTEM_PREFIX.
@ ZRYTHM_DIR_SYSTEM_SPECIAL_LV2_PLUGINS_DIR
Special external Zrythm plugins path (not part of the Zrythm source code).
@ ZRYTHM_DIR_SYSTEM_PREFIX
The prefix, or in the case of windows installer the root dir (C/program files/zrythm),...
@ ZRYTHM_DIR_SYSTEM_ZRYTHM_LIBDIR
libdir/zrythm
@ ZRYTHM_DIR_SYSTEM_ZRYTHM_DATADIR
share/zrythm
@ ZRYTHM_DIR_USER_TOP
Main zrythm directory from gsettings.
@ ZRYTHM_DIR_USER_THEMES_CSS
User CSS themes.
@ ZRYTHM_DIR_SYSTEM_SCRIPTSDIR
Scripts.
@ ZRYTHM_DIR_USER_SCRIPTS
User scripts.
@ ZRYTHM_DIR_SYSTEM_BUNDLED_PLUGINSDIR
libdir/zrythm/lv2
@ ZRYTHM_DIR_SYSTEM_BUNDLED_SOURCEVIEW_LANGUAGE_SPECS_DIR
"gtksourceview-5/language-specs" under "share/zrythm".
@ ZRYTHM_DIR_SYSTEM_PARENT_DATADIR
"share" under ZRYTHM_DIR_SYSTEM_PREFIX.
@ ZRYTHM_DIR_SYSTEM_SAMPLESDIR
Samples.
@ ZRYTHM_DIR_SYSTEM_FONTSDIR
The directory fonts/zrythm under datadir.
@ ZRYTHM_DIR_SYSTEM_THEMES_ICONS_DIR
Icon themes.
@ ZRYTHM_DIR_USER_LOG
Log files.
@ ZRYTHM_DIR_USER_THEMES_ICONS
User icon themes.
@ ZRYTHM_DIR_SYSTEM_TEMPLATES
Project templates.
@ ZRYTHM_DIR_SYSTEM_THEMES_CSS_DIR
CSS themes.
@ ZRYTHM_DIR_SYSTEM_BINDIR
"bin" under ZRYTHM_DIR_SYSTEM_PREFIX.
@ ZRYTHM_DIR_SYSTEM_LOCALEDIR
Localization under "share".
@ ZRYTHM_DIR_SYSTEM_SOURCEVIEW_LANGUAGE_SPECS_DIR
"gtksourceview-5/language-specs" under "share".
Chord preset pack manager.
Event manager for the UI.
The PluginManager is responsible for scanning and keeping track of available Plugin's.
Contains all of the info that will be serialized into a project file.
To be used throughout the program.
bool opening_template
Whether the open file is a template to be used to create a new project from.
Symap * symap
String interner for internal things.
FileManager * file_manager
File manager.
bool have_ui
1 if Zrythm has a UI, 0 if headless (eg, when unit-testing).
char ** templates
NULL terminated array of project template absolute paths.
bool debug
In debug mode or not (determined by GSetting).
PCGRand * rand
Random number generator.
char * demo_template
Demo project template used when running for the first time.
RecordingManager * recording_manager
Recording manager.
char * open_filename
Filename to open passed through the command line.
Project * project
Project data.
int undo_stack_len
Undo stack length, used during tests.
GPid pipewire_pid
Process ID for pipewire (used in tests).
double progress
Log settings.
char * recent_projects[MAX_RECENT_PROJECTS+1]
+1 to ensure last element is NULL in case full.
bool generating_project
Whether this is a dummy instance used when generating projects.
char * create_project_path
Path to create a project in, including its title.
bool testing
Used when running the tests.
Symap * error_domain_symap
String interner for error domains.
Settings * settings
Application settings.
bool use_pipewire_in_tests
Whether to use pipewire in tests.
ChordPresetPackManager * chord_preset_pack_manager
Chord preset pack manager.
char * version
Cached version (without 'v').
char * testing_dir
Zrythm directory used during unit tests.
PluginManager * plugin_manager
Manages plugins (loading, instantiating, etc.)
bool open_newer_backup
Whether to open a newer backup if found.
bool use_optimized_dsp
Whether to use optimized DSP when available.
bool creating_project
Whether creating a new project, either from a template or blank.
const char * exe_path
argv[0].