diff options
author | David Robillard <d@drobilla.net> | 2015-02-19 09:38:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-02-19 09:38:37 +0000 |
commit | 6672e5727516eea194ca278731280cd08f1d3937 (patch) | |
tree | 18805dfc887c4ec1b0c5b027d8ed37cd8221bb9a /src | |
parent | 765929f0b2194171c7f793dc01e227830533c420 (diff) | |
download | lilv-6672e5727516eea194ca278731280cd08f1d3937.tar.gz lilv-6672e5727516eea194ca278731280cd08f1d3937.tar.bz2 lilv-6672e5727516eea194ca278731280cd08f1d3937.zip |
Add lilv_state_emit_port_values() for special port value handling.
git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@5586 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/state.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/state.c b/src/state.c index 03ad488..f75a2bb 100644 --- a/src/state.c +++ b/src/state.c @@ -399,6 +399,17 @@ lilv_state_new_from_instance(const LilvPlugin* plugin, } LILV_API void +lilv_state_emit_port_values(const LilvState* state, + LilvSetPortValueFunc set_value, + void* user_data) +{ + for (uint32_t i = 0; i < state->num_values; ++i) { + const PortValue* val = &state->values[i]; + set_value(val->symbol, user_data, val->value, val->size, val->type); + } +} + +LILV_API void lilv_state_restore(const LilvState* state, LilvInstance* instance, LilvSetPortValueFunc set_value, @@ -410,7 +421,7 @@ lilv_state_restore(const LilvState* state, LILV_ERROR("lilv_state_restore() called on NULL state\n"); return; } - + LV2_State_Map_Path map_path = { (LilvState*)state, abstract_path, absolute_path }; LV2_Feature map_feature = { LV2_STATE__mapPath, &map_path }; @@ -430,11 +441,7 @@ lilv_state_restore(const LilvState* state, free(sfeatures); if (set_value) { - for (uint32_t i = 0; i < state->num_values; ++i) { - const PortValue* val = &state->values[i]; - set_value(val->symbol, user_data, - val->value, val->size, val->type); - } + lilv_state_emit_port_values(state, set_value, user_data); } } |