Update for latest LV2 Persist extension.
authorDavid Robillard <d@drobilla.net>
Tue, 29 Mar 2011 21:07:36 +0000 (21:07 +0000)
committerDavid Robillard <d@drobilla.net>
Tue, 29 Mar 2011 21:07:36 +0000 (21:07 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9240 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/lv2_plugin.h
libs/ardour/lv2_plugin.cc
libs/ardour/lv2ext/lv2_persist.h

index fff58464b3a4dd7375f5a354e53de3a2cce79b4b..b720c3614633474f1ec5eb2fb8c4baf934479dba 100644 (file)
@@ -150,7 +150,6 @@ class LV2Plugin : public ARDOUR::Plugin
        static uint32_t _midi_event_type;
 
        static int lv2_persist_store_callback (void*       callback_data,
-                                              uint32_t    subject,
                                               uint32_t    key,
                                               const void* value,
                                               size_t      size,
@@ -158,7 +157,6 @@ class LV2Plugin : public ARDOUR::Plugin
                                               uint32_t    flags);
 
        static const void* lv2_persist_retrieve_callback (void*     callback_data,
-                                                         uint32_t  subject,
                                                          uint32_t  key,
                                                          size_t*   size,
                                                          uint32_t* type,
index bbcf6d8c38eae29c98fcb88be04e03ee33446c48..359e1aa5f5207530116507f10fd2951d42219142 100644 (file)
@@ -329,8 +329,7 @@ struct PersistState {
                return 0;
        }
 
-       int add_value(uint32_t    file_subject,
-                     uint32_t    file_key,
+       int add_value(uint32_t    file_key,
                      const void* value,
                      size_t      size,
                      uint32_t    file_type,
@@ -362,7 +361,6 @@ struct PersistState {
 
 int
 LV2Plugin::lv2_persist_store_callback(void*       callback_data,
-                                      uint32_t    subject,
                                       uint32_t    key,
                                       const void* value,
                                       size_t      size,
@@ -375,12 +373,11 @@ LV2Plugin::lv2_persist_store_callback(void*       callback_data,
        PersistState* state = (PersistState*)callback_data;
        state->add_uri(key,  _uri_map.id_to_uri(NULL, key)); 
        state->add_uri(type, _uri_map.id_to_uri(NULL, type)); 
-       return state->add_value(subject, key, value, size, type, flags);
+       return state->add_value(key, value, size, type, flags);
 }
 
 const void*
 LV2Plugin::lv2_persist_retrieve_callback(void*     callback_data,
-                                         uint32_t  subject,
                                          uint32_t  key,
                                          size_t*   size,
                                          uint32_t* type,
@@ -653,8 +650,7 @@ LV2Plugin::set_state(const XMLNode& node, int version)
                                        printf("READ VAL %u = %s (size: %u type: %u)\n",
                                               body->predicate, body->object,
                                               body->object_size, body->object_type);
-                                       state.add_value(body->subject,
-                                                       body->predicate,
+                                       state.add_value(body->predicate,
                                                        body->object,
                                                        body->object_size,
                                                        body->object_type,
index f225709b65ef6e15a327673fda7065581d90403a..6879a865ba6cba13f4a04a2d7ce0ec12d05c72fb 100644 (file)
@@ -1,6 +1,6 @@
 /*
-  Copyright (C) 2010-2011 David Robillard <http://drobilla.net>
-  Copyright (C) 2010 Leonard Ritter <paniq@paniq.org>
+  Copyright 2010-2011 David Robillard <http://drobilla.net>
+  Copyright 2010 Leonard Ritter <paniq@paniq.org>
 
   This header is free software; you can redistribute it and/or modify it
   under the terms of the GNU Lesser General Public License as published
@@ -68,9 +68,8 @@ typedef enum {
 } LV2_Persist_Flags;
 
 /**
-   A host-provided function to store a property.
+   A host-provided function to store a plugin instance property.
    @param callback_data Must be the callback_data passed to LV2_Persist.save().
-   @param subject The subject of this property (URI), or 0 for plugin instance.
    @param key The key (predicate) to store @a value under (URI mapped integer).
    @param value Pointer to the value (object) to be stored.
    @param size The size of the data at @a value in bytes.
@@ -82,7 +81,7 @@ typedef enum {
    is called repeatedly by the plugin within LV2_Persist.save() to store all
    the statements that describe its current state.
 
-   The host MAY fail to store a statement if the type is not understood and is
+   The host MAY fail to store a property if the type is not understood and is
    not LV2_PERSIST_IS_POD and/or LV2_PERSIST_IS_PORTABLE. Implementations are
    encouraged to use POD and portable values (e.g. string literals) wherever
    possible, and use common types (e.g. types from
@@ -97,7 +96,6 @@ typedef enum {
 */
 typedef int (*LV2_Persist_Store_Function)(
        void*       callback_data,
-       uint32_t    subject,
        uint32_t    key,
        const void* value,
        size_t      size,
@@ -107,7 +105,6 @@ typedef int (*LV2_Persist_Store_Function)(
 /**
    A host-provided function to retrieve a property.
    @param callback_data Must be the callback_data passed to LV2_Persist.restore().
-   @param subject The subject of the property (URI), or 0 for plugin instance.
    @param key The key (predicate) of the property to retrieve (URI).
    @param size (Output) If non-NULL, set to the size of the restored value.
    @param type (Output) If non-NULL, set to the type of the restored value.
@@ -129,7 +126,6 @@ typedef int (*LV2_Persist_Store_Function)(
 */
 typedef const void* (*LV2_Persist_Retrieve_Function)(
        void*     callback_data,
-       uint32_t  subject,
        uint32_t  key,
        size_t*   size,
        uint32_t* type,