From e36a95bd35301c5343e593ef385f8b7573d9d606 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 23 Dec 2011 02:42:33 +0000 Subject: Use new LilvState API for state/presets. git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3900 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv_internal.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/jalv_internal.h') diff --git a/src/jalv_internal.h b/src/jalv_internal.h index d5f29f5..e4f65ec 100644 --- a/src/jalv_internal.h +++ b/src/jalv_internal.h @@ -63,11 +63,6 @@ struct Port { bool old_api; /**< True for event, false for atom */ }; -typedef struct PluginStateImpl PluginState; - -const LilvNode* -plugin_state_get_plugin_uri(const PluginState* state); - /** Control change event, sent through ring buffers for UI updates. */ @@ -173,11 +168,8 @@ jalv_save_port_values(Jalv* jalv, SerdWriter* writer, const SerdNode* subject); -PluginState* -jalv_load_state(Jalv* jalv, const char* dir); - void -jalv_apply_state(Jalv* jalv, PluginState* state); +jalv_apply_state(Jalv* jalv, LilvState* state); static inline char* jalv_strdup(const char* str) @@ -188,6 +180,20 @@ jalv_strdup(const char* str) return copy; } +static inline char* +jalv_strjoin(const char* a, const char* b) +{ + const size_t a_len = strlen(a); + const size_t b_len = strlen(b); + char* const out = (char*)malloc(a_len + b_len + 1); + + memcpy(out, a, a_len); + memcpy(out + a_len, b, b_len); + out[a_len + b_len] = '\0'; + + return out; +} + #ifdef __cplusplus } // extern "C" #endif -- cgit v1.2.1