Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
General

Data Structures

struct  Zrythm
 To be used throughout the program. More...
 
struct  ZrythmAppUiMessage
 UI message for the message queue. More...
 
struct  ZrythmApp
 The global struct. More...
 

Macros

#define ZRYTHM   (zrythm)
 
#define ZRYTHM_PROJECTS_DIR   "projects"
 
#define MAX_RECENT_PROJECTS   20
 
#define DEBUGGING   (G_UNLIKELY (ZRYTHM && ZRYTHM->debug))
 
#define ZRYTHM_TESTING   (G_UNLIKELY (ZRYTHM && ZRYTHM->testing))
 
#define ZRYTHM_GENERATING_PROJECT   (ZRYTHM->generating_project)
 
#define ZRYTHM_HAVE_UI   (ZRYTHM && ZRYTHM->have_ui)
 
#define ZRYTHM_USE_OPTIMIZED_DSP   false
 

Enumerations

enum  ZrythmDirType {
  ZRYTHM_DIR_SYSTEM_PREFIX , ZRYTHM_DIR_SYSTEM_BINDIR , ZRYTHM_DIR_SYSTEM_PARENT_DATADIR , ZRYTHM_DIR_SYSTEM_PARENT_LIBDIR ,
  ZRYTHM_DIR_SYSTEM_ZRYTHM_LIBDIR , ZRYTHM_DIR_SYSTEM_BUNDLED_PLUGINSDIR , ZRYTHM_DIR_SYSTEM_LOCALEDIR , ZRYTHM_DIR_SYSTEM_SOURCEVIEW_LANGUAGE_SPECS_DIR ,
  ZRYTHM_DIR_SYSTEM_BUNDLED_SOURCEVIEW_LANGUAGE_SPECS_DIR , ZRYTHM_DIR_SYSTEM_ZRYTHM_DATADIR , ZRYTHM_DIR_SYSTEM_SAMPLESDIR , ZRYTHM_DIR_SYSTEM_SCRIPTSDIR ,
  ZRYTHM_DIR_SYSTEM_THEMESDIR , ZRYTHM_DIR_SYSTEM_THEMES_CSS_DIR , ZRYTHM_DIR_SYSTEM_THEMES_ICONS_DIR , ZRYTHM_DIR_SYSTEM_SPECIAL_LV2_PLUGINS_DIR ,
  ZRYTHM_DIR_SYSTEM_FONTSDIR , ZRYTHM_DIR_SYSTEM_TEMPLATES , ZRYTHM_DIR_USER_TOP , ZRYTHM_DIR_USER_PROJECTS ,
  ZRYTHM_DIR_USER_TEMPLATES , ZRYTHM_DIR_USER_THEMES , ZRYTHM_DIR_USER_THEMES_CSS , ZRYTHM_DIR_USER_THEMES_ICONS ,
  ZRYTHM_DIR_USER_SCRIPTS , ZRYTHM_DIR_USER_LOG , ZRYTHM_DIR_USER_PROFILING , ZRYTHM_DIR_USER_GDB ,
  ZRYTHM_DIR_USER_BACKTRACE
}
 Type of Zrythm directory. More...
 

Functions

void zrythm_add_to_recent_projects (Zrythm *self, const char *filepath)
 
void zrythm_remove_recent_project (char *filepath)
 
MALLOC char * zrythm_get_version (bool with_v)
 Returns the version string.
 
bool zrythm_is_release (bool official)
 Returns whether the current Zrythm version is a release version.
 
char * zrythm_fetch_latest_release_ver_finish (GAsyncResult *result, GError **error)
 
void zrythm_fetch_latest_release_ver_async (GAsyncReadyCallback callback, gpointer callback_data)
 
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.
 
char * zrythm_get_system_info (void)
 Returns system info (mainly used for bug reports).
 
char * zrythm_get_default_user_dir (void)
 Returns the default user "zrythm" dir.
 
char * zrythm_get_dir (ZrythmDirType type)
 Returns a Zrythm directory specified by type.
 
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 macos the bundle path.
 
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/zrythm).
 
NONNULL bool zrythm_init_user_dirs_and_files (Zrythm *self, GError **error)
 Initializes/creates the default dirs/files in the user directory.
 
NONNULL void zrythm_init_templates (Zrythm *self)
 Initializes the array of project templates.
 
Zrythmzrythm_new (const char *exe_path, bool have_ui, bool testing, bool optimized_dsp)
 Creates a new Zrythm instance.
 
void zrythm_free (Zrythm *self)
 Frees the instance and any unfreed members.
 
ZrythmAppUiMessagezrythm_app_ui_message_new (GtkMessageType type, const char *msg)
 
void zrythm_app_ui_message_free (ZrythmAppUiMessage *self)
 
ZrythmApp * zrythm_app_new (int argc, const char **argv)
 Creates the Zrythm GApplication.
 
void zrythm_app_set_font_scale (ZrythmApp *self, double font_scale)
 
void zrythm_app_check_for_updates (ZrythmApp *self)
 Handles the logic for checking for updates on startup.
 
int zrythm_app_prompt_for_project_func (ZrythmApp *self)
 Unlike the init thread, this will run in the main GTK thread.
 
ZrythmApp ** zrythm_app_get (void)
 Returns a pointer to the global zrythm_app.
 
bool zrythm_app_check_and_show_trial_limit_error (ZrythmApp *self)
 Shows the trial limitation error message.
 
void * zrythm_app_init_thread (ZrythmApp *self)
 
void zrythm_exit_response_callback (AdwDialog *dialog, gpointer user_data)
 To be used to exit Zrythm using the "response" signal on a message dialog.
 

Variables

Zrythmzrythm
 Global variable, should be available to all files.
 
ZrythmApp * zrythm_app
 Global variable, should be available to all files.
 

Detailed Description

Uncategorized.

Macro Definition Documentation

◆ DEBUGGING

#define DEBUGGING   (G_UNLIKELY (ZRYTHM && ZRYTHM->debug))

Definition at line 45 of file zrythm.h.

◆ MAX_RECENT_PROJECTS

#define MAX_RECENT_PROJECTS   20

Definition at line 44 of file zrythm.h.

◆ ZRYTHM

#define ZRYTHM   (zrythm)

Definition at line 40 of file zrythm.h.

◆ ZRYTHM_GENERATING_PROJECT

#define ZRYTHM_GENERATING_PROJECT   (ZRYTHM->generating_project)

Definition at line 47 of file zrythm.h.

◆ ZRYTHM_HAVE_UI

#define ZRYTHM_HAVE_UI   (ZRYTHM && ZRYTHM->have_ui)

Definition at line 48 of file zrythm.h.

◆ ZRYTHM_PROJECTS_DIR

#define ZRYTHM_PROJECTS_DIR   "projects"

Definition at line 42 of file zrythm.h.

◆ ZRYTHM_TESTING

#define ZRYTHM_TESTING   (G_UNLIKELY (ZRYTHM && ZRYTHM->testing))

Definition at line 46 of file zrythm.h.

◆ ZRYTHM_USE_OPTIMIZED_DSP

#define ZRYTHM_USE_OPTIMIZED_DSP   false

Definition at line 53 of file zrythm.h.

Enumeration Type Documentation

◆ ZrythmDirType

Type of Zrythm directory.

Enumerator
ZRYTHM_DIR_SYSTEM_PREFIX 

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

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

ZRYTHM_DIR_SYSTEM_BINDIR 

"bin" under ZRYTHM_DIR_SYSTEM_PREFIX.

ZRYTHM_DIR_SYSTEM_PARENT_DATADIR 

"share" under ZRYTHM_DIR_SYSTEM_PREFIX.

ZRYTHM_DIR_SYSTEM_PARENT_LIBDIR 

libdir name under ZRYTHM_DIR_SYSTEM_PREFIX.

ZRYTHM_DIR_SYSTEM_ZRYTHM_LIBDIR 

libdir/zrythm

ZRYTHM_DIR_SYSTEM_BUNDLED_PLUGINSDIR 

libdir/zrythm/lv2

ZRYTHM_DIR_SYSTEM_LOCALEDIR 

Localization under "share".

ZRYTHM_DIR_SYSTEM_SOURCEVIEW_LANGUAGE_SPECS_DIR 

"gtksourceview-5/language-specs" under "share".

ZRYTHM_DIR_SYSTEM_BUNDLED_SOURCEVIEW_LANGUAGE_SPECS_DIR 

"gtksourceview-5/language-specs" under "share/zrythm".

ZRYTHM_DIR_SYSTEM_ZRYTHM_DATADIR 

share/zrythm

ZRYTHM_DIR_SYSTEM_SAMPLESDIR 

Samples.

ZRYTHM_DIR_SYSTEM_SCRIPTSDIR 

Scripts.

ZRYTHM_DIR_SYSTEM_THEMESDIR 

Themes.

ZRYTHM_DIR_SYSTEM_THEMES_CSS_DIR 

CSS themes.

ZRYTHM_DIR_SYSTEM_THEMES_ICONS_DIR 

Icon themes.

ZRYTHM_DIR_SYSTEM_SPECIAL_LV2_PLUGINS_DIR 

Special external Zrythm plugins path (not part of the Zrythm source code).

Used for ZLFO and other plugins.

ZRYTHM_DIR_SYSTEM_FONTSDIR 

The directory fonts/zrythm under datadir.

ZRYTHM_DIR_SYSTEM_TEMPLATES 

Project templates.

ZRYTHM_DIR_USER_TOP 

Main zrythm directory from gsettings.

ZRYTHM_DIR_USER_PROJECTS 

Subdirs of ZRYTHM_DIR_USER_TOP.

ZRYTHM_DIR_USER_THEMES_CSS 

User CSS themes.

ZRYTHM_DIR_USER_THEMES_ICONS 

User icon themes.

ZRYTHM_DIR_USER_SCRIPTS 

User scripts.

ZRYTHM_DIR_USER_LOG 

Log files.

ZRYTHM_DIR_USER_PROFILING 

Profiling files.

ZRYTHM_DIR_USER_GDB 

Gdb backtrace files.

ZRYTHM_DIR_USER_BACKTRACE 

Backtraces.

Definition at line 59 of file zrythm.h.

Function Documentation

◆ zrythm_app_check_and_show_trial_limit_error()

bool zrythm_app_check_and_show_trial_limit_error ( ZrythmApp * self)

Shows the trial limitation error message.

Returns
Whether the limit was reached.

◆ zrythm_app_new()

ZrythmApp * zrythm_app_new ( int argc,
const char ** argv )

Creates the Zrythm GApplication.

This also initializes the Zrythm struct.

◆ zrythm_app_prompt_for_project_func()

int zrythm_app_prompt_for_project_func ( ZrythmApp * self)

Unlike the init thread, this will run in the main GTK thread.

Do not put expensive logic here.

This should be ran after the expensive initialization has finished.

◆ zrythm_fetch_latest_release_ver_async()

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

◆ zrythm_get_default_user_dir()

char * zrythm_get_default_user_dir ( void )

Returns the default user "zrythm" dir.

This is used when resetting or when the dir is not selected by the user yet.

◆ zrythm_get_dir()

char * zrythm_get_dir ( ZrythmDirType type)

Returns a Zrythm directory specified by type.

Returns
A newly allocated string.

◆ zrythm_get_prefix()

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 macos the bundle path.

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

Returns
A newly allocated string.

◆ zrythm_get_user_dir()

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/zrythm).

Parameters
force_defaultIgnore the settings and get the default dir.

Must be free'd by caller.

◆ zrythm_get_version()

MALLOC char * zrythm_get_version ( bool with_v)

Returns the version string.

Must be g_free()'d.

Parameters
with_vInclude a starting "v".

◆ zrythm_get_version_with_capabilities()

void zrythm_get_version_with_capabilities ( char * buf,
bool include_system_info )

Returns the version and the capabilities.

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

◆ zrythm_init_user_dirs_and_files()

NONNULL bool zrythm_init_user_dirs_and_files ( Zrythm * self,
GError ** error )

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

Returns
Whether successful.

◆ zrythm_is_release()

bool zrythm_is_release ( bool official)

Returns whether the current Zrythm version is a release version.

Note
This only does regex checking.

◆ zrythm_new()

Zrythm * zrythm_new ( const char * exe_path,
bool have_ui,
bool testing,
bool optimized_dsp )

Creates a new Zrythm instance.

Parameters
have_uiWhether Zrythm is instantiated with a UI (false if headless).
testingWhether this is a unit test.