Zrythm
a highly automated and intuitive digital audio workstation
|
Project initialization, saving and loading. More...
Data Structures | |
struct | Project |
Contains all of the info that will be serialized into a project file. More... | |
struct | ProjectSaveData |
Project save data. More... | |
class | Settings |
Macros | |
#define | PROJECT_FORMAT_MAJOR 1 |
#define | PROJECT_FORMAT_MINOR 10 |
#define | PROJECT gZrythm->project |
#define | DEFAULT_PROJECT_NAME "Untitled Project" |
#define | PROJECT_FILE "project.zpj" |
#define | PROJECT_BACKUPS_DIR "backups" |
#define | PROJECT_PLUGINS_DIR "plugins" |
#define | PROJECT_PLUGIN_STATES_DIR "states" |
#define | PROJECT_PLUGIN_EXT_COPIES_DIR "ext_file_copies" |
#define | PROJECT_PLUGIN_EXT_LINKS_DIR "ext_file_links" |
#define | PROJECT_EXPORTS_DIR "exports" |
#define | PROJECT_STEMS_DIR "stems" |
#define | PROJECT_POOL_DIR "pool" |
#define | PROJECT_FINISHED_FILE "FINISHED" |
#define | PROJECT_DECOMPRESS_FILE ProjectCompressionFlag::PROJECT_COMPRESS_FILE |
#define | PROJECT_DECOMPRESS_DATA ProjectCompressionFlag::PROJECT_COMPRESS_DATA |
#define | project_compress(a, b, c, d, e, f, error) _project_compress (true, a, b, c, d, e, f, error) |
#define | project_decompress(a, b, c, d, e, f, error) _project_compress (false, a, b, c, d, e, f, error) |
#define | GSETTINGS_ZRYTHM_PREFIX "org.zrythm.Zrythm" |
#define | SETTINGS (gZrythm->settings) |
#define | S_MONITOR SETTINGS->monitor |
#define | S_UI SETTINGS->ui |
#define | S_EXPORT_AUDIO SETTINGS->export_audio |
#define | S_EXPORT_MIDI SETTINGS->export_midi |
#define | S_GENERAL SETTINGS->general |
#define | S_UI_INSPECTOR SETTINGS->ui_inspector |
#define | S_UI_MIXER SETTINGS->ui_mixer |
#define | S_UI_PANELS SETTINGS->ui_panels |
#define | S_UI_PLUGIN_BROWSER SETTINGS->ui_plugin_browser |
#define | S_UI_FILE_BROWSER SETTINGS->ui_file_browser |
#define | S_TRANSPORT SETTINGS->transport |
#define | S_P_DSP_PAN SETTINGS->preferences_dsp_pan |
#define | S_P_EDITING_AUDIO SETTINGS->preferences_editing_audio |
#define | S_P_EDITING_AUTOMATION SETTINGS->preferences_editing_automation |
#define | S_P_EDITING_UNDO SETTINGS->preferences_editing_undo |
#define | S_P_GENERAL_ENGINE SETTINGS->preferences_general_engine |
#define | S_P_GENERAL_PATHS SETTINGS->preferences_general_paths |
#define | S_P_GENERAL_UPDATES SETTINGS->preferences_general_updates |
#define | S_P_PLUGINS_UIS SETTINGS->preferences_plugins_uis |
#define | S_P_PLUGINS_PATHS SETTINGS->preferences_plugins_paths |
#define | S_P_PROJECTS_GENERAL SETTINGS->preferences_projects_general |
#define | S_P_UI_GENERAL SETTINGS->preferences_ui_general |
#define | S_P_SCRIPTING_GENERAL SETTINGS->preferences_scripting_general |
#define | S_IS_DEBUG (g_settings_get_int (S_GENERAL, "debug")) |
#define | S_SET_ENUM(settings, key, val) g_settings_set_enum (settings, key, val) |
#define | S_GET_ENUM(settings, key) g_settings_get_enum (settings, key) |
#define | S_UI_SET_ENUM(key, val) S_SET_ENUM (S_UI, key, val) |
#define | S_UI_GET_ENUM(key) S_GET_ENUM (S_UI, key) |
#define | S_PLUGIN_SETTINGS SETTINGS->plugin_settings |
#define | S_USER_SHORTCUTS SETTINGS->user_shortcuts |
Typedefs | |
typedef void(* | ProjectInitDoneCallback) (bool success, GError *error, void *user_data) |
Callback to call when project initialization (loading or creating new) finishes. | |
Functions | |
ProjectSaveData * | project_save_data_new (void) |
void | project_save_data_free (ProjectSaveData *self) |
void | project_validate (Project *self) |
Checks that everything is okay with the project. | |
bool | project_fix_audio_regions (Project *self) |
ArrangerSelections * | project_get_arranger_selections_for_last_selection (Project *self) |
void | project_init_common (Project *self) |
WARN_UNUSED_RESULT bool | project_save (Project *self, const char *_dir, const bool is_backup, const bool show_notification, const bool async, GError **error) |
Saves the project to a project file in the given dir. | |
int | project_autosave_cb (void *data) |
Autosave callback. | |
bool | project_make_project_dirs (Project *self, bool is_backup, GError **error) |
MALLOC NONNULL char * | project_get_path (Project *self, ProjectPath path, bool backup) |
Returns the requested project path as a newly allocated string. | |
COLD void | project_init_selections (Project *self) |
Initializes the selections in the project. | |
bool | _project_compress (bool compress, char **_dest, size_t *_dest_size, ProjectCompressionFlag dest_type, const char *_src, const size_t _src_size, ProjectCompressionFlag src_type, GError **error) |
Compresses/decompress a project from a file/data to a file/data. | |
char * | project_get_existing_uncompressed_text (Project *self, bool backup, GError **error) |
Returns the uncompressed text representation of the saved project file. | |
NONNULL Project * | project_clone (const Project *src, bool for_backup, GError **error) |
Deep-clones the given project. | |
COLD NONNULL Project * | project_new (Zrythm *owner) |
Creates an empty project object. | |
void | project_free (Project *self) |
Tears down the project. | |
void | project_init_flow_manager_load_or_create_default_project (const char *filename, const bool is_template, ProjectInitDoneCallback cb, void *user_data) |
If filename set, it loads that, otherwise it loads the default project. | |
void | settings_reset_to_factory (bool confirm, bool exit_on_finish) |
Resets settings to defaults. | |
void | settings_print (int pretty_print) |
Prints the current settings. | |
NONNULL bool | settings_strv_contains_str (GSettings *settings, const char *key, const char *val) |
Returns whether the "as" key contains the given string. | |
NONNULL void | settings_append_to_strv (GSettings *settings, const char *key, const char *val, bool ignore_if_duplicate) |
Appends the given string to a key of type "as". | |
GVariant * | settings_get_range (const char *schema, const char *key) |
void | settings_get_range_double (const char *schema, const char *key, double *lower, double *upper) |
GVariant * | settings_get_default_value (const char *schema, const char *key) |
double | settings_get_default_value_double (const char *schema, const char *key) |
char * | settings_get_summary (GSettings *settings, const char *key) |
Returns the localized summary as a newly allocated string. | |
char * | settings_get_description (GSettings *settings, const char *key) |
Returns the localized description as a newly allocated string. | |
NONNULL bool | Project::project_has_unsaved_changes (const Project *self) |
Project initialization, saving and loading.
#define GSETTINGS_ZRYTHM_PREFIX "org.zrythm.Zrythm" |
Definition at line 26 of file settings.h.
#define project_compress | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
error ) _project_compress (true, a, b, c, d, e, f, error) |
#define project_decompress | ( | a, | |
b, | |||
c, | |||
d, | |||
e, | |||
f, | |||
error ) _project_compress (false, a, b, c, d, e, f, error) |
#define PROJECT_DECOMPRESS_DATA ProjectCompressionFlag::PROJECT_COMPRESS_DATA |
#define PROJECT_DECOMPRESS_FILE ProjectCompressionFlag::PROJECT_COMPRESS_FILE |
#define S_EXPORT_AUDIO SETTINGS->export_audio |
Definition at line 32 of file settings.h.
#define S_EXPORT_MIDI SETTINGS->export_midi |
Definition at line 33 of file settings.h.
#define S_GENERAL SETTINGS->general |
Definition at line 34 of file settings.h.
#define S_GET_ENUM | ( | settings, | |
key ) g_settings_get_enum (settings, key) |
Definition at line 64 of file settings.h.
#define S_IS_DEBUG (g_settings_get_int (S_GENERAL, "debug")) |
Definition at line 60 of file settings.h.
#define S_MONITOR SETTINGS->monitor |
Definition at line 30 of file settings.h.
#define S_P_DSP_PAN SETTINGS->preferences_dsp_pan |
Definition at line 45 of file settings.h.
#define S_P_EDITING_AUDIO SETTINGS->preferences_editing_audio |
Definition at line 46 of file settings.h.
#define S_P_EDITING_AUTOMATION SETTINGS->preferences_editing_automation |
Definition at line 47 of file settings.h.
#define S_P_EDITING_UNDO SETTINGS->preferences_editing_undo |
Definition at line 48 of file settings.h.
#define S_P_GENERAL_ENGINE SETTINGS->preferences_general_engine |
Definition at line 49 of file settings.h.
#define S_P_GENERAL_PATHS SETTINGS->preferences_general_paths |
Definition at line 50 of file settings.h.
#define S_P_GENERAL_UPDATES SETTINGS->preferences_general_updates |
Definition at line 51 of file settings.h.
#define S_P_PLUGINS_PATHS SETTINGS->preferences_plugins_paths |
Definition at line 53 of file settings.h.
#define S_P_PLUGINS_UIS SETTINGS->preferences_plugins_uis |
Definition at line 52 of file settings.h.
#define S_P_PROJECTS_GENERAL SETTINGS->preferences_projects_general |
Definition at line 54 of file settings.h.
#define S_P_SCRIPTING_GENERAL SETTINGS->preferences_scripting_general |
Definition at line 56 of file settings.h.
#define S_P_UI_GENERAL SETTINGS->preferences_ui_general |
Definition at line 55 of file settings.h.
#define S_PLUGIN_SETTINGS SETTINGS->plugin_settings |
Definition at line 70 of file settings.h.
#define S_SET_ENUM | ( | settings, | |
key, | |||
val ) g_settings_set_enum (settings, key, val) |
Definition at line 62 of file settings.h.
#define S_TRANSPORT SETTINGS->transport |
Definition at line 40 of file settings.h.
#define S_UI SETTINGS->ui |
Definition at line 31 of file settings.h.
#define S_UI_FILE_BROWSER SETTINGS->ui_file_browser |
Definition at line 39 of file settings.h.
#define S_UI_GET_ENUM | ( | key | ) | S_GET_ENUM (S_UI, key) |
Definition at line 68 of file settings.h.
#define S_UI_INSPECTOR SETTINGS->ui_inspector |
Definition at line 35 of file settings.h.
#define S_UI_MIXER SETTINGS->ui_mixer |
Definition at line 36 of file settings.h.
#define S_UI_PANELS SETTINGS->ui_panels |
Definition at line 37 of file settings.h.
#define S_UI_PLUGIN_BROWSER SETTINGS->ui_plugin_browser |
Definition at line 38 of file settings.h.
#define S_UI_SET_ENUM | ( | key, | |
val ) S_SET_ENUM (S_UI, key, val) |
Definition at line 66 of file settings.h.
#define S_USER_SHORTCUTS SETTINGS->user_shortcuts |
Definition at line 72 of file settings.h.
#define SETTINGS (gZrythm->settings) |
Definition at line 27 of file settings.h.
typedef void( * ProjectInitDoneCallback) (bool success, GError *error, void *user_data) |
Callback to call when project initialization (loading or creating new) finishes.
Definition at line 25 of file project_init_flow_manager.h.
|
strong |
|
strong |
|
strong |
Selection type, used for controlling which part of the interface is selected, for copy-paste, displaying info in the inspector, etc.
Enumerator | |
---|---|
Z_PROJECT_SELECTION_TYPE_TRACKLIST | Track selection in tracklist or mixer. |
Z_PROJECT_SELECTION_TYPE_TIMELINE | Timeline or pinned timeline. |
Z_PROJECT_SELECTION_TYPE_INSERT | Insert selections in the mixer. |
Z_PROJECT_SELECTION_TYPE_MIDI_FX | MIDI FX selections in the mixer. |
Z_PROJECT_SELECTION_TYPE_INSTRUMENT | Instrument slot. |
Z_PROJECT_SELECTION_TYPE_MODULATOR | Modulator slot. |
Z_PROJECT_SELECTION_TYPE_EDITOR | Editor arranger. |
bool _project_compress | ( | bool | compress, |
char ** | _dest, | ||
size_t * | _dest_size, | ||
ProjectCompressionFlag | dest_type, | ||
const char * | _src, | ||
const size_t | _src_size, | ||
ProjectCompressionFlag | src_type, | ||
GError ** | error ) |
Compresses/decompress a project from a file/data to a file/data.
compress | True to compress, false to decompress. | |
[out] | _dest | Pointer to a location to allocate memory. |
[out] | _dest_size | Pointer to a location to store the size of the allocated memory. |
_src | Input buffer or filepath. | |
_src_size | Input buffer size, if not filepath. |
int project_autosave_cb | ( | void * | data | ) |
Autosave callback.
This will keep getting called at regular short intervals, and if enough time has passed and it's okay to save it will autosave, otherwise it will wait until the next interval and check again.
Deep-clones the given project.
To be used during save on the main thread.
for_backup | Whether the resulting project is for a backup. |
bool project_fix_audio_regions | ( | Project * | self | ) |
char * project_get_existing_uncompressed_text | ( | Project * | self, |
bool | backup, | ||
GError ** | error ) |
Returns the uncompressed text representation of the saved project file.
To be free'd with free().
backup | Whether to use the project file from the most recent backup. |
MALLOC NONNULL char * project_get_path | ( | Project * | self, |
ProjectPath | path, | ||
bool | backup ) |
Returns the requested project path as a newly allocated string.
backup | Whether to get the path for the current backup instead of the main project. |
void project_init_flow_manager_load_or_create_default_project | ( | const char * | filename, |
const bool | is_template, | ||
ProjectInitDoneCallback | cb, | ||
void * | user_data ) |
If filename set, it loads that, otherwise it loads the default project.
filename | The filename to open. This will be the template in the case of template, or the actual project otherwise. |
is_template | Load the project as a template and create a new project from it. |
cb | Callback to call when finished. |
user_data | User data to pass to cb . |
COLD void project_init_selections | ( | Project * | self | ) |
Initializes the selections in the project.
WARN_UNUSED_RESULT bool project_save | ( | Project * | self, |
const char * | _dir, | ||
const bool | is_backup, | ||
const bool | show_notification, | ||
const bool | async, | ||
GError ** | error ) |
Saves the project to a project file in the given dir.
is_backup | 1 if this is a backup. Backups will be saved as <original filename>.bak<num>. |
show_notification | Show a notification in the UI that the project was saved. |
async | Save asynchronously in another thread. |
void settings_reset_to_factory | ( | bool | confirm, |
bool | exit_on_finish ) |
Resets settings to defaults.
confirm | Show command line confirmation option. |
exit_on_finish | Exit with a code on finish. |