Project module

Contents

Classes

struct Project
Contains all of the info that will be serialized into a project file.

Enums

enum SelectionType { SELECTION_TYPE_TRACK, SELECTION_TYPE_PLUGIN, SELECTION_TYPE_EDITOR }
Selection type, used for displaying info in the inspector.

Typedefs

using SelectionType = enum SelectionType
Selection type, used for displaying info in the inspector.
using Project = struct Project
Contains all of the info that will be serialized into a project file.

Functions

void project_sanity_check(Project* self)
Checks that everything is okay with the project.
auto project_load(char* filename, const int is_template) -> int
If project has a filename set, it loads that.
auto project_save(Project* self, const char* _dir, const int is_backup, const int show_notification) -> int
Saves the project to a project file in the given dir.
auto project_autosave_cb(void* data) -> int
Autosave callback.
auto project_get_backups_dir(Project* self) -> char*
Returns the backups dir for the given Project.
auto project_get_exports_dir(Project* self) -> char*
Returns the exports dir for the given Project.
auto project_get_states_dir(Project* self, const int is_backup) -> char*
Returns the states dir for the given Project.
auto project_get_pool_dir(Project* self) -> char*
Returns the pool dir for the given Project.
auto project_get_project_file_path(Project* self, const int is_backup) -> char*
Returns the full project file (project.yml) path.
void project_set_has_range(int has_range)
Sets if the project has range and updates UI.

Function documentation

int project_load(char* filename, const int is_template)

If project has a filename set, it loads that.

Parameters
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.
Returns 0 if successful, non-zero otherwise.

Otherwise it loads the default project.

Otherwise it loads the default project.

int project_save(Project* self, const char* _dir, const int is_backup, const int show_notification)

Saves the project to a project file in the given dir.

Parameters
self
_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.

char* project_get_exports_dir(Project* self)

Returns the exports dir for the given Project.

Must be g_free()'d.

char* project_get_states_dir(Project* self, const int is_backup)

Returns the states dir for the given Project.

Parameters
self
is_backup 1 to get the states dir of the current backup instead of the main project.

char* project_get_pool_dir(Project* self)

Returns the pool dir for the given Project.

Returns the pool dir for the given Project.

char* project_get_project_file_path(Project* self, const int is_backup)

Returns the full project file (project.yml) path.

Parameters
self
is_backup 1 to get the states dir of the current backup instead of the main project.