|
Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
|
Handles serialization, deserialization, and validation of project JSON. More...
#include <src/controllers/project_json_serializer.h>

Static Public Member Functions | |
| static nlohmann::json | serialize (const structure::project::Project &project, const structure::project::ProjectUiState &ui_state, const undo::UndoStack &undo_stack, const utils::Version &app_version, std::string_view title) |
| Returns a json representation of the project. | |
| static void | validate_json (const nlohmann::json &j) |
| Validates JSON against the project schema. | |
| static void | deserialize (const nlohmann::json &j, structure::project::Project &project, structure::project::ProjectUiState &ui_state, undo::UndoStack &undo_stack) |
| Loads and validates a project from JSON. | |
Static Public Attributes | |
| static constexpr utils::Version | SCHEMA_VERSION { 2, 1, {} } |
| static constexpr auto | DOCUMENT_TYPE = "ZrythmProject"sv |
| static constexpr auto | kProjectData = "projectData"sv |
| static constexpr auto | kUiState = "uiState"sv |
| static constexpr auto | kUndoHistory = "undoHistory"sv |
| static constexpr auto | kDatetimeKey = "datetime"sv |
| static constexpr auto | kTitle = "title"sv |
Handles serialization, deserialization, and validation of project JSON.
This class coordinates the serialization of all project-related data:
The output follows the project schema (data/schemas/project.schema.json).
Definition at line 38 of file project_json_serializer.h.
|
static |
Loads and validates a project from JSON.
| j | The JSON to deserialize. |
| project | The project instance to populate. |
| ui_state | The UI state instance to populate. |
| undo_stack | The undo stack instance to populate. |
| std::runtime_error | on validation or load error. |
|
static |
Returns a json representation of the project.
| project | The project to serialize. |
| ui_state | The UI state to serialize. |
| undo_stack | The undo stack to serialize. |
| app_version | Version of the application. |
| title | Project title. |
| std::runtime_error | on error. |
|
static |
Validates JSON against the project schema.
| j | The JSON to validate. |
| std::runtime_error | if validation fails. |
|
staticconstexpr |
Definition at line 42 of file project_json_serializer.h.
|
staticconstexpr |
Definition at line 46 of file project_json_serializer.h.
|
staticconstexpr |
Definition at line 43 of file project_json_serializer.h.
|
staticconstexpr |
Definition at line 47 of file project_json_serializer.h.
|
staticconstexpr |
Definition at line 44 of file project_json_serializer.h.
|
staticconstexpr |
Definition at line 45 of file project_json_serializer.h.
|
staticconstexpr |
Definition at line 41 of file project_json_serializer.h.