Zrythm
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
lv2_state.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: © 2018-2021 Alexandros Theodotou <alex@zrythm.org>
3 *
4 * SPDX-License-Identifier: LicenseRef-ZrythmLicense
5 */
6
13#ifndef __PLUGINS_LV2_LV2_STATE_H__
14#define __PLUGINS_LV2_LV2_STATE_H__
15
16#include "zrythm-config.h"
17
18#include <glib.h>
19
20#include <lilv/lilv.h>
21#include <lv2/state/state.h>
22
23typedef struct Lv2Plugin Lv2Plugin;
24
31typedef int (*PresetSink) (
33 const LilvNode * node,
34 const LilvNode * title,
35 void * data);
36
37/* handled by lilv */
38#if 0
43char *
44lv2_state_get_abstract_path (
45 LV2_State_Map_Path_Handle handle,
46 const char * absolute_path);
47
52char *
53lv2_state_get_absolute_path (
54 LV2_State_Map_Path_Handle handle,
55 const char * abstract_path);
56
60void
61lv2_state_free_path (
62 LV2_State_Free_Path_Handle handle,
63 char * path);
64
71char *
72lv2_state_make_path_save (
73 LV2_State_Make_Path_Handle handle,
74 const char* path);
75#endif
76
77NONNULL void
78lv2_state_apply_state (Lv2Plugin * plugin, LilvState * state);
79
84WARN_UNUSED_RESULT NONNULL LilvState *
85lv2_state_save_to_file (Lv2Plugin * pl, bool is_backup);
86
94LilvState *
96
101LilvState *
102lv2_state_save_to_string (Lv2Plugin * pl, bool is_backup);
103
110char *
111lv2_state_make_path_temp (LV2_State_Make_Path_Handle handle, const char * path);
112
116int
119 const char * dir,
120 const char * uri,
121 const char * label,
122 const char * filename);
123
130bool
133 const LilvNode * preset,
134 const char * path,
135 GError ** error);
136
140int
142
143int
144lv2_state_load_presets (Lv2Plugin * plugin, PresetSink sink, void * data);
145
146int
147lv2_state_unload_presets (Lv2Plugin * plugin);
148
153#endif
int lv2_state_save_preset(Lv2Plugin *plugin, const char *dir, const char *uri, const char *label, const char *filename)
Saves the preset.
bool lv2_state_apply_preset(Lv2Plugin *plugin, const LilvNode *preset, const char *path, GError **error)
Applies the given preset, or the preset in the path if preset is NULL.
WARN_UNUSED_RESULT NONNULL LilvState * lv2_state_save_to_file(Lv2Plugin *pl, bool is_backup)
Saves the plugin state to the filesystem and returns the state.
char * lv2_state_make_path_temp(LV2_State_Make_Path_Handle handle, const char *path)
LV2 State makePath feature for temporary files.
int lv2_state_delete_current_preset(Lv2Plugin *plugin)
Deletes the current preset.
LilvState * lv2_state_save_to_memory(Lv2Plugin *plugin)
Saves the plugin state into a new LilvState that can be applied to any plugin with the same URI (like...
LilvState * lv2_state_save_to_string(Lv2Plugin *pl, bool is_backup)
Saves the plugin state to a string after writing the required files.
LV2 plugin.
Definition lv2_plugin.h:141
LilvState * preset
Current preset.
Definition lv2_plugin.h:218
Plugin * plugin
Base Plugin instance (parent).
Definition lv2_plugin.h:308