13#include "zrythm-config.h"
20#include "ext/juce/juce.h"
33typedef struct PCGRand PCGRand;
42#define ZRYTHM_PROJECTS_DIR "projects"
44#define MAX_RECENT_PROJECTS 20
45#define DEBUGGING (G_UNLIKELY (gZrythm && gZrythm->debug))
46#define ZRYTHM_TESTING (g_test_initialized ())
47#define ZRYTHM_GENERATING_PROJECT (gZrythm->generating_project)
48#define ZRYTHM_HAVE_UI (gZrythm && gZrythm->have_ui_)
51# define ZRYTHM_USE_OPTIMIZED_DSP (G_LIKELY (gZrythm->use_optimized_dsp))
53# define ZRYTHM_USE_OPTIMIZED_DSP false
152 ZRYTHM_DIR_USER_TEMPLATES,
153 ZRYTHM_DIR_USER_THEMES,
222 explicit Zrythm (
const char * exe_path,
bool have_ui,
bool optimized_dsp);
228 void add_to_recent_projects (
const char * filepath);
230 void remove_recent_project (
char * filepath);
250 fetch_latest_release_ver_finish (GAsyncResult * result, GError ** error);
258 GAsyncReadyCallback callback,
259 gpointer callback_data);
373 std::unique_ptr<ZrythmDirectoryManager> dir_mgr;
432 JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (
Zrythm)
438extern std::unique_ptr<Zrythm>
gZrythm;
String array that auto-converts given char pointers to UTF8 (so JUCE doesn't complain.
char * get_user_dir(bool force_default)
Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zryth...
char * get_default_user_dir()
Returns the default user "zrythm" dir.
char * testing_dir
Zrythm directory used during unit tests.
char * get_dir(ZrythmDirType type)
Returns a Zrythm directory specified by type.
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 init_user_dirs_and_files(GError **error)
Initializes/creates the default dirs/files in the user directory.
bool have_ui_
1 if Zrythm has a UI, 0 if headless (eg, when unit-testing).
std::unique_ptr< Settings > settings
Application settings.
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.
static char * get_version(bool with_v)
Returns the version string.
static void fetch_latest_release_ver_async(GAsyncReadyCallback callback, gpointer callback_data)
Project * project
Project data.
int undo_stack_len
Undo stack length, used during tests.
static void get_version_with_capabilities(char *buf, bool include_system_info)
Returns the version and the capabilities.
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 ...
const char * exe_path_
argv[0].
GPid pipewire_pid
Process ID for pipewire (used in tests).
std::unique_ptr< StringArray > recent_projects_
+1 to ensure last element is NULL in case full.
bool generating_project
Whether this is a dummy instance used when generating projects.
static bool is_latest_release(const char *remote_latest_release)
Returns whether the given release string is the latest release.
char * create_project_path
Path to create a project in, including its title.
void init_templates()
Initializes the array of project templates.
Symap * error_domain_symap
String interner for error domains.
bool use_pipewire_in_tests
Whether to use pipewire in tests.
ChordPresetPackManager * chord_preset_pack_manager
Chord preset pack manager.
static char * get_system_info()
Returns system info (mainly used for bug reports).
char * version
Cached version (without 'v').
Zrythm(const char *exe_path, bool have_ui, bool optimized_dsp)
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.
static bool is_release(bool official)
Returns whether the current Zrythm version is a release version.
bool creating_project
Whether creating a new project, either from a template or blank.
ZrythmDirType
Type of Zrythm directory.
std::unique_ptr< Zrythm > gZrythm
Global variable, should be available to all files.
@ 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.