38#include "gtk_wrapper.h"
52#define PROJECT_FORMAT_MAJOR 1
53#define PROJECT_FORMAT_MINOR 10
55#define PROJECT gZrythm->project
56#define DEFAULT_PROJECT_NAME "Untitled Project"
57#define PROJECT_FILE "project.zpj"
58#define PROJECT_BACKUPS_DIR "backups"
59#define PROJECT_PLUGINS_DIR "plugins"
60#define PROJECT_PLUGIN_STATES_DIR "states"
61#define PROJECT_PLUGIN_EXT_COPIES_DIR "ext_file_copies"
62#define PROJECT_PLUGIN_EXT_LINKS_DIR "ext_file_links"
63#define PROJECT_EXPORTS_DIR "exports"
64#define PROJECT_STEMS_DIR "stems"
65#define PROJECT_POOL_DIR "pool"
66#define PROJECT_FINISHED_FILE "FINISHED"
70 PROJECT_PATH_PROJECT_FILE,
90 PROJECT_PATH_EXPORTS_STEMS,
94 PROJECT_PATH_FINISHED_FILE,
130 PROJECT_COMPRESS_FILE,
131 PROJECT_COMPRESS_DATA,
134#define PROJECT_DECOMPRESS_FILE ProjectCompressionFlag::PROJECT_COMPRESS_FILE
135#define PROJECT_DECOMPRESS_DATA ProjectCompressionFlag::PROJECT_COMPRESS_DATA
225 double piano_roll_zoom;
313 bool show_notification;
318 ProgressInfo * progress_info;
322project_save_data_new (
void);
340project_get_arranger_selections_for_last_selection (
Project * self);
343project_init_common (
Project * self);
357WARN_UNUSED_RESULT
bool
361 const bool is_backup,
362 const bool show_notification,
378project_make_project_dirs (
Project * self,
bool is_backup, GError ** error);
423 const size_t _src_size,
427#define project_compress(a, b, c, d, e, f, error) \
428 _project_compress (true, a, b, c, d, e, f, error)
430#define project_decompress(a, b, c, d, e, f, error) \
431 _project_compress (false, a, b, c, d, e, f, error)
450project_has_unsaved_changes (
const Project * self);
API for selections in the AudioArrangerWidget.
API for selections in the AutomationArrangerWidget.
The clip/region editor backend.
API for selections in the piano roll.
To be used throughout the program.
API for MIDI notes in the PianoRoll.
Ports that transfer audio/midi/other signals to one another.
A region in the timeline.
bool project_fix_audio_regions(Project *self)
void project_free(Project *self)
Tears down the project.
NONNULL Project * project_clone(const Project *src, bool for_backup, GError **error)
Deep-clones the given project.
void project_validate(Project *self)
Checks that everything is okay with the project.
int project_autosave_cb(void *data)
Autosave callback.
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.
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.
char * project_get_existing_uncompressed_text(Project *self, bool backup, GError **error)
Returns the uncompressed text representation of the saved project file.
COLD void project_init_selections(Project *self)
Initializes the selections in the project.
COLD NONNULL Project * project_new(Zrythm *owner)
Creates an empty project object.
ProjectCompressionFlag
Flag to pass to project_compress() and project_decompress().
ProjectSelectionType
Selection type, used for controlling which part of the interface is selected, for copy-paste,...
MALLOC NONNULL char * project_get_path(Project *self, ProjectPath path, bool backup)
Returns the requested project path as a newly allocated string.
@ PROJECT_PATH_PLUGIN_STATES
Path for state .ttl files.
@ PROJECT_PATH_PLUGINS
Plugins path.
@ PROJECT_PATH_PLUGIN_EXT_COPIES
External files for plugin states, under the STATES dir.
@ PROJECT_PATH_PLUGIN_EXT_LINKS
External files for plugin states, under the STATES dir.
@ Z_PROJECT_SELECTION_TYPE_MODULATOR
Modulator slot.
@ Z_PROJECT_SELECTION_TYPE_INSERT
Insert selections in the mixer.
@ Z_PROJECT_SELECTION_TYPE_EDITOR
Editor arranger.
@ Z_PROJECT_SELECTION_TYPE_TRACKLIST
Track selection in tracklist or mixer.
@ Z_PROJECT_SELECTION_TYPE_INSTRUMENT
Instrument slot.
@ Z_PROJECT_SELECTION_TYPE_MIDI_FX
MIDI FX selections in the mixer.
@ Z_PROJECT_SELECTION_TYPE_TIMELINE
Timeline or pinned timeline.
API for selections in the piano roll.
Mapping MIDI CC to controls.
Port connections manager.
Manager of linked region groups.
Selections to be used for the AudioArrangerWidget's current selections, copying, undoing,...
Selections to be used for the AutomationArrangerWidget's current selections, copying,...
Selections to be used for the ChordArrangerWidget's current selections, copying, undoing,...
Clip editor serializable backend.
A collection of selected MidiNote's.
All MIDI mappings in Zrythm.
Selections to be used for the timeline's current selections, copying, undoing, etc.
Port connections manager.
bool has_error
Whether an error occurred during saving.
Project * project
Project clone (with memcpy).
char * project_file_path
Full path to save to.
bool finished
To be set to true when the thread finishes.
Contains all of the info that will be serialized into a project file.
ChordSelections * chord_selections
Selected objects in the ChordObjectArrangerWidget.
TimelineSelections * timeline_selections
Selected objects in the TimelineArrangerWidget.
Timeline * timeline
Timeline widget backend.
Tool tool
Currently selected tool (select - normal, select - stretch, edit, delete, ramp, audition)
ZixSem save_sem
Semaphore used to block saving.
char * dir
Path to save the project in.
bool loaded
If a project is currently loaded or not.
QuantizeOptions * quantize_opts_editor
Quantize info for the piano roll.
ProjectSelectionType last_selection
The last thing selected in the GUI.
SnapGrid * snap_grid_editor
Snap/Grid info for the editor.
MidiArrangerSelections * midi_arranger_selections
Selected MidiNote's in the MidiArrangerWidget.
UndoableAction * last_saved_action
Used to check if the project has unsaved changes.
QuantizeOptions * quantize_opts_timeline
Quantize info for the timeline.
SnapGrid * snap_grid_timeline
Snap/Grid info for the timeline.
double timeline_zoom
Zoom levels.
AudioEngine * audio_engine
The audio backend.
AutomationSelections * automation_selections
Selected objects in the AutomationArrangerWidget.
char * backup_dir
Backup dir to save the project during the current save call.
int format_major
Used when deserializing projects.
MixerSelections * mixer_selections
Plugin selections in the Mixer.
bool loading_from_backup
Whether the current is currently being loaded from a backup file.
gint64 last_successful_autosave_time
Last successful autosave timestamp.
RegionLinkGroupManager * region_link_group_manager
Manager for region link groups.
UndoableAction * last_action_in_last_successful_autosave
Last undoable action in the previous successful autosave.
char * title
Project title.
char * datetime_str
Datetime string to add to the project file.
ClipEditor * clip_editor
Backend for the widget.
TracklistSelections * tracklist_selections
Selected Track's.
AudioSelections * audio_selections
Selected objects in the audio editor.
char * version
Zrythm version, for serialization.
MidiMappings * midi_mappings
MIDI bindings.
Manager of region link groups.
Selections to be used for the timeline's current selections, copying, undoing, etc.
Clip editor serializable backend.
Selections to be used for the tracklist's current selections, copying, undoing, etc.
The Tracklist contains all the tracks in the Project.
Base struct to be inherited by implementing undoable actions.
Current TimelineArranger selections.