summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour/lv2_plugin.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-01-28 01:45:15 +0000
committerDavid Robillard <d@drobilla.net>2012-01-28 01:45:15 +0000
commit2858d439020af4d3084d64d36776d77655eb293b (patch)
treea997682b285e8ec358fc6551bac830ee196d4f90 /libs/ardour/ardour/lv2_plugin.h
parent66cd3d365cd798045364493426aab11ca7421b01 (diff)
Use new Lilv state API to save LV2 plugin state.
This saves a complete history of plugin state, i.e. save is no longer destructive. However, data is shared as much as possible, and new state is only written if the plugin state has actually changed. There is exactly one link in the entire session directory to any external file, so archiving will work with minimal copying. Not sure sure about the naming of the "externals" directory, but I have nothing better... git-svn-id: svn://localhost/ardour2/branches/3.0@11372 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/lv2_plugin.h')
-rw-r--r--libs/ardour/ardour/lv2_plugin.h53
1 files changed, 19 insertions, 34 deletions
diff --git a/libs/ardour/ardour/lv2_plugin.h b/libs/ardour/ardour/lv2_plugin.h
index a627c2eb43..6d68ca2674 100644
--- a/libs/ardour/ardour/lv2_plugin.h
+++ b/libs/ardour/ardour/lv2_plugin.h
@@ -120,16 +120,16 @@ class LV2Plugin : public ARDOUR::Plugin
private:
struct Impl;
- Impl* _impl;
- void* _module;
- LV2_Feature** _features;
- framecnt_t _sample_rate;
- float* _control_data;
- float* _shadow_data;
- float* _defaults;
- float* _latency_control_port;
- bool _was_activated;
- bool _has_state_interface;
+ Impl* _impl;
+ void* _module;
+ LV2_Feature** _features;
+ framecnt_t _sample_rate;
+ float* _control_data;
+ float* _shadow_data;
+ float* _defaults;
+ float* _latency_control_port;
+ PBD::ID _insert_id;
+
std::vector<bool> _port_is_input;
std::vector<bool> _port_is_output;
std::vector<bool> _port_is_midi;
@@ -138,8 +138,6 @@ class LV2Plugin : public ARDOUR::Plugin
std::map<std::string,uint32_t> _port_indices;
- PBD::ID _insert_id;
-
typedef struct {
const void* (*extension_data) (const char* uri);
} LV2_DataAccess;
@@ -147,34 +145,21 @@ class LV2Plugin : public ARDOUR::Plugin
LV2_DataAccess _data_access_extension_data;
LV2_Feature _data_access_feature;
LV2_Feature _instance_access_feature;
- LV2_Feature _map_path_feature;
LV2_Feature _make_path_feature;
+ mutable unsigned _state_version;
+
+ bool _was_activated;
+ bool _has_state_interface;
+
static URIMap _uri_map;
static uint32_t _midi_event_type;
static uint32_t _state_path_type;
- const std::string state_dir () const;
-
- static int
- lv2_state_store_callback (void* handle,
- uint32_t key,
- const void* value,
- size_t size,
- uint32_t type,
- uint32_t flags);
-
- static const void*
- lv2_state_retrieve_callback (void* handle,
- uint32_t key,
- size_t* size,
- uint32_t* type,
- uint32_t* flags);
-
- static char* lv2_state_abstract_path (void* host_data,
- const char* absolute_path);
- static char* lv2_state_absolute_path (void* host_data,
- const char* abstract_path);
+ const std::string scratch_dir () const;
+ const std::string file_dir () const;
+ const std::string state_dir (unsigned num) const;
+
static char* lv2_state_make_path (void* host_data,
const char* path);