summaryrefslogtreecommitdiff
path: root/libs/ardour/lv2_plugin.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-10-13 16:04:28 +0200
committerRobin Gareus <robin@gareus.org>2016-10-13 16:04:28 +0200
commit215d88ac87aea8d9c30c86614c2ebe0f4bf57f20 (patch)
tree08d0f6b952a03a642d390a04daf5da8a4303b1fe /libs/ardour/lv2_plugin.cc
parentc09e4675957a450479e58af1e51e90a860b6bb34 (diff)
Allow a LV2 plugin to mark the session dirty
If some plugin-internal state changes (GUI <> Plugin e.g. load a sample) no ports change and the host does not know that the plugin state has changed. The session may be closed without save. This is a prototype using an ardour.org URI, pending upstream lv2plug.in
Diffstat (limited to 'libs/ardour/lv2_plugin.cc')
-rw-r--r--libs/ardour/lv2_plugin.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/ardour/lv2_plugin.cc b/libs/ardour/lv2_plugin.cc
index 2d19ea9458..717e933ebf 100644
--- a/libs/ardour/lv2_plugin.cc
+++ b/libs/ardour/lv2_plugin.cc
@@ -2692,6 +2692,18 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
}
}
}
+
+ // Intercept state dirty message
+ if (_has_state_interface /* && (flags & PORT_DIRTYMSG)*/) {
+ LV2_Atom* atom = (LV2_Atom*)(data - sizeof(LV2_Atom));
+ if (atom->type == _uri_map.urids.atom_Blank ||
+ atom->type == _uri_map.urids.atom_Object) {
+ LV2_Atom_Object* obj = (LV2_Atom_Object*)atom;
+ if (obj->body.otype == _uri_map.urids.state_Dirty) {
+ _session.set_dirty ();
+ }
+ }
+ }
#endif
// Intercept patch change messages to emit PropertyChanged signal